PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 24 of 25

[Building and implementing CI/CD pipelines for a service] You are configuring your CI/CD pipeline natively on Google Cloud. You want builds in a pre-…

Full set: 205 questions
[Building and implementing CI/CD pipelines for a service] You are configuring your CI/CD pipeline natively on Google Cloud. You want builds in a pre- production Google Kubernetes Engine (GKE) environment to be automatically load-tested before being promoted to the production GKE environment. You need to ensure that only builds that have passed this test are deployed to production. You want to follow Google-recommended practices. How should you configure this pipeline with Binary Authorization?
Answer options
A: Create an attestation for the builds that pass the load test by requiring the lead quality assurance engineer to sign the attestation by using a key stored in Cloud Key Management Service (Cloud KMS).
B: Create an attestation for the builds that pass the load test by using a private key stored in Cloud Key Management Service (Cloud KMS) authenticated through Workload Identity. Correct answer
C: Create an attestation for the builds that pass the load test by using a private key stored in Cloud Key Management Service (Cloud KMS) with a service account JSON key stored as a Kubernetes Secret.
D: Create an attestation for the builds that pass the load test by requiring the lead quality assurance engineer to sign the attestation by using their personal private key.
Correct Answer:
B. Create an attestation for the builds that pass the load test by using a private key stored in Cloud Key Management Service (Cloud KMS) authenticated through Workload Identity.
Explanation

The Google-recommended practice for automated CI/CD pipelines is to use non-human, short-lived credentials. Workload Identity is the preferred method for GKE workloads to access Google Cloud services. It allows a Kubernetes service account to impersonate a Google service account without needing to manage and store static JSON keys. In this pipeline, the load-testing job (running in a pod) would use its configured Workload Identity to securely authenticate to Cloud KMS and use a key to automatically sign and create the attestation for the image after the test passes.

Why Incorrect

A. Requiring a manual signature from an engineer breaks the automation of a CI/CD pipeline and is not a recommended practice for this scenario.
C. Using a service account JSON key stored as a Kubernetes Secret works, but it is an older pattern. Workload Identity is the modern, more secure, and recommended best practice.
D. Using a personal private key is poor security practice. It ties a critical automated process to an individual's credentials, which is insecure and difficult to manage.

References

1. Google Cloud Documentation

Create attestations with Cloud Build: "In this tutorial

you create an attestor in Binary Authorization and a key pair in Cloud Key Management Service (KMS). You then set up a Cloud Build pipeline that builds a container image

signs it to create an attestation

and pushes the image..." (This process is automated using a service account).

2. Google Cloud Documentation

Use Workload Identity: "Workload Identity is the recommended way for your workloads running on Google Kubernetes Engine (GKE) to access Google Cloud services in a secure and manageable way. Workload Identity allows you to configure a Kubernetes service account to act as a Google service account."

3. Google Cloud Documentation

Binary Authorization overview: "Binary Authorization is a deploy-time security control that ensures only trusted container images are deployed on Google Kubernetes Engine (GKE)... you can require images to be signed by one or more trusted authorities (called 'attestors') before they can be deployed."

Scroll to Top