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. The Organization resource (opens in a new tab) sits at the top of the lineage, with folders in the middle and projects holding service resources at the bottom. An IAM allow policy attached at a higher node cascades to everything below it, so effective permissions are found by evaluating the full chain from organization to resource.
Resource hierarchy and policy inheritance is how IAM grants flow from broad management layers to specific service resources. All resources belong to an organization, folders group related projects and nested folders, and projects contain service resources such as Compute Engine virtual machines, Pub/Sub topics, Cloud Storage buckets, and Cloud VPN endpoints. A parent folder can contain up to 300 folders, and folders can be nested up to 10 levels deep. Setting a policy on a folder grants access for every project and service resource under that folder without repeating the grant on each child.
A hierarchy tree from Organization through folders to projects and service resources, showing that an IAM allow policy attached at the Organization cascades down to every project and resource below it.
The access model consists of four core concepts:
Organization policies follow a similar inheritance pattern where a parent setting applies to all child folders and projects. For example, if a Restrict TLS Versions constraint denies TLS 1.0 at the organization level, it is denied for all descendants unless a child sets its own policy to change that restriction for its own descendants.
Exam tip: Use a folder-level grant when the same access applies to every project in a team or environment, and use a project-level grant when access must be limited to one workload.
Service account security is the practice of giving applications non-human identities while avoiding long-lived downloadable keys. A service account (opens in a new tab) is an IAM identity for software, and Workload Identity Federation for GKE lets pods in Google Kubernetes Engine (GKE) act as a Google service account without downloading keys. When a key is used, copies often remain in gcloud CLI configuration files, local file systems, code repositories, or build artifacts, where an attacker with read access can copy and reuse the key until it is deleted.
Eliminating keys means replacing them with short-lived authentication and blocking new keys with policy. The preferred approach uses Workload Identity Federation for GKE or attached service accounts on Compute Engine, sets the organization constraint constraints/iam.disableServiceAccountKeyCreation to prevent new key creation, and rotates any remaining keys every 90 days or less as a temporary control. The flow starts at the pod, which requests credentials from the GKE metadata server; the metadata server issues a short-lived token that the workload presents to a Google Cloud API, and IAM checks whether an allow policy permits that Kubernetes identity to impersonate the target service account.
Role differentiation means giving each identity only the permissions it needs by choosing the narrowest role type and scope. A role granted at a higher level is inherited below, so a broad grant at the top affects many resources while a narrow grant on one project affects only that project. Inherited roles cannot be edited from the child where they appear; the change must be made where the role was originally granted.
| Role type | Permission scope | Example identifiers |
|---|---|---|
| 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 account permissions separate what the service account can access from who can use it. The service account receives roles for the resources its code must reach, while a user who attaches that service account to a Compute Engine instance needs the Service Account User role (roles/iam.serviceAccountUser) on the service account. Keeping these two layers separate prevents a user who can deploy a virtual machine from automatically gaining all of the service account's data permissions.
Continue with this study guide: Identity and Access Management (IAM)
The Google Cloud resource hierarchy is the lineage from organization through folders to projects that provides centralized management with delegated control. Resource Manager (opens in a new tab) manages how resources are grouped and where policies are inherited from. Folders provide delegated administration for groups of projects, while projects provide strong isolation for workloads, environments, and billing.
The organization is the root node that represents the company owning all cloud resources. All resources that belong to an organization are grouped under the organization resource (opens in a new tab), which provides central visibility and control over every folder, project, and service resource. With an organization, projects belong to the organization rather than to individual employees, so resources remain available when employees leave and rogue projects can be centrally viewed. Use a single organization whenever possible and focus the design on business needs, responsibility, compliance, and future mergers or spin-offs rather than copying the corporate chart.
Multiple organizations are considered only for specific situations:
Folders are optional grouping mechanisms that organize projects by department, team, environment, or region. A folder can contain projects, other folders, or both, but each folder or project has exactly one parent. Policies set on a folder cascade to all child folders and projects, so granting Folder Admin or Compute Instance Admin on a folder applies that role to all projects inside it. Folder display names must be unique within the same level, a parent can contain up to 300 direct child folders, and folders can be nested up to 10 levels deep.
A common enterprise pattern uses three top-level folders where the Network Team folder hosts virtual private clouds (VPCs), the Cluster Team folder hosts clusters per environment, and the Tenants folder hosts tenant resources with one subfolder per tenant. Each branch then uses subfolders for development, staging, and production so environment-specific organization policies apply only to that branch.
Projects are the base-level containers where every service resource belongs to exactly one project. Projects enable application programming interfaces (APIs), manage billing, and support collaboration, which makes the project the primary method for segregating production from staging and development, teams from each other, and billing responsibility. Moving a project into a different folder or organization changes which parent policies the project inherits from.
Dedicated projects limit blast radius for configuration, security, and capacity. Some IAM configuration is per-project, so placing different clusters in different projects ensures a misconfiguration in one project does not affect all clusters and allows progressive rollout. Workloads in different projects are far more segregated by default, so a compromised workload has limited impact elsewhere, and quotas enforced per-project prevent one autoscaled workload from exhausting an entire environment.
Inheritance in Google Cloud flows from parent to child, with allow policies additive downward and deny policies evaluated before allows. Organization policies are inherited but can be superseded by a lower-level policy for controlled exceptions, while hierarchical firewall policies inherit implicitly so traffic can be allowed or denied at any level. Shared controls depend on this scope: Cloud Logging aggregated sinks collect logs at folder or organization level, billing reports group project-level billing into folder views, and firewall baselines apply consistently through inheritance. Policy changes do not apply retroactively to resources that already exist.
| Pattern | Top-level grouping | Choose when |
|---|---|---|
| Environment-based | Development, testing, and production folders | Environments need different policies and production needs consistent central controls |
| Region or subsidiary-based | APAC, EMEA, Americas, or subsidiary folders | Regions operate independently with different processes or regulations |
| Accountability-based | Product folders such as ecommerce or logistics | Product owners own the full lifecycle independently |
Exam tip: Billing is assigned at the project level, not the folder level; use billing reports grouped by project hierarchy to see aggregated folder costs.
Continue with this study guide: Resource hierarchy (organizations, folders, and projects)
Data security 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 centralizes API keys, passwords, and certificates outside application code. Together with default encryption, they provide lifecycle control, least-privilege access, and audited runtime fetching.
Key lifecycle management in Cloud KMS organizes keys inside a key ring in a specific location and moves from project setup to creation to access grants to rotation and destruction. A key ring groups keys for the same location and application, and each key defines its purpose such as encryption and its protection level such as hsm. Traffic flows from the data service to Cloud KMS for encrypt and decrypt operations, so the data service stores only encrypted data. Using a dedicated project that holds only keys creates a trust boundary between key administrators and workload owners.
Creation follows a fixed dependency order:
Least privilege means granting the CryptoKey Encrypter/Decrypter role (roles/cloudkms.cryptoKeyEncrypterDecrypter) on the specific key, not broadly at the project level. Hardware protection uses Cloud Hardware Security Module (Cloud HSM) with FIPS 140-2 Level 3 modules managed by Google, where multi-tenant clusters serve many customers and single-tenant partitions serve one customer at additional cost.
Exam tip: Grant roles/cloudkms.cryptoKeyEncrypterDecrypter on the specific key for workloads such as GKE, rather than a broad project role.
Encryption strategy chooses who controls keys for stored data and which controls protect moving data. Default encryption at rest (opens in a new tab) encrypts all customer content without customer action, so stolen disks or chunks remain unreadable without keys and teams can focus protection on keys. Infrastructure encryption breaks data into chunks, encrypts each chunk at the storage level with its own data encryption key (DEK) using AES-256, then adds device-level encryption with a separate key. Envelope encryption wraps each DEK stored near the data with a key encryption key (KEK) stored centrally in Keystore.
| Option | Who manages keys | Difference |
|---|---|---|
| Google-managed keys | Google manages DEKs and KEKs | No configuration, no extra key cost; sufficient with no lifecycle requirement |
| 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, HSM generation, and external key storage; enforceable with organization policy |
| Customer-supplied encryption keys (CSEK) | Customer supplies keys per operation | Direct control but fewer services, lower availability, and no central lifecycle |
Encryption in transit protects authenticity, integrity, and privacy when data leaves Google-controlled boundaries. VM-to-VM traffic inside a VPC and between peered VPCs is encrypted inside Google's network, traffic from the internet terminates at the Google Front End (GFE) and then flows between services with ALTS, and hybrid paths need extra controls because Cloud Interconnect is not encrypted by default and requires MACsec while Cloud VPN requires IPsec.
Secret Manager stores application secrets as named secrets holding one or more versions of secret material. Teams remove sensitive values from source code, .env files, and container images and store them in Secret Manager instead. At runtime the application retrieves the decrypted value with client libraries, GKE Secret Store CSI drivers, or Cloud Run bindings, so the secret never lives permanently in code. When a value changes, the team adds a new version rather than rebuilding code.
Access follows least privilege with the Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) granted on individual secrets, and authentication uses Application Default Credentials or workload identity rather than exported service account keys. Replication choice controls availability, where automatic replication is the default unless location constraints require otherwise, while customer-managed keys wrap payloads and checksums verify integrity on write and read. Rotation is event-driven in an ordered workflow:
SECRET_ROTATE message to Pub/Sub.Continue with this study guide: Data security (key management, encryption, secret management)
Separation of duties uses hierarchy, perimeters, and role splits so no single identity controls both data and the keys or guardrails that protect it. Projects sit inside folders inside an organization, and boundaries are enforced with organization policies, IAM policies, and service perimeters. Security teams manage guardrails at organization and folder levels while developers manage resources inside assigned application projects.
Functional hierarchies separate workloads by purpose so each team receives only needed access. A common pattern places application projects inside a Prod folder and a dedicated key project inside a Shared folder, so developers can hold Project Owner inside an application project without privileges on the key project. The same separation places replicated raw data in one project for technical users and reporting views in another for business users.
VPC Service Controls creates a data-exfiltration boundary around projects and protected APIs. A single large boundary, called a common unified perimeter, provides the most effective protection with the lowest overhead because services inside communicate freely once IAM and network controls permit, leaving mainly north-south access from the internet to manage. Multiple perimeters isolate data with different trust or compliance needs but add east-west management overhead:
Key storage models define where Cloud KMS keys live relative to data, which determines how project boundaries enforce separation. Central security teams set organization and folder guardrails in both models, but ownership tradeoffs differ.
| Storage model | Where keys live | Choose when |
|---|---|---|
| Dedicated-project storage | All keys in a centralized key project in a Shared folder; application projects hold instances and buckets but no keys | Strict central control is required, such as PCI DSS or external HSM use |
| Same-project storage | Each key in the same project as the resources it protects | Developer velocity and delegated ownership matter most |
Role separation requires a strict distinction between key managers and key users. Key administration uses Cloud KMS Admin (roles/cloudkms.admin) for lifecycle and IAM policy, resource provisioning uses service roles such as BigQuery User or Compute Admin to select an existing key, and key usage uses CryptoKey Encrypter/Decrypter only for service agents. No human developer needs direct cryptographic use for CMEK integrations because the Google service agent encrypts and decrypts on behalf of the resource.
Exam tip: No principal should hold both Cloud KMS Admin and Cloud KMS CryptoKey Encrypter/Decrypter on the same key, including a Project Owner.
Administrative isolation splits powerful duties so no single identity controls too much. A Google Workspace super admin holds implicit full control over the linked Google Cloud organization, including modifying organization IAM policy and deleting the organization and its resources. Creating a separate Cloud Identity account does not isolate Cloud from Workspace because it creates duplicate users and a super admin can regain access through domain-wide delegation. The effective approach retains minimal super admins, uses granular Workspace admin roles for daily work, and audits privileged activity.
Elevation and monitoring verify that separation holds over time. Cloud Audit Logs records authentication, token generation, administrative changes, control-plane actions, and security events, with exports to BigQuery for analysis. Privileged Access Manager provides just-in-time elevation with up to two sequential approval levels, where users request time-bound group membership, approvers validate it, members impersonate a privileged service account, and all actions flow to audit logs before expiry. Breakglass accounts for super admin, organization administrator, pipeline, and operations use must alert on use and expire or be reviewed.
Continue with this study guide: Separation of duties
Defense-in-depth security controls combine governance, network isolation, context-based access, and audit trails. Organization Policy governs how resources can be configured, while Hierarchical Firewall Policy governs what network traffic is allowed. Together they set baselines once at the top that apply to everything below.
Organization Policy is a centralized control that limits what users can do with resources across the hierarchy. A constraint set at the organization becomes the baseline for all child folders and projects, so a risky configuration blocked at the top cannot be created below. Common baselines disable creation and upload of user-managed service account keys, block external IP addresses on Compute Engine, block legacy authorization on GKE, enforce location and Confidential VM placement, and require storage logging. When key creation is disabled, requests are denied before key material exists, forcing short-lived credentials.
Hierarchical Firewall Policy is a centralized network control above individual VPC rules, so a project cannot open a port the baseline blocks. Traffic flows from the customer private network through the firewall and intrusion detection and prevention before reaching resources inside the perimeter. The baseline starts with default deny, uses custom VPC networks instead of default networks, blocks overly permissive rules allowing all IP addresses, and blocks generic access to sensitive ports for SSH, RDP, Telnet, FTP, SMTP, DNS, HTTP, LDAP, databases, and caching. Security Command Center monitors drift, reporting deleted or drifted organization constraints separately from open-port firewall findings.
Exam tip: Organization Policy controls what resources can be configured, while Hierarchical Firewall Policy controls what traffic can reach them.
Network perimeter security with VPC Service Controls (opens in a new tab) creates a data-transfer boundary around Google Cloud APIs to prevent exfiltration. A service perimeter is managed at the organization level and enforced at the project level. Resources inside the same perimeter communicate freely when IAM and network permissions allow, while cross-boundary API calls are blocked by default. This protection is independent of IAM and does not replace least privilege.
| Design | Protection and overhead | Choose when |
|---|---|---|
| Common unified perimeter | Strongest protection, lower overhead focused on outside-to-inside access | Default choice to keep design simple |
| Multiple perimeters | Granular isolation, higher overhead for traffic between perimeters | Data must separate by trust, regulation, or tenancy |
Perimeter contents must include all sensitive projects with all supported protected services enabled, since an unprotected API creates an exfiltration vector. Networks must not bypass the perimeter with a route to the private VIP at private.googleapis.com; instead VPC networks use Private Google Access to the restricted VIP 199.36.153.4/30 (restricted.googleapis.com) with firewall rules denying general egress and allowing only TCP 443 to that range. Ingress policies specify which outside identities can access inside resources, while egress policies specify which inside identities can access outside services. Communication between perimeters requires coordinated rules on both sides: the source must allow the egress and the destination must allow the ingress.
Context-aware access and audit logging combine zero-trust enforcement with visibility into who did what. Chrome Enterprise Premium access levels enforce user-centric conditions checked on every API request, such as IP, location, and certificate-based mutual TLS, so requests with compromised credentials that fail conditions are rejected. VPC Service Controls is resource-centric and defines perimeters where resources can communicate for all user and service account identities, while Chrome Enterprise Premium covers only organization user identities.
Identity-Aware Proxy (IAP) integration with Cloud Service Mesh defends against token replay by exchanging long-lived external tokens for short-lived internal tokens. The ordered flow runs from outside caller to mesh service:
RequestContextToken with limited scope.Cloud Audit Logs provides the central trail alongside mesh audit logging, policy constraint logging, Anthos Config Sync monitoring, access logs, service metrics, and Cloud Trace. Continuous monitoring verifies enforcement and detects compromised credentials, misconfiguration, and drift.
Customer-managed encryption keys (CMEKs) give customers control over the key encryption keys that wrap data encryption keys for Google Cloud services. Cloud Key Management Service (Cloud KMS) (opens in a new tab) is integrated with IAM and Cloud Audit Logging, so permissions can be assigned on individual keys and key use can be monitored. Key administrators manage rotation, disabling, destruction, and access policy, while services receive only encrypt and decrypt ability.
Envelope encryption in Cloud KMS protects data by having the service create a data encryption key (DEK) and having Cloud KMS wrap that DEK with a customer-managed key encryption key (KEK). Traffic flows from the Google Cloud service to Cloud KMS for wrap and unwrap operations, then the service uses the unwrapped DEK to protect data at rest. A person requesting data does not need direct access to the CMEK because access flows through the service account holding permission on the key.
Enabling integration follows an ordered workflow:
roles/cloudkms.cryptoKeyEncrypterDecrypter) to the service account.Separation of duties places keys in a separate project containing no other resources, while protected resources live in data projects. Key administrators grant narrow use outward to service accounts and retain exclusive lifecycle control. Cloud KMS Autokey generates rings, keys, and service-agent grants on demand but preserves the same boundary because keys remain centrally managed.
Exam tip: Grant roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account at the single-key level when possible; removing the grant or disabling the key blocks data access without changing access to the data resource.
A CMEK integration is a supported path for a service to call Cloud KMS to wrap and unwrap DEKs for stored data. Google encrypts data at rest by default with FIPS 140 validated AES-256, but CMEK lets customers control KEKs, with Cloud External Key Manager (Cloud EKM) (opens in a new tab) keeping key material outside Google Cloud when needed. Some services allow CMEK only at creation time, while others allow it on existing resources.
| Service | Data protected with CMEK | External keys |
|---|---|---|
| Cloud Storage | Data in storage buckets | Supported |
| BigQuery | Data in tables and datasets | Supported |
| Compute Engine | Persistent disks, snapshots, custom images, and machine images | Supported for listed types |
All three support software keys and Cloud HSM hardware keys, where encryption with hardware or external keys consumes cryptographic-request quotas. If an external key becomes unavailable, dependent resources such as encrypted disks cannot be used until access is restored. Governance combines organization policies that require CMEK, restrict allowed keys, protection levels, locations, and destruction with key-usage tracking that shows which resources depend on each key.
Key lifecycle management separates the named CMEK object holding schedule and policy from key versions holding cryptographic material. A key can have unlimited versions, where each rotation creates a new primary version for future encryption while older versions remain available to decrypt existing data. All CMEK keys use symmetric ENCRYPT_DECRYPT purpose with GOOGLE_SYMMETRIC_ENCRYPTION, and Google-generated material is preferred because it never exposes raw material and rotates automatically. The recommended practice enables automatic rotation at least once per year, more often for sensitive workloads, while imported bring-your-own-key material needs outside automation.
A key version moves through administrative states in order:
Rotation creates a new version for new encryption and does not automatically re-encrypt existing data. Spanner re-encrypts DEKs on rotation, Cloud Storage applies the new version only to newly written objects, and BigQuery keeps existing tables on their original version by default. The lifecycle plan must therefore retain older enabled versions and track dependencies until data is re-encrypted, recreated, or deleted.
Secure remote access replaces direct internet exposure and static keys with identity-centric perimeters and federated trust. Identity-Aware Proxy (IAP) forwards traffic only after identity and context checks, while Workload Identity Federation exchanges external credentials for short-lived Google tokens. Together they minimize the attack surface of downloadable credentials.
Service account impersonation (opens in a new tab) lets a user or external workload temporarily act as a service account to get short-lived tokens. The workload authenticates with its own identity, exchanges it through federation, and receives only the permissions granted to the impersonated account. Static keys are long-lived, hard to store and rotate, and remain valid until revoked, so the organization constraint constraints/iam.disableServiceAccountKeyCreation blocks new keys and forces federation through the Security Token Service (STS).
The ordered exchange runs from external provider to Google Cloud:
Least privilege limits both who can impersonate and what the account can do by granting roles/iam.workloadIdentityUser only to specific subjects or filtered principalSet:// identifiers, using a dedicated account in the same project as the resources. Attribute mappings must use immutable, non-reusable values such as unique user ID, require the pool provider URL as audience to prevent replay, and enforce conditions so multi-tenant platforms authenticate only from authorized organizations. Cloud Audit Logs records the impersonating principal in serviceAccountDelegationInfo when data-access logs are enabled for STS and IAM APIs.
Exam tip: Grant roles/iam.workloadIdentityUser to a specific federated principal or filtered principal set, never to all members of a workload identity pool.
Identity-Aware Proxy is a reverse proxy between the client device and the backend VM or web app. The backend needs no external IP because clients connect to IAP and IAP connects to the backend on their behalf. Access requires the IAP-Secured Web App User role (roles/iap.httpsResourceAccessor) plus authentication, IAM authorization, optional context-aware checks, and auditing of each connection. Removing direct port 22 exposure replaces network trust with identity and context checks.
Chrome Enterprise Premium access levels are user-centric controls defined in Access Context Manager and evaluated on every API request, including IP, location, and mutual TLS certificates. Endpoint Verification supplies device posture signals from a Chrome extension, so managed devices can be distinguished from unmanaged devices. Attachments enforce the rules in two ways:
| Option | Scope | Choose when |
|---|---|---|
| Access bindings | Identity-based policy across all resources a user accesses | Uniform enforcement is needed |
| IAM conditions | Resource-based policy on an individual role binding | Different VMs or apps need different policies |
Context-aware TCP-forwarding fits VMs reachable from outside the VPC that should allow SSH only from certain devices or locations. The VM is deployed without an external IP or with firewall rules denying public port 22, so the only SSH path flows from the client through IAP to the VM.
Workload Identity Federation is a keyless method where an external workload presents its native credential to STS and receives short-lived Google credentials to impersonate a service account. A workload identity pool represents trust in an external identity provider, while a provider defines how a specific issuer connects to that pool. Attribute mappings translate external claims such as AWS role or Azure subscription into federated principals. Setup enables iam.googleapis.com, sts.googleapis.com, and iamcredentials.googleapis.com, defines mappings and conditions, creates the pool and provider, grants roles to federated principals, generates a credential configuration referenced by GOOGLE_APPLICATION_CREDENTIALS, and deploys it so libraries exchange tokens automatically via file-sourced, URL-sourced, or executable-sourced subject tokens.
| 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 |
Securing the 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.
Secure builds with Cloud Build run from a build config file on a managed service instead of developer workstations, which is required for SLSA level 2 because it removes direct user influence. A build config defines ordered steps that fetch dependencies, run tests and analysis, and create artifacts with tools such as Docker, Gradle, Maven, Go, and Python. Source flows from GitHub and Bitbucket into Cloud Build, and artifacts flow onward into Artifact Registry and Cloud Deploy.
Build provenance is verifiable data linking inputs, build system, and outputs, including image digests, source locations, toolchain, and duration. Higher SLSA levels carry stronger proof:
| SLSA level | How provenance is provided | What it must contain |
|---|---|---|
| Level 1 | Available to consumers | Basic build details |
| Level 2 | Service-generated and signed for authenticity | Same as Level 1 with verifiable authenticity |
| Level 3 | Same verifiable model as Level 2 | Same as Level 2 plus entry point and all user-controlled parameters |
An ephemeral build environment provisions a fresh VM or container for one build and destroys it afterward, so no residual files carry over and attackers cannot persist malicious files between builds.
Exam tip: Cloud Build supports VPC Service Controls only for builds run in a private pool, not for default public pools.
Deployment policy enforcement with Binary Authorization is a deploy-time gate that permits only signed, verified images to run. The policy defines which images meet organizational criteria, and only conforming images deploy while others are blocked at the boundary between Artifact Registry and the runtime. The same policy object is managed through gCloud CLI, console, REST API, and the google_binary_authorization_policy Terraform resource.
An attestor is the resource that verifies an image meets a criterion such as passing vulnerability scanning, holding public keys whose private counterparts signed attestations during trusted build or review. Verification succeeds only when the attestation signature validates with a trusted public key in the attestor. Cross-organization verification trusts third-party signatures by obtaining their public keys, creating attestors in the local project, and adding those keys so local policy enforces shared standards with external trust anchors.
Artifact Registry is a universal package manager that centralizes container images and language packages in private repositories. Requests for external packages flow to Artifact Registry first, which fetches from the external source only when needed, keeping the private repository as the trust boundary. Remote repositories cache Docker Hub, Maven Central, PyPI, Debian, or CentOS artifacts to improve availability, while virtual repositories consolidate same-format repositories and prioritize private packages to reduce dependency confusion.
Artifact Analysis detects vulnerabilities in stored artifacts, scans new images on upload, extracts system-package details, generates SBOM and VEX statements, and continuously updates metadata when new threat information appears without re-upload. Integrity controls remove stale images with cleanup policies, favor internal upstreams, enforce immutable tags or deploy by digest sha256:..., and integrate scan metadata with Binary Authorization to block images failing thresholds. The ordered monitoring lifecycle runs from initial scan to continuous monitoring to metadata update.
Continue with this study guide: Securing software supply chain
Secure AI architecture keeps training data, model artifacts, and prediction requests inside controlled boundaries with content screening and customer-controlled encryption. Model Armor screens prompts and responses for model attacks, Sensitive Data Protection discovers and transforms sensitive data, and perimeters with identity checks confine deployment. Data flows from upload to encrypted storage to inspection and de-identification, and only designated principals satisfying identity and context rules can read it.
Model Armor is a service that screens large language model (LLM) prompts before they reach the model and responses before they reach the user. User prompts flow from the application to Model Armor for inspection, then to the model, and responses flow back through Model Armor to the user. This placement blocks malicious input, verifies safety, protects sensitive data, and applies consistent policy whether the model runs on Google Cloud or externally. Protection attaches to the model endpoint or floor setting defining minimum filters for all calls in a project.
| Filter | What it screens | Policy control |
|---|---|---|
| Injection and jailbreak filter | Prompts overriding instructions or bypassing safety | Threshold such as HIGH blocks suspected injection |
| Harmful content filter | Obscenity, extremism, violence, explicit, dangerous, harassment, hate speech | Threshold such as MEDIUM controls aggressiveness |
| Sensitive data filter | PII in prompts and responses | Sensitive Data Protection DeidentifyTemplate redacts or masks matches |
Secure agent design assumes inputs are hostile and limits tool misuse with action-selector and dual-LLM patterns, allowlisted tools, and blocked dynamic registration. A general execute_sql tool is unsafe in multi-tenant databases, so custom tools built with MCP Toolbox for Databases set user identity outside agent control. Monitoring watches query-pattern anomalies, volume spikes from one IP or user, and geographic anomalies, with Apigee rate limiting and Cloud Logging alerts routing caller, endpoint, and history to responders.
Exam tip: Do not enable the prompt injection and jailbreak filter for MCP traffic unless that traffic carries natural language data.
Data privacy with Sensitive Data Protection finds, classifies, and transforms sensitive data so models learn without exposing real identities. Data minimization avoids collecting unneeded PII, uses synthetic or anonymized data where possible, and limits retention with Cloud Storage lifecycle controls. Automated discovery scans BigQuery tables and text, classifies financial and other PII, and sends results to Knowledge Catalog for lineage, quality, profiles, and glossary governance.
Protective transformations preserve utility while lowering re-identification risk:
Governance places sensitive data in its own VPC Service Controls perimeter, depends on IAM with multifactor authentication (MFA), and tracks lineage from collection through transformation to model use for compliance.
Secure deployment layers network isolation, identity control, encryption, and audit visibility. VPC Service Controls creates a perimeter around BigQuery and Cloud Storage that blocks movement by default and overrides permissive IAM, so a misconfigured bucket does not become public. Access from outside requires an Access Context Manager access level naming allowed principals, devices, or networks. IAM proves who the caller is, while Access Context Manager proves whether context may cross the boundary; a caller must satisfy both on every request touching inside data.
Encryption with customer-managed encryption keys (CMEKs) uses envelope encryption where the service encrypts with a DEK and wraps it with a KEK from Cloud KMS, with Autokey automation and Cloud HSM or Cloud EKM options for key location. Classification and audit visibility come from Sensitive Data Protection inspection plus Cloud Audit Logs, Monitoring, Access Transparency, and Access Approval for support access. The fixed deployment order runs from IAM-permitted upload to CMEK encryption to inspection and de-identification to perimeter enforcement with access levels to denial of all other access, even when IAM would otherwise permit it.
Organization Policy governs how resources can be configured and Hierarchical Firewall Policy governs what network traffic is allowed. A constraint set at the organization becomes the baseline for all child folders and projects so a risky configuration blocked at the top cannot be created below, while a centralized firewall baseline above individual VPC rules means a project cannot open a port the baseline blocks.
Use a folder-level grant when the same access applies to every project in a team or environment, and use a project-level grant when access must be limited to one workload. Setting a policy on a folder grants access for every project and service resource under that folder without repeating the grant on each child, while a narrow grant on one project affects only that project.
Envelope encryption protects data by having the service create a data encryption key and having Cloud Key Management Service wrap that data encryption key with a customer-managed key encryption key. The service stores only encrypted data and uses the unwrapped data encryption key to protect data at rest, with traffic flowing from the service to Cloud Key Management Service for wrap and unwrap operations. A person requesting data does not need direct access to the key because access flows through the service account holding permission on the key.
A common unified perimeter provides the strongest protection with the lowest overhead because services inside communicate freely once Identity and Access Management and network controls permit, leaving mainly outside-to-inside access to manage. Multiple perimeters provide granular isolation for data with different trust, regulation, or tenancy needs but add management overhead for traffic between perimeters, so the common unified perimeter is the default choice to keep design simple.
Last updated