GCP Compute Firewall allows public access Affecting Network service in Google


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Network/ Firewall

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-ControlsCSA-CCMISO-27001NIST-800-53PCI-DSSSOC-2
  • Snyk IDSNYK-CC-00401
  • creditSnyk Research Team

Description

Inbound traffic is allowed to a resource from any source instead of a restricted range.

How to fix?

Set source_ranges to specific IP range only, e.g. 192.168.1.0/24.

Example Configuration

resource "google_compute_firewall" "allowed" {
  name      = "test-firewall"
  network   = "default"
  direction = "INGRESS"
  allow {
    protocol = "icmp"
  }
  allow {
    protocol = "tcp"
    ports    = ["80", "8080", "1000-2000"]
  }
  source_ranges = ["192.168.0.0/24"]
}