Professional Cloud Security Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Last updated
An enterprise uses an external continuous deployment (CD) pipeline to deploy build artifacts into a specific Google Cloud Storage bucket (bucket-prod-artifacts). The designated service account (deployer-sa@project-id.iam.gserviceaccount.com) has the Storage Object Admin role at the project level.
To adhere to least-privilege security principles, the security engineer must implement a solution that fulfills the following requirements:
deployer-sa.bucket-prod-artifacts, preventing access to any other buckets.Which strategy should the security engineer implement?
Grant the external principal identifier the Service Account User role (roles/iam.serviceAccountUser) at the project level, and apply an IAM Condition on the project binding targeting bucket-prod-artifacts.
Grant the external principal identifier the Workload Identity User role (roles/iam.workloadIdentityUser) on deployer-sa, and generate a downscoped access token by applying a Credential Access Boundary definition that limits access to bucket-prod-artifacts.
Grant the external principal identifier the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) directly on the Cloud Storage bucket, and configure an IAM Deny Policy on the project.
Download an encrypted service account private key file, store it in the external pipeline secrets store, and enforce token restriction using an Organization Policy constraint.
Grant the external principal identifier the Service Account User role (roles/iam.serviceAccountUser) at the project level, and apply an IAM Condition on the project binding targeting bucket-prod-artifacts.
Grant the external principal identifier the Workload Identity User role (roles/iam.workloadIdentityUser) on deployer-sa, and generate a downscoped access token by applying a Credential Access Boundary definition that limits access to bucket-prod-artifacts.
This solution combines Workload Identity Federation with Service Account Impersonation and Token Downscoping using Credential Access Boundaries to enforce strict least-privilege access for external workloads.
roles/iam.workloadIdentityUser directly on deployer-sa to a specific principal identifier (principal://iam.googleapis.com/.../subject/PIPELINE_ID) ensures that only the authorized external CI/CD workflow can impersonate the service account.deployer-sa has broad project-level permissions, the downscoped token is mathematically and logically restricted to interact only with bucket-prod-artifacts and execute only the specified storage actions.Using roles/iam.workloadIdentityUser on the service account combined with token downscoping represents the architectural best practice for external CI/CD systems interacting with sensitive cloud resources. It decouples high-level service account grants from runtime execution privileges.
Grant the external principal identifier the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) directly on the Cloud Storage bucket, and configure an IAM Deny Policy on the project.
Download an encrypted service account private key file, store it in the external pipeline secrets store, and enforce token restriction using an Organization Policy constraint.