Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Security Engineer practice bank has 1,343 more like it. Try 10 free: instant score, no account.
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?
roles/iam.serviceAccountTokenCreator) directly on the Cloud Storage bucket, and configure an IAM Deny Policy on the project.The Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) contains the iam.serviceAccounts.getAccessToken permission, allowing principals to mint short-lived OAuth 2.0 access tokens for a service account. An IAM Deny Policy explicitly blocks specific permissions for designated principals.
roles/iam.serviceAccountTokenCreator is an IAM role specific to service account resources and cannot be bound directly to a Cloud Storage bucket resource.roles/iam.workloadIdentityUser to exchange external IdP tokens for service account impersonation tokens.An internal Google Cloud principal (such as a user or another service account) needed direct permissions to generate short-lived tokens for deployer-sa by granting roles/iam.serviceAccountTokenCreator directly on the service account resource itself.
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.
roles/iam.serviceAccountUser) at the project level, and apply an IAM Condition on the project binding targeting bucket-prod-artifacts.The Service Account User role (roles/iam.serviceAccountUser) grants the iam.serviceAccounts.actAs permission, which is intended to allow principals to attach a service account to Google Cloud compute resources (such as Compute Engine VMs or Cloud Run services).
roles/iam.serviceAccountUser does not allow an external federated identity in a Workload Identity Pool to impersonate a service account. Workload Identity Federation requires roles/iam.workloadIdentityUser on the target service account resource.roles/iam.serviceAccountUser cannot restrict the permissions embedded within generated short-lived OAuth 2.0 access tokens or downscope bucket-level access.roles/iam.serviceAccountUser provides iam.serviceAccounts.actAs, not iam.serviceAccounts.getAccessToken or federated token exchange.The requirement was to allow a human developer or deployment pipeline to attach deployer-sa when provisioning a new Compute Engine instance in the project.
This option relies on creating and downloading a traditional long-lived service account private key JSON file, storing it in an external CI/CD secrets manager, and attempting to restrict its behavior using an Organization Policy.
The external environment lacked internet reachability to Google STS endpoints and had no support for OIDC/SAML federated identity tokens, necessitating manual key management.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated