Policy inheritance is the process where security settings applied at a higher level of the hierarchy automatically flow down to all child resources. The effective policy for any specific resource is the union of the permissions granted directly to it and those inherited from its ancestors. It is vital to remember that permissions are additive, meaning a user gains all rights granted at every level of the hierarchy. This mechanism allows for broad access control at the folder level while maintaining specific rules for individual projects.
To maintain strict governance, organizations use the Organization Policy Service to enforce specific configurations across the hierarchy. These constraints allow administrators to set global guardrails, such as domain-restricted sharing, which limits which external identities can be granted access. Organization policies are also inherited by descendants but can be superseded by more specific rules at lower levels when necessary. This centralized approach helps maintain compliance with strict industry standards and internal security regulations.
Implementing the principle of least privilege requires careful placement of IAM roles within the hierarchy to avoid granting excessive access. While allow policies grant permissions, deny policies can be used to explicitly prevent certain actions regardless of any other granted roles. Deny policies are always evaluated before allow policies, providing a powerful tool for resource isolation and security. This ensures that sensitive data remains protected even if a user is accidentally granted broad access at a higher folder level.
Best practices for designing a hierarchy include using a single organization node to reduce management overhead and implementing standardized naming conventions. Administrators should keep bootstrapping resources and common services in separate folders to maintain a clean and secure environment. It is also recommended to use folders to segregate different stages of development, such as:
- Production environments for live, sensitive workloads.
- Staging environments for testing configurations before they go live.
- Development environments for initial coding and experimentation.
Service Account Security and Workload Identity
Service accounts are special types of non-human accounts used by applications and virtual machines to access Google Cloud resources. It is vital to avoid using default service accounts because they often have broad permissions that increase security risks. Instead, developers should create custom service accounts that are tailored to specific tasks and workloads.
Implementing the principle of least privilege is a core strategy for securing these non-human identities. This means granting only the minimum permissions necessary for a service to function, which limits the potential damage if an account is compromised. To achieve this, administrators should:
- Use custom IAM roles instead of broad basic roles like "Editor."
- Regularly identify and remove unused service accounts to reduce the attack surface.
- Use IAM tags to conditionally allow or deny access based on resource labels.
Managing service account keys is a major security challenge because they are long-lived credentials that can be leaked or stolen. To reduce this risk, organizations should require regular key rotation and monitor for any unauthorized usage. Whenever possible, it is better to use short-lived credentials or service account impersonation to avoid the dangers of static, permanent keys.
For containerized environments, Workload Identity for GKE provides the most secure way to manage non-human identities. This feature links Kubernetes service accounts to Google Cloud service accounts, allowing applications to authenticate automatically. Using this method eliminates the risks associated with storing sensitive keys inside container images or as Kubernetes secrets.
Finally, organization policies help enforce security standards across an entire cloud environment. For example, administrators can disable the creation of new service account keys to force teams toward more secure authentication methods. Using Cloud Audit Logs ensures that all actions taken by these accounts are recorded for monitoring and incident response.