Skip to content

Files

Latest commit

 

History

History
29 lines (19 loc) · 580 Bytes

GCP004.md

File metadata and controls

29 lines (19 loc) · 580 Bytes

Pattern: An outbound firewall rule allows traffic to /0

Issue: -

Description

Network security rules should not use very broad subnets.

Where possible, segments should be broken into smaller subnets and avoid using the /0 subnet.

Resolution: Set a more restrictive cidr range.

Examples

Example of incorrect code:

resource "google_compute_firewall" "bad_example" {
	destination_ranges = ["0.0.0.0/0"]
}

Example of correct code:

resource "google_compute_firewall" "good_example" {
	destination_ranges = ["1.2.3.4/32"]
}