A fintech firm is reviewing its release engineering workflow for managing Google Cloud infrastructure using automated Cloud Build pipelines. During a software development lifecycle (SDLC) audit, the enterprise architect identifies two major vulnerabilities in the CI/CD architecture: concurrent build executions fail due to local state lock conflicts on ephemeral worker nodes, and the Cloud Build service account has been granted the administrative `roles/iam.serviceAccountAdmin` role to attach runtime service accounts to Compute Engine instance groups. Which combination of architectural modifications should the cloud architect implement to resolve these operational and security issues?
- Migrate the state backend to a Cloud Storage bucket with object versioning and state locking enabled, and replace `roles/iam.serviceAccountAdmin` with `roles/iam.serviceAccountUser` on the target deployment service accounts.Answer
- BStore state files on an attached persistent disk shared across build triggers, and upgrade the Cloud Build service account privileges to `roles/owner` to avoid role-binding restrictions.
- CRetain `roles/iam.serviceAccountAdmin` on the Cloud Build service account to ensure uninterrupted deployment rights, while storing state files in unversioned Cloud Storage buckets.
- DDeploy VPC Service Controls around the Cloud Build network perimeter to prevent state data exfiltration, while maintaining local disk state storage and existing administrative IAM roles.
Answer
Migrate the state backend to a Cloud Storage bucket with object versioning and state locking enabled, and replace `roles/iam.serviceAccountAdmin` with `roles/iam.serviceAccountUser` on the target deployment service accounts.
The solution addresses both pipeline concurrency and security compliance. A Cloud Storage remote backend with locking ensures safe concurrent state mutations, while switching from Service Account Admin to Service Account User grants the minimum permission necessary to attach deployment identities to Compute Engine instances.
Step-by-Step Solution
Key Concept
CI/CD Pipeline Security and Remote State Governance