QuestionQ129

VerifiedPlanning and implementing a cloud solution

You are working with a user to set up an application in a new VPC that sits behind a firewall. The user is concerned about data egress, and you want to configure the fewest open egress ports possible. What should you do?

Explanation

Google Cloud VPC firewall rules are evaluated in order of priority, where a lower numeric value indicates higher precedence. Every VPC network also has an implied allow-all-egress rule at priority 65535. To minimize open egress ports, you should create a high-priority rule (priority 1000, which is evaluated first) that explicitly allows only the specific ports required by the application, combined with a low-priority rule (priority 65534) that denies all other egress traffic. Because the allow rule at priority 1000 is evaluated before the deny rule at priority 65534, only the specified ports remain open, while the deny rule blocks everything else that isn't explicitly permitted, effectively overriding the network's implied allow-all-egress default and enforcing least-privilege network access.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!