PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 18 of 25
[Building and implementing CI/CD pipelines for a service] You use Cloud Build to build and deploy your application. You want to securely incorporate database credentials and other application secrets into the build pipeline. You also want to minimize the development effort. What should you do?
Full set: 205 questionsThe most secure and integrated method for handling secrets in Cloud Build is to use Cloud Key Management Service (Cloud KMS). You encrypt the secret value with a Cloud KMS key, store the encrypted value (ciphertext) in your build configuration or source repository, and grant the Cloud Build service account the cloudkms.cryptoKeyDecrypter IAM role. Cloud Build has native support to automatically decrypt these values at build time, requiring minimal development effort and following security best practices.
A. Storing secrets in Cloud Storage, even with encryption at rest, is less secure as any principal with read access to the object can retrieve the plaintext secret.
B. Storing decryption keys in a repository is an anti-pattern. It complicates key management and rotation and exposes the key in source control.
C. Storing a decryption key in the same bucket as the encrypted data completely undermines the security of the encryption.
1. Google Cloud Documentation, "Using encrypted secrets". "Cloud Build can integrate with Cloud Key Management Service (Cloud KMS) to encrypt and decrypt sensitive data... To use this feature, you must grant the Cloud Build service account the Cloud KMS CryptoKey Decrypter IAM role."
2. Google Cloud Documentation, "Secrets". In the context of Cloud Build, it explicitly details the process: "Encrypt the sensitive data using Cloud KMS... Add the encrypted data to your build config... Configure your build to decrypt the data when the build runs."
Keep practicing
Take the free PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice questions
- Question 1[Building and implementing CI/CD pipelines for a service] You need to enforce several con…
- Question 2You deployed an application into a large Standard Google Kubernetes Engine (GKE) cluster.…
- Question 3You are responding to a high-priority incident where a critical, user-facing payment serv…
- Question 4[Applying Site Reliability Engineering (SRE) principles to a service] You support a user-…
- Question 5You are deploying an application that needs to access sensitive information. You need to …
- Question 6[Building and implementing CI/CD pipelines for a service] You are building an application…
