Prepare and test your skills
Prepare and test your skills
Automated CI/CD Pipeline Design is the practice of moving code from commit to production through automated build, test, storage, and promotion steps. On Google Cloud, Cloud Build (opens in a new tab) handles continuous integration work, Artifact Registry (opens in a new tab) stores and validates versioned artifacts, and Cloud Deploy (opens in a new tab) manages continuous delivery to each environment. Together they remove manual errors, provide standardized feedback loops, and enable fast, repeatable product iterations.
A process flow showing the automated CI/CD pipeline: a developer commit triggers Cloud Build to build, test, scan, approve, and sign a container image, which is stored in Artifact Registry and then deployed by Cloud Deploy to staging and, after a manual approval gate, to production on GKE.
Cloud Build is the continuous integration service that watches source repositories and automatically rebuilds, tests, and packages applications when code changes. A Cloud Build trigger monitors the main branch, and when a commit arrives the trigger starts the same sequence every time so builds stay consistent and auditable. Build artifacts flow from Cloud Build to a Cloud Storage bucket, container images flow from Cloud Build to Artifact Registry, and then Cloud Build calls Cloud Deploy to start staging deployment.
The enterprise continuous integration sequence runs in order:
This sequence depends on immutable container images, where the same image digest moves across environments and is never modified while running. Configuration is externalized and read at runtime, so promotion does not require rebuilding the image.
Artifact Registry is the managed registry that stores versioned container images and other deployment artifacts for promotion across environments. Each successful build produces a ready-to-deploy artifact that represents the workload with the latest changes, and labeling makes each execution repeatable. Release images use semantic versioning tags, while pre-release images use the Git commit hash that ties the image to the exact point in the codebase that produced it.
Artifact Registry also validates artifacts before they can be promoted:
Only verified artifacts move forward, so a vulnerable or untested image is blocked before it reaches a runtime environment. Base images are tightly controlled to avoid unsupported runtime variants, and test suites cover both the workload and the image itself.
Cloud Deploy is the continuous delivery service that deploys approved artifacts through a delivery pipeline with separate targets for each runtime environment. A delivery pipeline registers staging and production targets, which in the reference architecture are Google Kubernetes Engine (GKE) clusters, and Cloud Deploy creates a Cloud Storage bucket to store the Skaffold rendering source and rendered manifests. Skaffold shares a common configuration format across development, staging, and production, so the same manifests render consistently in every environment and parity increases across the lifecycle.
For each artifact, the automated deployment process executes the following tasks in order:
Promotion logic can differ by environment even though the artifact stays the same. New versions deploy automatically to development, quality assurance, and pre-production, while deployment to production requires manual review and approval by an operator. The pipeline reaches private GKE clusters through the Connect gateway and runs CI/CD operations in private pools, so build execution stays on a private network path.
Exam tip: Artifact Analysis scans images stored in Artifact Registry, while Binary Authorization enforces attestations at deployment time to GKE or Cloud Run.
Hardened CI/CD builds reduce the chance that a compromised dependency, credential, or build step can alter what gets deployed. Cloud Build runs each build from trusted builders, which are container images with languages and tools installed, and teams must decide whether to trust public, community, or Google-provided builders or to create custom builders for more control. Secrets flow from Secret Manager into the build rather than living as hardcoded values in version control or build configuration, and builds that run inside a VPC Service Controls perimeter can communicate freely with Google Cloud services inside the perimeter while cross-perimeter traffic is limited.
The following practices reduce opportunities to alter the build:
latest that can point to a different artifact in the future.Binary Authorization then enforces the approval process before production deployment by checking attestations attached to the image. At deploy time, Binary Authorization verifies that a specific build system created the image, that the image complies with vulnerability signing policy, and that the image passed the criteria for promotion from one environment to the next, such as from development to QA. Only trusted, signed code runs on the target platform, which protects the full application stack even if earlier steps are attacked.
Deployment Strategy Evaluation is the choice of how a new application version replaces the old version in production to limit disruption and control release risk. On Google Cloud, the decision centers on how traffic moves from the old version to the new version, how long two versions must coexist, and how quickly the team can detect problems and roll back. The right strategy lets the team gradually increase exposure to larger audiences, verify behavior along the way, and keep a clear rollback path if problems occur.
Deployment strategy controls release risk because every update briefly creates uncertainty about stability, performance, and compatibility. A good strategy limits the blast radius by exposing only part of the user base to the new version at first, while monitoring confirms that the new version behaves as expected. Continuous integration and comprehensive test automation give confidence before deployment, but the deployment strategy provides the final safety net during the actual release. That safety net depends on two capabilities working together: controlled traffic shifting between versions and clear provisions for rollback to a known good version.
Blue-green deployments keep two complete server sets, where the blue set runs the current version and the green set runs the new version. Traffic continues to flow to the old set while the new set is deployed and verified, and when deployment is completed, all traffic switches from the old set to the new set at once. This approach temporarily requires up to twice the number of servers needed for production, but it avoids service interruption because a ready environment is always serving traffic. A prerequisite is that two versions of an application can temporarily coexist without interfering with each other, and for applications that access databases, each iteration of database schema changes must remain backward compatible to at least the previous version.
Rolling deployments update one server after another instead of switching between two full environments. For a certain time two different versions of an application coexist, but unlike blue-green, traffic shifts from the old version to the new version gradually as more servers are updated. When the last server has been updated, all users use the new version. A key benefit of this gradual shift is that potential issues can be detected early, before all users are affected, which helps lower overall risk. Because two versions coexist and users could otherwise bounce between versions, this strategy often requires a load balancer configuration that keeps each user on a consistent version during the rollout.
Choosing between blue-green and rolling updates is a tradeoff between resource cost and gradual risk reduction, even though both require version coexistence. The table compares the two strategies on traffic movement and resource requirements.
| Strategy | Traffic shift | Resource and compatibility requirement |
|---|---|---|
| Blue-green | Traffic flows from the old server set to the new server set in one switch after verification | Temporarily requires up to twice the production servers; database schemas must stay backward compatible to at least the previous version |
| Rolling | Traffic flows gradually from old servers to new servers as each server is updated | Updates servers in place without a full duplicate fleet; requires load balancer behavior that avoids bouncing users between versions |
Choose blue-green when avoiding service interruption during the cutover outweighs the cost of running duplicate capacity for a short time. Choose rolling when the goal is to detect issues early with a smaller capacity footprint, while accepting a longer period when two versions serve traffic together.
Exam tip: Google Kubernetes Engine (GKE) natively supports rolling and recreate strategies, while blue-green on GKE requires additional tooling such as Spinnaker.
Google Kubernetes Engine (GKE) (opens in a new tab) is the managed Kubernetes environment that provides built-in orchestration for containerized deployments. GKE has built-in support for recreate and rolling deployment strategies, so a team can update workloads without building custom rollout logic. Although the deployment primitives are flexible enough to allow other strategies, using a different strategy requires additional tooling or scripting. Spinnaker (opens in a new tab) fills that gap because Spinnaker has built-in support for GKE and implements more advanced strategies, including blue-green deployments, but Spinnaker is not a managed service and must be deployed and maintained separately.
Cloud Deploy (opens in a new tab) is the fully managed Google Cloud service that automates delivery of applications to a series of target environments in a defined promotion sequence. Deployment gating in Cloud Deploy lets users approve or deny deployments at specific points, so promotion to a target only proceeds after the required approval. Gated deployments prevent unauthorized users from changing application environments and give greater visibility into who approved each promotion. This gating combines with automated pipelines to enforce that only verified artifacts move from development and testing toward production.
A typical end-to-end automated deployment pipeline moves code through ordered stages with testing and validation at each stage:
This pipeline structure lets teams automate development, quality assurance, and pre-production deployments while keeping a manual review gate before production, so speed and control remain balanced.
Shift-Left Security and Quality Integration means moving security and quality checks early into the software development lifecycle instead of checking only before release. On Google Cloud, automated continuous integration and continuous delivery pipelines carry code from source through build, scan, approval, and deployment with the same checks applied every time. This approach removes manual errors, gives developers fast feedback, and ensures only verified artifacts reach development, test, or production environments.
Automated CI/CD pipelines are the foundation for secure application releases on Google Cloud. A pipeline built with Cloud Build (opens in a new tab) for building and testing and Cloud Deploy for progressive delivery to target environments runs security checks automatically when artifacts are created. Automation improves the ability to detect and fix security bugs early, narrows the scope of manual security reviews, supports rollback to a known safe version, and applies different policies for development, test, and production so only verified artifacts are deployed.
The pipeline also connects to specialized checks, including Web Security Scanner for web application vulnerabilities, Artifact Analysis for container scanning, and Binary Authorization for deployment enforcement. To verify multiple requirements for source code, build process, and code provenance together, teams use the Supply-chain Levels for Software Artifacts (SLSA) framework. SLSA defines increasing levels of supply-chain maturity, and many of its source, build, and provenance requirements can be implemented directly as automated pipeline steps.
Artifact Analysis (opens in a new tab) is the Google Cloud service that automatically scans container images for known vulnerabilities before deployment. The scan starts when a new image is uploaded to Artifact Registry, which is the universal package manager for build artifacts and dependencies. Artifact Analysis extracts information about system packages in the container and records the findings as vulnerability metadata attached to the image.
Scanning does not stop after the first result because new vulnerabilities are discovered over time. After the initial scan, Artifact Analysis continuously monitors the metadata of scanned images in Artifact Registry, and when it receives new information from vulnerability sources, it keeps the results current:
Artifact Analysis supports on-demand and automated scanning for base container images and language packages in containers, and it can generate a software bill of materials (SBOM) and store Vulnerability Exploitability eXchange (VEX) statements for images in Artifact Registry. Complementary controls strengthen the supply around the scan, including Assured Open Source Software for Google-verified open source packages and Artifact Registry remote repositories that cache external sources such as Docker Hub, Maven Central, PyPI, Debian, or CentOS, plus virtual repositories that consolidate repositories behind one endpoint and prioritize private packages to reduce dependency confusion attacks.
Binary Authorization (opens in a new tab) is the Google Cloud deployment gate that ensures only trusted code runs on Google Kubernetes Engine (GKE) and Cloud Run. Binary Authorization attaches configurable signatures to container images, called attestations, that prove a required process was completed. At deployment time, traffic flows from the deployment request to the Binary Authorization policy check, and the policy allows the image to run only when the required attestations are present.
Attestations let teams validate code integrity and compliance before promotion to the next environment:
Because the check happens at deploy time, a compromised pipeline or an unreviewed image cannot bypass the approval process. If an attacker compromises the CI/CD pipeline, the missing or invalid attestation still blocks the workload from running on the target platform.
Exam tip: Artifact Analysis finds and tracks vulnerabilities in images, while Binary Authorization blocks deployment unless the required attestations prove the checks passed.
A chain of trust connects secure builds, provenance, and policy so every deployment can be traced to its source and build. Cloud Build runs builds on Google Cloud infrastructure with granular Identity and Access Management (IAM) permissions, VPC Service Controls, and isolated and ephemeral build environments. For supply-chain security, Cloud Build supports SLSA Level 3 builds for container images and generates authenticated and non-falsifiable build provenance, which is verifiable metadata that includes built image digests, input source locations, build toolchain, build steps, and build duration.
Security insights expose that chain in the Google Cloud console for sources, builds, artifacts, deployments, and runtimes. The insights include the SLSA build level, vulnerabilities in build artifacts, build provenance, and SBOM dependency lists, and Cloud Deploy surfaces those insights for applications delivered in sequence to GKE, GKE Enterprise, and Cloud Run with approvals, rollbacks, and audit. Together, the flow runs from version-controlled source to a Cloud Build process with provenance, to Artifact Registry storage with continuous Artifact Analysis scanning, to a Binary Authorization gate that permits deployment only when policy is satisfied.
The distinction between detection and enforcement controls the chain, as shown in the table.
| Control | Primary role | Acts when |
|---|---|---|
| Artifact Analysis | Detects known vulnerabilities and keeps image metadata current | When images are uploaded to Artifact Registry and continuously afterward |
| Binary Authorization | Enforces that only attested, trusted images can deploy | At deployment time to GKE or Cloud Run |
Artifact Analysis detects known vulnerabilities in container images when they are uploaded to Artifact Registry and continuously updates the vulnerability metadata afterward, while Binary Authorization enforces deployment policy at deploy time to Google Kubernetes Engine (GKE) or Cloud Run. Artifact Analysis extracts system package information and creates new vulnerability occurrences or deletes invalid ones as new information arrives, and Binary Authorization allows the image to run only when required attestations prove that a specific build system created it, that it complies with vulnerability signing policy, and that it meets promotion criteria.
Choose blue-green deployments when avoiding service interruption during the cutover outweighs the cost of running duplicate capacity for a short time, and choose rolling deployments when the goal is to detect issues early with a smaller capacity footprint. Blue-green deployments keep blue and green server sets and switch all traffic from the old set to the new set at once after verification but temporarily require up to twice the production servers, while rolling deployments update one server after another and shift traffic gradually as more servers are updated. Both require that two versions can temporarily coexist, with blue-green requiring database schemas to stay backward compatible to at least the previous version and rolling often requiring load balancer configuration that keeps each user on a consistent version during the rollout.
Cloud Build handles continuous integration by watching source repositories and automatically rebuilding, testing, and packaging applications when code changes, Artifact Registry stores and validates the resulting versioned container images, and Cloud Deploy manages continuous delivery through a delivery pipeline with separate targets for each runtime environment. In the reference flow, build artifacts flow from Cloud Build to a Cloud Storage bucket and container images flow to Artifact Registry, then Cloud Build calls Cloud Deploy to start staging deployment, and the same immutable image digest moves across environments with configuration and secrets injected at deploy time.
For each artifact Cloud Deploy deploys the artifact to the target runtime environment, injects configuration and secrets into the deployed artifact at deploy time, runs compliance tests against the newly deployed artifact, and promotes the artifact toward production only if prior steps and environment policies pass. New versions deploy automatically to development, quality assurance, and pre-production while deployment to production requires manual review and approval by an operator, and Skaffold shares a common configuration format so the same manifests render consistently in every environment.
An enterprise is modernizing its continuous integration and continuous delivery (CI/CD) pipeline on Google Cloud. The security team requires a shift-left approach to software delivery with the following constraints:
Which solution should you implement to meet these requirements?
Enable Artifact Registry automatic scanning for uploaded images, and configure Google Cloud Armor security policies at the ingress load balancer to block requests directed to vulnerable containers.
Enable Security Command Center posture monitoring across the environment, and establish Virtual Private Cloud (VPC) Service Controls perimeters to block GKE from pulling unauthorized images.
Use GKE Workload Identity to sign container images upon build completion, and implement Kubernetes Network Policies to isolate pods that run unverified images.
Incorporate the On-Demand Scanning API within Cloud Build to scan images post-build and block registry upload on policy failure, and configure Binary Authorization on GKE to enforce deployment attestations.
Last updated