bug(compute): false positive for egress ports on GCP #10096
Replies: 1 comment
-
|
Hi @manuelbernhardt ! Trivy uses static analysis, so evaluating configurations that rely on data blocks dependent on cloud state is limited—this is a known limitation. In your example, the value of the expression You can safely ignore this check for this resource using the following rule: # trivy:ignore:GCP-0035
resource "google_compute_firewall" "reproducer" {Or |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
IDs
AVD-GCP-0035
Description
Misconfiguration is detected even though
destination_rangesis specified. Perhaps this is related to the destination_ranges values being computed dynamically.Reproduction Steps
locals { allowed_egress_ips = toset([ for ip in flatten([for domain in var.allowed_egress_domains : try(data.dns_a_record_set.allowed_domains[domain].addrs, [])]) : "${ip}/32" ]) } data "dns_a_record_set" "allowed_domains" { for_each = toset(["www.google.com", "www.aquasec.com"]) host = each.value } resource "google_compute_firewall" "reproducer" { name = "egress-rule" network = "default" project = "project" description = "Allow outbound TCP traffic on port 443" direction = "EGRESS" priority = 1000 allow { protocol = "tcp" ports = ["443"] } destination_ranges = local.allowed_egress_ips target_tags = ["twingate-connector-${var.environment}"] }Target
Filesystem
Scanner
Misconfiguration
Target OS
No response
Debug Output
Version
Checklist
-f jsonthat shows data sources and confirmed that the security advisory in data sources was correctBeta Was this translation helpful? Give feedback.
All reactions