Prepare and test your skills
Prepare and test your skills
Vulnerability Integration and Emergency Workflows connect automated image scanning to deploy-time control while keeping an emergency path for urgent fixes. In this design, Artifact Analysis (opens in a new tab) scans container images and stores vulnerability results, Binary Authorization (opens in a new tab) enforces a policy that requires proof of that check before deployment, and emergency bypasses still leave an audit trail. The scan alone never blocks deployment, and enforcement happens only when the policy requires a matching attestation for Google Kubernetes Engine (GKE) (opens in a new tab), Cloud Run (opens in a new tab), or Google Distributed Cloud.
Artifact Analysis is the service that supplies the vulnerability information that Binary Authorization uses to control deployment. When an image is pushed to Artifact Registry, Artifact Analysis can automatically scan it for known vulnerabilities and store the results as trusted metadata. A developer or pipeline can also send an artifact to the On-Demand Scanning API from a local environment or from a CI/CD step such as a Cloud Build build step. That scan output flows from Artifact Analysis to a trusted signer that decides whether the image is clean enough to promote.
A typical vulnerability gate approves an image only when it meets deployment criteria defined by the organization, such as:
If the image meets the severity rule, a trusted authority creates a vulnerability attestation for that exact registry path and digest. If specific findings do not apply to the application, they can be added to an allowlist so the attestation can still be issued for an image with those findings.
Binary Authorization is the deploy-time enforcer that allows or blocks container deployment based on policy rules. The policy can require a vulnerability attestation that proves the image passed the severity check, and the enforcer verifies the attestation signature instead of rescanning the image. Pre-deployment checks can also block every image that is not on the exempt image list, so only images from trusted registries can even reach the attestation check.
Vulnerability enforcement follows the same promotion lifecycle that Binary Authorization protects:
Each stage can use its own environment, such as a separate GKE cluster or Google Cloud project, with its own Binary Authorization policy. An image moves from one stage to the next only after its required attestations, including the vulnerability attestation, verify successfully for that environment.
Exam tip: Automatic scanning in Artifact Analysis only produces findings; Binary Authorization blocks deployment only when the policy requires a vulnerability attestation and the image lacks a valid one.
Emergency Bypass and Auditability provide a controlled way to ship a critical fix without losing visibility into what was allowed. When an urgent fix must reach production before a scan or signature is complete, the deployment can proceed through an exemption path, such as an exempt image entry, rather than satisfying the normal attestation rule. The request still flows from the platform, such as GKE or Cloud Run, through the Binary Authorization enforcer, so the bypass is a policy decision and not an unmonitored side door.
Auditability is maintained because allowed and blocked decisions both produce logs throughout the workload lifecycle. When enforcement blocks an image, Binary Authorization writes the reason to Cloud Audit Logs, and when continuous validation is enabled, it regularly checks running Pods against the current policy and writes conformance results to Cloud Logging. This post-deploy monitoring matters because a policy can change after deployment, and continuous validation will then log Pods that violate the updated rule even though they were allowed at deploy time.
| Control | When it acts | What happens on violation |
|---|---|---|
| Binary Authorization enforcement | At deploy time, before the container starts on GKE, Cloud Run, or Google Distributed Cloud | Deployment is blocked and the reason is written to Cloud Audit Logs |
| Binary Authorization continuous validation | After deployment, throughout the Pod lifecycle | Workload keeps running but non-conformance is written to Cloud Logging |
Use enforcement when defective or vulnerable software must not start, and use continuous validation when already-running workloads must stay visible against evolving vulnerability policy.
Attestor Management and Cryptographic Verification ensure that only trusted container images deploy to production through signed proof of required checks. In this model, Binary Authorization (opens in a new tab) enforces the deployment policy, an attestor acts as the trusted verification authority, and an attestation acts as the signed statement that proves approval happened. Together they control whether an image moves through the CI/CD pipeline from development to testing to production.
An attestor is the party responsible for verifying that a required process completed before a container image can be deployed. The attestor can be a human user or, more often, a machine process such as a build system, test system, or continuous integration and continuous delivery (CI/CD) pipeline. In a multi-stage pipeline, different attestors can represent each gate, so an image cannot move from development to testing to production until all required attestors have approved it.
The attestor holds the public key used for verification and is typically managed by people responsible for software supply-chain security. A Binary Authorization policy lists which attestors must approve an image, and at deployment time the Binary Authorization enforcer checks that all required attestations are present and valid. If the image passes all constraints, the enforcer allows deployment to Google Kubernetes Engine (GKE) (opens in a new tab); otherwise deployment is blocked until the image becomes compliant.
An Artifact Analysis note is the trusted metadata record that backs an attestor in Binary Authorization. Creating an attestor requires linking the attestor to a note that stores attestation metadata used during authorization. The note is created through the Artifact Analysis global API endpoint, because Binary Authorization does not support regional storage or regional endpoints.
Setting up an attestor in a multi-project configuration separates duties across ownership boundaries:
| Project | What it stores and owns |
|---|---|
| Deployer project | Owns the GKE cluster where images run and the Binary Authorization Service Agent that evaluates policy |
| Attestor project | Centrally stores attestors, public keys, and Artifact Analysis notes, with write access limited to security personnel |
| Attestation project | Stores attestations that record statements about image readiness, with read access for involved roles and write access for attestation managers |
Creating a usable attestor requires completing related access grants so the deploy-time check can read verification data:
roles/binaryauthorization.attestorsVerifier role on the attestor.roles/containeranalysis.notes.occurrences.viewer role on the Artifact Analysis note.Without these bindings, the Binary Authorization enforcer cannot access the attestor or its associated attestations when it evaluates policy.
A Public-Key Infrastructure (X.509) (PKIX) key pair provides the cryptographic identity for an attestor in Binary Authorization. The pair consists of a private key kept secret by the signer and a public key stored in the attestor. The recommended algorithm is Elliptic Curve Digital Signature Algorithm (ECDSA), such as ec-sign-p256-sha256, and keys generated and stored by Cloud Key Management Service (KMS) are PKIX-compliant. RSA, PGP, and post-quantum cryptography keys can also be used for signing.
The private key signs the container image digest to produce a digital signature, and that signature is stored in an attestation. The public key remains with the attestor so the Binary Authorization enforcer can verify the signature at deploy time. This separation means compromise of the public key does not allow forgery, while protection of the private key in Cloud KMS ensures only verified signers can authorize images.
Exam tip: The private key signs the image digest to create the attestation, while the public key stored in the attestor verifies the attestation — reverse the two and deployment verification fails.
An attestation is a signed statement that a required pipeline check, such as vulnerability scanning or QA approval, is complete for a specific image digest. The signer creates the attestation after checks pass, and Artifact Analysis stores it as an occurrence linked to the attestor note. Because the attestation binds to the immutable image digest rather than a mutable tag, changing the image contents requires a new attestation.
The end-to-end flow moves data from the signer to the registry to the enforcer in order:
In an emergency, deployment can bypass policy through the breakglass workflow, and every breakglass use is recorded in Cloud Audit Logs. This preserves auditability while ensuring that normal deployments depend on cryptographic proof that all required attestors verified the image.
Policy Configuration and Enforcement Logic define how Binary Authorization (opens in a new tab) controls which container images can run on supported platforms. A project-singleton policy is the set of rules stored in a Google Cloud project that governs deployment, and a deploy-time enforcer allows or blocks each deployment based on that policy. This model lets teams define required checks once for Google Kubernetes Engine (GKE) (opens in a new tab), Cloud Run, and Google Distributed Cloud and have them enforced automatically.
The Binary Authorization policy model defines the deployment rules that an image must satisfy before it can run. A policy is a collection of rules, and each rule provides specific criteria such as requiring a verified attestation that proves a build, test, or approval step was completed. At deploy time the enforcer checks the image registry path and digest against the policy, allows the image when it conforms, and blocks it when it does not. Blocked deployments generate a message in Cloud Audit Logs that describes why the image is out of compliance.
Each deployment stage can have its own environment and criteria, such as development, QA, canary, and production clusters or projects. Binary Authorization defines the rules for moving an image from one stage to the next and enforces those rules without redoing the earlier work. Instead of rebuilding or retesting, the enforcer verifies a digitally signed attestation from a trusted authority.
The evaluationMode setting controls whether a cluster enforces the project-singleton policy for its workloads. The setting is configured in the cluster specification for Google Distributed Cloud, and the same concept applies to enabling enforcement on a supported platform. When enforcement is on, Pod creation requests are validated against the policy in the fleet host project; when it is off, no validation occurs.
| Evaluation mode | Behavior | Effect on deployments |
|---|---|---|
| PROJECT_SINGLETON_POLICY_ENFORCE | Enforce the rules in the project-singleton policy | Images that satisfy the policy are allowed, others are blocked |
| DISABLE | Disable Binary Authorization for the cluster | Images deploy without policy validation |
Exam tip: PROJECT_SINGLETON_POLICY_ENFORCE applies the project policy to the cluster, while omitting the binaryAuthorization section leaves the cluster with the default of disabled.
Enforcement Scope and Prerequisites combine a project-wide policy with per-cluster enablement and required setup. The project-singleton policy is associated with a Google Cloud project and specifies the rules, while each cluster opts in through its own evaluation mode. This allows one project policy to govern multiple clusters, with each cluster independently enabled for enforcement during creation or updated later to enable or disable it.
Before a cluster can enforce the policy, three dependencies must be satisfied. The cluster must be registered with a fleet through the fleet host project, the Binary Authorization API (binaryauthorization.googleapis.com) must be enabled in that project, and the Kubernetes service account binauthz-system/binauthz-agent must hold the Binary Authorization Policy Evaluator role (roles/binaryauthorization.policyEvaluator). The flow depends on all three sides working together:
If any prerequisite is missing, Pod creation can fail with a validation error that directs the operator to enable the API and grant the Policy Evaluator role.
Automatic scanning in Artifact Analysis only produces vulnerability findings and never blocks deployment by itself. Binary Authorization blocks deployment only when the policy requires a vulnerability attestation and the image lacks a valid one for Google Kubernetes Engine (GKE), Cloud Run, or Google Distributed Cloud.
Use Binary Authorization enforcement when defective or vulnerable software must not start, and use continuous validation when already-running workloads must stay visible against evolving vulnerability policy. Enforcement acts at deploy time before the container starts and blocks non-compliant deployments while writing the reason to Cloud Audit Logs, while continuous validation acts after deployment throughout the Pod lifecycle and lets the workload keep running but writes non-conformance to Cloud Logging.
Binary Authorization verifies approval by checking that required attestations are present and valid using the public key stored in the attestor. The private key signs the immutable image digest to create a digital signature stored in an attestation linked to an Artifact Analysis note, so changing the image contents requires a new attestation and verification fails without the matching signature.
Last updated