Prepare and test your skills
Prepare and test your skills
Identity and Access Management (IAM) is the system that controls who can act on Google Cloud resources by binding principals to roles on resources. The resource hierarchy flows from the organization at the top through folders in the middle to projects at the bottom, and projects contain service resources such as Compute Engine virtual machines, Cloud Storage buckets, and Pub/Sub topics. An IAM allow policy set on a parent is inherited by all children below it, so effective permissions are evaluated along the full chain from organization to resource.
Principals include Google Accounts, service accounts, Google Groups, and Google Workspace or Cloud Identity accounts. Permissions are grouped into roles, and roles are granted to principals through IAM allow policies. Organization policies follow a similar inheritance pattern, where a parent constraint such as Restrict TLS Versions applies to all descendants unless a child sets its own exception. A parent folder can contain up to 300 direct child folders, folders can be nested up to 10 levels deep, and billing is assigned at the project level.
Role choice enforces least privilege by giving each identity only the permissions it needs at the narrowest scope:
| Role type | Permission scope | Examples |
|---|---|---|
| Primitive, also called basic | Broad access across a project | Owner (roles/owner), Editor (roles/editor), Viewer |
| Predefined | Narrower permissions for a service or job function | Project Creator (roles/resourcemanager.projectCreator), Service Usage Admin (roles/serviceusage.serviceUsageAdmin) |
| Custom | Customer-defined set for a specific need | projects/PROJECT_ID/roles/IDENTIFIER, organizations/ORG_ID/roles/IDENTIFIER |
Service accounts separate what application code can access from who can use the account. The service account receives roles for the data it must reach, while a user who attaches it to a virtual machine needs the Service Account User role (roles/iam.serviceAccountUser) on that service account. Separation of duties places application projects in a Prod folder and keys in a separate key project in a Shared folder, so a developer can be Project Owner on an application without gaining key privileges. No principal should hold both Cloud KMS Admin and CryptoKey Encrypter/Decrypter on the same key.
Data protection in Google Cloud separates key custody from data storage and secret use from code. Cloud Key Management Service (Cloud KMS) holds customer-managed keys separately from the services that store data, while Secret Manager stores API keys, passwords, and certificates outside application code. Default encryption at rest protects all customer content without customer action, so teams focus protection on keys and secret handling.
Envelope encryption wraps each data encryption key (DEK) stored near the data with a key encryption key (KEK) stored centrally in Cloud KMS. Traffic flows from the data service to Cloud KMS for wrap and unwrap operations, then the service uses the unwrapped DEK to protect stored data. A person requesting data does not need direct access to the customer-managed encryption key (CMEK) because access flows through the service account that holds permission on the key. Hardware protection uses Cloud Hardware Security Module (Cloud HSM) (opens in a new tab) with FIPS 140-2 Level 3 modules, with multi-tenant clusters serving many customers and single-tenant partitions serving one customer at additional cost.
A numbered process flow showing envelope encryption: a requester asks the data service for data, the service sends the wrapped data encryption key to Cloud KMS, Cloud KMS unwraps it with the customer-managed key encryption key, the unwrapped DEK returns to the service to decrypt stored data, and the requester never needs direct access to the CMEK.
Key setup follows a fixed dependency order where each step depends on the prior step:
roles/cloudkms.cryptoKeyEncrypterDecrypter) on the specific key.Encryption choices differ in who manages keys and how much lifecycle control the customer keeps:
| Option | Who manages keys | Difference |
|---|---|---|
| Google-managed keys | Google manages DEKs and KEKs | No configuration and no extra key cost |
| Customer-managed encryption keys (CMEK) | Customer manages keys in Cloud KMS, with Cloud HSM and Cloud External Key Manager (Cloud EKM) options | Lifecycle control, rotation reporting, and external key storage |
| Customer-supplied encryption keys (CSEK) | Customer supplies keys per operation | Direct control but fewer services and no central lifecycle |
A key version moves through administrative states in order: first Enabled where it can encrypt and decrypt, then Disabled where data becomes inaccessible until re-enabled, then Scheduled for destruction where requests fail but restoration is still possible, and finally Destroyed where material is irrecoverably lost. Rotation creates a new primary version for new encryption and does not automatically re-encrypt old data, so older Enabled versions must be retained until data is re-encrypted or deleted. Secret Manager stores each secret with versions, replicates payloads automatically unless location constraints require otherwise, grants Secret Manager Secret Accessor (roles/secretmanager.secretAccessor) on individual secrets, and rotates through notify with a SECRET_ROTATE message to Pub/Sub, generate and add a new version, then retire the old version.
Governance and network controls set baselines once at the top that apply to everything below. Organization Policy governs what resources can be configured, while Hierarchical Firewall Policy governs what network traffic can reach them. Together they prevent a project from creating a risky configuration or opening a port that the baseline blocks.
Organization Policy constraints disable creation of user-managed service account keys, block external IP addresses on Compute Engine, block legacy authorization on GKE, and require location and Confidential VM placement. Hierarchical Firewall Policy sits above individual VPC rules, starts with default deny, uses custom VPC networks instead of default networks, and blocks overly permissive rules and generic access to sensitive ports for SSH, RDP, Telnet, FTP, SMTP, DNS, HTTP, LDAP, databases, and caching. Security Command Center monitors drift, reporting deleted organization constraints separately from open-port firewall findings.
VPC Service Controls creates a data-transfer boundary around projects and protected APIs to prevent exfiltration. Resources inside the same perimeter communicate freely when IAM and network permissions allow, while cross-boundary API calls are blocked by default. A common unified perimeter with all sensitive projects inside gives the strongest protection with the lowest overhead, while multiple perimeters isolate data with different trust or compliance needs but add east-west management overhead for traffic between perimeters. Networks must use Private Google Access to the restricted VIP 199.36.153.4/30 (restricted.googleapis.com) and must not bypass the perimeter with a route to the private VIP at private.googleapis.com. Communication between perimeters requires coordinated rules on both sides where the source allows the egress and the destination allows the ingress.
Exam tip: Organization Policy controls what resources can be configured, while Hierarchical Firewall Policy controls what traffic can reach them.
Secure remote access replaces direct internet exposure and long-lived keys with identity checks and short-lived tokens. Identity-Aware Proxy (IAP) is a reverse proxy between the client device and the backend VM or web app, so the backend needs no external IP because clients connect to IAP and IAP connects to the backend. Access requires authentication, the IAP-Secured Web App User role (roles/iap.httpsResourceAccessor), optional context-aware checks, and auditing of each connection.
Chrome Enterprise Premium access levels are user-centric controls defined in Access Context Manager and checked on every API request, such as IP, location, and certificate-based mutual TLS. Endpoint Verification supplies device posture signals so managed devices can be distinguished from unmanaged devices. VPC Service Controls is resource-centric and defines perimeters where resources can communicate for all identities, while Chrome Enterprise Premium covers only organization user identities. Context-aware TCP forwarding fits VMs that should allow SSH only from certain devices or locations, where the only SSH path flows from the client through IAP to the VM.
Workload Identity Federation exchanges external credentials for short-lived Google tokens through the Security Token Service (STS). The ordered exchange runs from external provider to Google Cloud:
Least privilege grants roles/iam.workloadIdentityUser only to specific subjects or filtered principalSet:// identifiers, never to all members of a pool. The organization constraint constraints/iam.disableServiceAccountKeyCreation blocks new downloadable keys and forces federation, while any remaining keys are rotated every 90 days or less. Federation options differ by caller:
| Option | What it aggregates | Choose when |
|---|---|---|
| Workload Identity Federation | Machine workloads from AWS, Azure, GitHub, or OIDC/SAML providers | Workload runs outside Google Cloud and calls Google APIs without keys |
| Workload Identity Federation for GKE | Kubernetes service accounts in GKE | GKE workload should act as an IAM service account directly |
| Workforce Identity Federation | Human users from an external provider | Employees or partners sign in with external accounts to use console or gcloud |
A secure software supply chain connects trusted builds, controlled artifacts, and verified deployments into one chain. Source code flows into Cloud Build for isolated builds, built artifacts flow into Artifact Registry for storage and scanning, and deployment requests flow into Binary Authorization where policy allows only verified images to reach runtimes such as GKE or Cloud Run. An ephemeral build environment provisions a fresh VM or container for one build and destroys it afterward, so no residual files carry over between builds.
Build provenance is verifiable data linking inputs, build system, and outputs, including image digests, source locations, toolchain, and duration. Higher Supply-chain Levels for Software Artifacts (SLSA) levels carry stronger proof, from Level 1 with basic build details, to Level 2 with service-generated signed provenance, to Level 3 with entry point and all user-controlled parameters. An attestor verifies that an image meets a criterion such as passing vulnerability scanning, and verification succeeds only when the attestation signature validates with a trusted public key in the attestor. Artifact Registry centralizes container images and language packages, with remote repositories caching Docker Hub, Maven Central, PyPI, Debian, or CentOS artifacts and virtual repositories prioritizing private packages to reduce dependency confusion.
Secure AI keeps training data, model artifacts, and prediction requests inside controlled boundaries with content screening and customer-controlled encryption. Model Armor screens large language model (LLM) prompts before they reach the model and responses before they reach the user, with user prompts flowing from the application to Model Armor to the model and back through Model Armor to the user. Filters include injection and jailbreak screening, harmful-content screening for obscenity, extremism, violence, and hate speech, and sensitive-data screening with Sensitive Data Protection de-identification templates. Sensitive Data Protection discovers PII in BigQuery and text, classifies findings, and applies pseudonymization, redaction, bucketing into broader ranges, and differential privacy with noise for aggregations. Secure deployment places BigQuery and Cloud Storage inside a VPC Service Controls perimeter that overrides permissive IAM, requires both IAM identity and Access Context Manager context on every request, and encrypts with CMEK envelope encryption.
Continue with this study guide: Designing for security
Data residency, locality, and sovereignty answer three different compliance questions about the same workload. Data residency describes where Customer Data is stored at rest, data locality adds where data is processed in use and transmitted in transit plus where workloads can be accessed from, and data sovereignty adds which jurisdiction governs the data including which laws apply and which personnel and keys control it. A workload can satisfy residency but still violate locality if it is processed outside its home region, or violate sovereignty if it is administered from outside its jurisdiction.
| Concept | Core question | Enforced with |
|---|---|---|
| Data residency | Where is data stored at rest? | Resource Locations constraint, regional bucket or dataset location, Assured Workloads folder |
| Data locality | Where is data stored, processed, and accessed? | Regional services, VPC Service Controls perimeter, Cloud Armor geo rules, Identity-Aware Proxy (IAP) |
| Data sovereignty | Which jurisdiction, personnel, and keys control data? | EU data boundary, routing to EU personnel, access approvals, customer-managed encryption keys |
Assured Workloads (opens in a new tab) packages location enforcement for regulated requirements. An Assured Workloads folder applies a selected control package that presets allowed regions and related constraints for every project created inside it. Only resources created inside the compliant folder inherit the protection, so sensitive data must be placed and kept there. The constraints/gcp.resourceLocations organization policy can be attached at the organization, folder, or project level, and when the policy denies a region, users cannot provision new in-scope resources there.
Enforcement follows an ordered dependency where location must be fixed before deployment. First, create the boundary by creating an Assured Workloads folder and selecting a control package. Then inherit the location rule that limits which regions appear as choices. Then deploy inside the boundary by creating projects and resources only inside the folder and only in allowed regions. Regionality affects availability because multi-regional resources resist regional failure, regional resources resist only zonal failure, and zonal resources fail with their zone. Privacy frameworks add handling rules on top of location, with HIPAA setting United States standards for electronic personal health information and GDPR requiring customer data for EU residents to stay in EU regions with processing and supporting artifacts kept in that region.
Commercial sensitive data protection finds confidential cardholder data and personally identifiable information (PII) and keeps it usable without exposing raw values. Sensitive Data Protection automates discovery, classification, and de-identification of credit card numbers, addresses, and phone numbers across storage and analytics services. Discovery shows where sensitive data lives, and de-identification replaces raw values while keeping analytical value.
Automated discovery continuously scans the organization, folder, or project without manual scans, so new projects or uploads are discovered, classified, and reported automatically. Each scan produces data profiles with sensitivity level, data risk level, infoType findings such as PHONE_NUMBER, and location, and profiles flow to Security Command Center, Google SecOps, BigQuery, and Knowledge Catalog. When sensitive data appears where it was not expected or without proper controls, the workload has high data risk. To lower BigQuery column risk, apply a policy tag to restrict access, remove unneeded data, and export profiles before deletion if history must be kept.
De-identification transforms raw values before storage or by creating a de-identified copy:
| Technique | How it protects | Utility preserved |
|---|---|---|
| Masking | Replaces characters with redacted symbols | Keeps record structure while hiding the value |
| Tokenization | Replaces value with a token re-identifiable only with proper keys | Keeps format and joinability without exposing raw PII |
| Bucketing | Replaces precise values with broader ranges | Keeps statistical patterns while reducing identifiability |
Isolation keeps commercial sensitive data inside a tightly controlled boundary through three layers. Logical segmentation groups all in-scope projects in a dedicated PCI folder and keeps in-scope and out-of-scope workloads in different projects. Network segmentation places cardholder data environment (CDE) resources in dedicated VPCs and subnets with default-deny firewall rules. Service-level segmentation defines a VPC Service Controls perimeter around in-scope projects with ingress rules for who can enter and egress rules for where data can leave. Without that isolation, the entire cloud footprint falls in scope. All users with sensitive-data access must use multifactor authentication as 2-Step Verification.
Industry certification groups cover different compliance domains rather than interchangeable approvals. AlloyDB illustrates coverage because it carries certifications across information security, service controls, payment card, and health domains, including ISO 27001, ISO 27017, ISO 27018, ISO 27701, SOC 1, SOC 2, SOC 3, PCI DSS, and HIPAA. The ISO group addresses information security management and cloud-specific controls, the SOC group addresses operational controls and trust principles, PCI DSS addresses payment card security, and HIPAA addresses health information handling. The compliance resource center is the central source for checking which services hold which certifications.
Shared responsibility divides audit controls between Google and the customer. Google secures physical infrastructure and network security, applies default encryption, restricts privileged access, and proves controls through programs such as FedRAMP High Provisional Authority to Operate. The customer classifies data, places regulated data inside appropriate folders, configures least-privilege IAM, organizes hierarchy so it does not expose personal data, and implements encryption, perimeters, and monitoring. A certification is satisfied only when both sides meet their assigned controls.
Responsibility shifts by service model and determines how many controls appear in the customer audit scope:
| Service model | Example services | Responsibility split |
|---|---|---|
| Infrastructure as a Service (IaaS) | Compute Engine, Cloud Storage, Cloud VPN, Cloud Load Balancing, Cloud DNS | Customer holds most security responsibility; Google holds underlying infrastructure |
| Platform as a Service (PaaS) | App Engine, Google Kubernetes Engine (GKE), BigQuery | Google owns more controls; customer remains responsible for data security and IAM |
| Software as a Service (SaaS) | Google Workspace, Google Security Operations, Marketplace SaaS | Google owns most security; customer remains responsible for access and data placed in the app |
Compliance evidence combines third-party reports with technical records. Architects request ISO certificates, SOC reports, and bridge letters for gap periods through the account team. Artifact Registry provides technical evidence with centralized vulnerability policies, where build-time scanning fails violating builds, registry admission uses Binary Authorization to block non-compliant deploys, and runtime monitoring checks running containers for newly disclosed vulnerabilities.
Cloud Audit Logs records who did what, where, and when within Google Cloud resources. Logs are written for each project, folder, organization, and billing account, and projects contain only audit logs for resources directly within that project. An audit log entry names its owner, target resource, time, and writing service through serviceName, authentication information, caller IP, and success or failure status.
Audit log categories divide operations by the kind of action performed:
| Category | Log name suffix | Operations documented |
|---|---|---|
| Admin Activity audit logs | cloudaudit.googleapis.com%2Factivity | Admin write operations on metadata or configuration |
| Data Access audit logs | cloudaudit.googleapis.com%2Fdata_access | Admin read, data read, and data write operations |
| System Event audit logs | cloudaudit.googleapis.com%2Fsystem_event | System events such as Compute Engine live migration |
| Policy Denied audit logs | cloudaudit.googleapis.com%2Fpolicy | Operations denied by policy |
Admin Activity logs are always enabled and cannot be disabled, while Data Access logs are disabled by default because they can be large, with the exception of BigQuery Data Access logs which cannot be disabled. Visibility into Google personnel uses Access Transparency logs and Access Approval for support access.
Log buckets in Cloud Logging store and organize log data, with _Required and _Default buckets created automatically. The _Required bucket stores Admin Activity and System Event logs and cannot be disabled. A log sink is a routing rule that sends a copy of matching logs to a destination outside the source bucket:
| Destination | What it provides | Choose when |
|---|---|---|
| Cloud Storage | Low-cost object storage | Long-term archiving is needed for retention and forensics |
| BigQuery | SQL-based dataset for search and analysis | Large volumes must be queried quickly across time and projects |
| Pub/Sub | Real-time message delivery | Logs must flow to a SIEM or automation |
An aggregated sink at the organization or folder level routes logs from all projects under it into one central destination. A retention period on a log bucket defines how long Cloud Logging keeps every log in that bucket and can be set from 1 day to 3650 days, so separate buckets are needed when data types require different periods. Investigation follows an ordered flow from examining audit logs in Logs Explorer, to searching for all API calls by a compromised identity including impersonation, to checking for new keys or accounts created for persistence, to correlating Security Command Center findings, to containing unexpected VMs, apps, service accounts, and buckets. Network evidence adds VPC Flow Logs per subnet, Firewall Rules Logging per rule, VPC Service Controls logs for allowed and denied perimeter moves, and Cloud Load Balancing logs for edge requests.
Exam tip: Data residency commitments cover Customer Data at rest, not resource names, IDs, labels, or Service Data, so never store health information, personal identifiers, or cardholder data in those fields.
Continue with this study guide: Designing for compliance
Organization Policy governs what resources can be configured, while Hierarchical Firewall Policy governs what network traffic can reach them. Organization Policy constraints disable creation of user-managed service account keys, block external IP addresses on Compute Engine, block legacy authorization on GKE, and require location and Confidential VM placement, while Hierarchical Firewall Policy sits above individual VPC rules, starts with default deny, uses custom VPC networks instead of default networks, and blocks overly permissive rules and generic access to sensitive ports.
Use customer-managed encryption keys (CMEK) when you need lifecycle control, rotation reporting, and external key storage with keys managed in Cloud Key Management Service (Cloud KMS). Google-managed keys require no configuration and have no extra key cost because Google manages data encryption keys and key encryption keys, while customer-supplied encryption keys (CSEK) give direct control per operation but support fewer services and provide no central lifecycle.
Identity-Aware Proxy (IAP) is a reverse proxy between the client device and the backend virtual machine or web app, so the backend needs no external IP because clients connect to Identity-Aware Proxy (IAP) and Identity-Aware Proxy (IAP) connects to the backend. Access requires authentication, the IAP-Secured Web App User role, optional context-aware checks, and auditing of each connection.
Last updated