You have the following resource hierarchy. There is an organization policy at each node in the hierarchy as shown. Which load balancer types are denied in VPC A?
A.
All load balancer types are denied in accordance with the global node's policy.
B.
INTERNAL_TCP_UDP, INTERNAL_HTTP_HTTPS is denied in accordance with the folder's policy.
C.
EXTERNAL_TCP_PROXY, EXTERNAL_SSL_PROXY are denied in accordance with the project's policy.
D.
EXTERNAL_TCP_PROXY, EXTERNAL_SSL_PROXY, INTERNAL_TCP_UDP, and INTERNAL_HTTP_HTTPS are denied in accordance with the folder and project's policies.
Outcome:
Both the folder-level and project-level denials will be enforced. This is because they apply to different types of traffic and don't conflict with each other. Essentially, the restrictions are combined.
Key Concepts
Inheritance: Policies are inherited down the hierarchy. A project inherits policies from its parent folder, and the folder inherits from the organization.
Overriding: A lower level policy can override a higher-level policy only if it is more restrictive.
Constraints: Organization Policies use "constraints" to define restrictions.
1 In your case, the constraints are likely related to VPC firewall rules.
i asked Gemini here is the answer: In the scenario you described, the following load balancer types would be denied in a VPC defined within the project in the subfolder:
external_tcp_proxy
external_ssl_proxy
Here's the breakdown of how Org policy constraints are enforced with inheritance:
Organization Level Constraint: This denies all load balancers.
Subfolder Constraint: This overrides the organization-level constraint and only denies internal_tcp_udp and internal_http_https load balancers.
Project Level Constraint: This further refines the allowed types within the subfolder by denying external_tcp_proxy and external_ssl_proxy load balancers.
Policies are inherited, so folder and project must be merged. Keep in mind, deny policies are always applied, and when conflicting with an allow policy the deny has higher prio and will overule the allow. So, merge all the deny policies and the result is D.
My option is A. If "inheritFromParent" is not explicitly set, the default behavior in GCP if for inheritance to prevail. Based on this assumption, the project inherits from the folder and the organization above, all constraints are merged at the project level.
Answer is C..
If the policy is set to merge with parent, the json output will show:
"inheritFromParent": true
If the policy is set to replace the parent policy, that line is missing, which is the same as the output in the diagram.
Therefore, the parent policy is replaced with the child policies and only the project level conditions are in effect.
The answer should be C
Link: https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy
Inheritance
A resource node that has an organization policy set by default supersedes any policy set by its parent nodes in the hierarchy. However, if a resource node has set inheritFromParent = true, then the effective Policy of the parent resource is inherited, merged, and reconciled to evaluate the resulting effective policy.
Project 2 has an organisation policy set and there's no mention of any inheritance.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
tangac
Highly Voted 2 years, 2 months agoAzureDP900
2 years agokalbd2212
Most Recent 6 days, 15 hours agoluamail78
3 weeks, 4 days agooezgan
8 months agoNachtwaker
8 months, 2 weeks agomjcts
10 months, 3 weeks agopbrvgl
12 months agomjcts
10 months, 3 weeks agosteveurkel
1 year agodesertlotus1211
1 year, 2 months agoWheresWally
1 year, 6 months agogcpengineer
1 year, 6 months agogcpengineer
1 year, 6 months agohxhwing
1 year, 10 months agomadhu81321
1 year, 12 months agoTheBuckler
2 years, 1 month agoTable2022
2 years agoTheBuckler
2 years, 1 month ago[Removed]
2 years, 2 months ago