nerdexam
Google

PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #159

Your application artifacts are being built and deployed via a CI/CD pipeline. You want the CI/CD pipeline to securely access application secrets. You also want to more easily rotate secrets in case…

The correct answer is C. Store secrets in Cloud Storage encrypted with a key from Cloud KMS. Provide the CI/CD pipeline. To securely manage application secrets for a CI/CD pipeline, storing them in Cloud Storage encrypted with Cloud KMS and granting the pipeline service account access is the recommended approach for both security and easy rotation.

Submitted by ashley.k· Apr 18, 2026Building and implementing CI/CD pipelines for a service

Question

Your application artifacts are being built and deployed via a CI/CD pipeline. You want the CI/CD pipeline to securely access application secrets. You also want to more easily rotate secrets in case of a security breach. What should you do?

Options

  • APrompt developers for secrets at build time. Instruct developers to not store secrets at rest.
  • BStore secrets in a separate configuration file on Git. Provide select developers with access to the
  • CStore secrets in Cloud Storage encrypted with a key from Cloud KMS. Provide the CI/CD pipeline
  • DEncrypt the secrets and store them in the source code repository. Store a decryption key in a

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    14% (4)
  • C
    75% (21)
  • D
    7% (2)

Why each option

To securely manage application secrets for a CI/CD pipeline, storing them in Cloud Storage encrypted with Cloud KMS and granting the pipeline service account access is the recommended approach for both security and easy rotation.

APrompt developers for secrets at build time. Instruct developers to not store secrets at rest.

Prompting developers for secrets at build time is manual, prone to human error, does not scale, and does not address the need for easy rotation or automated access for the CI/CD pipeline.

BStore secrets in a separate configuration file on Git. Provide select developers with access to the

Storing secrets in plain text or even encrypted in a configuration file within Git is a significant security risk, as the repository history retains the secrets and access control is less granular than dedicated secret management solutions.

CStore secrets in Cloud Storage encrypted with a key from Cloud KMS. Provide the CI/CD pipelineCorrect

Storing secrets in Cloud Storage, encrypted by a key managed in Cloud Key Management Service (KMS), provides a secure and centralized location for secrets. Granting the CI/CD pipeline's service account appropriate IAM roles allows it to securely retrieve and decrypt secrets at runtime without exposing them directly in source code, and KMS facilitates easy key rotation.

DEncrypt the secrets and store them in the source code repository. Store a decryption key in a

Encrypting secrets in the source code repository and storing a decryption key separately is complex to manage, and the encrypted secrets are still part of the repository history, which is not ideal for robust secret management and rotation compared to a dedicated secret management solution like KMS.

Concept tested: Secure secret management in CI/CD pipelines

Source: https://cloud.google.com/architecture/security-best-practices-ci-cd#secrets

Topics

#CI/CD#Secrets Management#Cloud KMS#Security Best Practices

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVOPS-ENGINEER Practice