GCP Professional Cloud Security Engineer Practice Question
Your team is creating a Google Cloud Armor security policy to protect an external HTTP(S) Load Balancer that fronts your company's public website. The policy must meet all of the following requirements:
- Corporate allow-list - Always allow traffic coming from the Shanghai office IP range
203.0.113.0/24(these addresses geolocate to country code CN). - Geo-block - Block every other request whose source country code is CN.
- Admin endpoint hardening - For any request whose path starts with
/admin, allow it only when the request headerX-Admin-Tokenequals"prod-console"; otherwise block it. - Default posture - Permit all other traffic.
Cloud Armor evaluates rules in ascending order of priority (0 is highest) and stops at the first match. You want to satisfy the requirements with the fewest explicit rules (the implicit default rule may remain unchanged).
Which rule sequence accomplishes the goal?
priority 100 - ALLOW if
inIpRange(origin.ip, '203.0.113.0/24')priority 200 - DENY (403) iforigin.region_code == 'CN'priority 300 - ALLOW ifrequest.path.startsWith('/admin') && request.headers['X-Admin-Token']=='prod-console'priority 310 - DENY (403) ifrequest.path.startsWith('/admin')(default rule: ALLOW)priority 100 - DENY (403) if
origin.region_code == 'CN'priority 200 - ALLOW ifinIpRange(origin.ip, '203.0.113.0/24')priority 300 - ALLOW ifrequest.path.startsWith('/admin') && request.headers['X-Admin-Token']=='prod-console'priority 310 - DENY (403) ifrequest.path.startsWith('/admin')(default rule: ALLOW)priority 100 - ALLOW if
inIpRange(origin.ip, '203.0.113.0/24')priority 200 - DENY (403) iforigin.region_code == 'CN'priority 300 - DENY (403) ifrequest.path.startsWith('/admin') && request.headers['X-Admin-Token']!='prod-console'(default rule: ALLOW)priority 100 - ALLOW if
request.path.startsWith('/admin') && request.headers['X-Admin-Token']=='prod-console'priority 110 - DENY (403) ifrequest.path.startsWith('/admin')priority 200 - ALLOW ifinIpRange(origin.ip, '203.0.113.0/24')priority 300 - DENY (403) iforigin.region_code == 'CN'(default rule: ALLOW)