An enterprise cloud security architect needs to ensure that newly created Google Cloud projects do not automatically grant the primitive Editor role to default service accounts, such as the default Compute Engine service account. The guardrail must be centrally managed and automatically enforced across all current and future projects in the resource hierarchy without relying on post-provisioning scripts or manual developer compliance. Which approach meets these governance requirements?
- Enforce the `iam.automaticIamGrantsForDefaultServiceAccounts` boolean Organization Policy constraint at the Organization root level.Answer
- BConfigure an automated Cloud Pub/Sub and Cloud Function pipeline to remove primitive IAM roles from default service accounts after project creation.
- CEstablish a VPC Service Controls perimeter around all newly created projects to restrict access to default service accounts.
- DRevoke the Service Account User role (`roles/iam.serviceAccountUser`) from project creators at the Organization level.
Answer
Enforce the `iam.automaticIamGrantsForDefaultServiceAccounts` boolean Organization Policy constraint at the Organization root level.
Enforcing the boolean Organization Policy constraint `iam.automaticIamGrantsForDefaultServiceAccounts` at the Organization root level ensures that when service APIs (such as Compute Engine) are enabled in any project, Google Cloud does not automatically grant the primitive Editor role to default service accounts. Because Organization Policies inherit down the resource hierarchy, setting this at the root guarantees proactive compliance for all current and future projects.
Step-by-Step Solution
Key Concept
Organization Policy Boolean Constraints for Service Account Security
Estimated Time:1m 30s