Question

Difficulty: MediumAnalyzing Software Development Lifecycle (SDLC) and CI/CD Pipelines

A healthcare technology company uses Cloud Build to automate infrastructure deployments for Cloud Run services. During an SDLC assessment, the architecture team discovers that the deployment pipeline relies on default service account privileges, state files are stored in ephemeral build environments without locking, and developers frequently execute manual CLI commands on production resources during operational incidents. Which strategy best resolves these SDLC and CI/CD security and operational process risks?

  1. Configure Cloud Build to run under a dedicated user-managed service account with fine-grained IAM roles, store state files in a versioned Cloud Storage bucket with object locking, and mandate all production changes through the automated pipeline.Answer
  2. B
    Assign the primitive Owner role to the default Cloud Build service account to ensure provisioning scripts execute without permission errors while storing state files in Cloud Storage.
  3. C
    Grant developers the Service Account Admin role on the Cloud Build service account so they can directly impersonate it and execute local infrastructure updates during operational incidents.
  4. D
    Permit manual production modifications via gcloud CLI for emergency hotfixes, provided developers manually re-run Terraform plan locally to reconcile configuration state afterwards.

Answer

Configure Cloud Build to run under a dedicated user-managed service account with fine-grained IAM roles, store state files in a versioned Cloud Storage bucket with object locking, and mandate all production changes through the automated pipeline.
The strategy requiring a dedicated user-managed service account with fine-grained IAM roles, centralized versioned GCS state backends with locking, and pipeline-only change management adheres to GCP security best practices for CI/CD automation and SDLC governance.

Step-by-Step Solution

1
Analyze pipeline security and service account identity configuration
Default service accounts carry excessive permissions or lack granular tracking; replacing them with dedicated user-managed service accounts bounded by specific predefined or custom IAM roles establishes least privilege.
Reduces blast radius and ensures auditability of actions taken by CI/CD build steps.
2
Evaluate Infrastructure as Code (IaC) state management strategy
Moving state files out of build containers into a Cloud Storage backend with object versioning and state locking ensures concurrency protection and state integrity.
Prevents state corruption when concurrent build steps execute or when build instances terminate.
3
Establish strict change control and prevent manual drift
Disallowing manual CLI updates and enforcing all modifications through version-controlled pipeline triggers maintains alignment between code and production state.
Eliminates configuration drift and enforces automated testing and approval controls.

Key Concept

CI/CD Pipeline Security and Infrastructure as Code State Management
Rate this question