Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in GCP Policyfile unrestrictedRdpAccess.rego #735

Closed
menzbua opened this issue May 5, 2021 · 4 comments
Closed

Issue in GCP Policyfile unrestrictedRdpAccess.rego #735

menzbua opened this issue May 5, 2021 · 4 comments
Assignees
Labels
policy Issue concerning policy maintainers.

Comments

@menzbua
Copy link
Contributor

menzbua commented May 5, 2021

  • terrascan version: 1.5.1
  • Operating System: Linux

I think i found a bug in the File terrascan/pkg/policies/opa/rego/gcp/google_compute_firewall/unrestrictedRdpAccess.rego. In my environment i got the violation that i have unrestricted RDP Access Allowed to my infrastructure but we have restricted the source addresses in the rules. So for my perspective there should be an addition to the policy file

fire_rule.source_ranges[_] == "0.0.0.0/0"

After i added that to in my environment, i really get the violations for rules that have unrestricted access to my servers via RDP.

What do you think about it?

Regards
Manuel

@amirbenv amirbenv added the policy Issue concerning policy maintainers. label May 5, 2021
@gaurav-gogia
Copy link
Contributor

hi @menzbua, can you please share terraform file for the same? it'll be easier to understand the bug that way.

@menzbua
Copy link
Contributor Author

menzbua commented May 12, 2021

hi @gaurav-gogia,

for example this is a terraform code that terrascan detects as unrestricted rdp access:

resource "google_compute_firewall" "" {
  name               = "ingress-allow-rdp"
  description        = "terraform managed"
  disabled           = false
  direction          = "INGRESS"
  network            = google_compute_network
  priority           = 1000
  source_ranges      = ["27.245.20.0/20"]

  allow {
    protocol = "tcp"
    ports    = ["3389"]
  }
}

Regards
Manuel

@gaurav-gogia
Copy link
Contributor

@menzbua

Thanks! I understand the bug in policy code now.

Would you like to raise a PR with the suggested fix or should we move forward with it?

@menzbua
Copy link
Contributor Author

menzbua commented May 12, 2021

@gaurav-gogia

I will create a Pull Request with the fix.

Regards
Manuel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
policy Issue concerning policy maintainers.
Projects
None yet
Development

No branches or pull requests

4 participants