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 security team wants to harden their Google Cloud environment by eliminating long-lived, user-managed service account keys. The team must enforce guardrails across the entire resource hierarchy to prevent developers from creating new service account keys or uploading external public keys. In addition, an external application running outside Google Cloud must be able to securely authenticate and access Google Cloud resources using short-lived credentials rather than static key files.
Which set of actions should the security team implement?
Configure the iam.serviceAccountKeyExposureResponse organization policy constraint at the organization root, and grant the Pub/Sub Publisher role (roles/pubsub.publisher) to the external service account.
Enforce the iam.automaticGrantsForDefaultServiceAccounts organization policy constraint at the organization root, and grant the Service Account User role (roles/iam.serviceAccountUser) to the external workload.
Enforce the iam.disableServiceAccountKeyCreation and iam.disableServiceAccountKeyUpload organization policy constraints at the organization root, and configure Workload Identity Federation with the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to generate short-lived credentials for the external workload.
Enforce the iam.allowedPolicyMemberDomains organization policy constraint at the project level, and configure Cloud Key Management Service (Cloud KMS) to generate asymmetric keypairs for external client signing.
Configure the iam.serviceAccountKeyExposureResponse organization policy constraint at the organization root, and grant the Pub/Sub Publisher role (roles/pubsub.publisher) to the external service account.
Enforce the iam.automaticGrantsForDefaultServiceAccounts organization policy constraint at the organization root, and grant the Service Account User role (roles/iam.serviceAccountUser) to the external workload.
Enforce the iam.disableServiceAccountKeyCreation and iam.disableServiceAccountKeyUpload organization policy constraints at the organization root, and configure Workload Identity Federation with the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to generate short-lived credentials for the external workload.
This solution combines Google Cloud Organization Policy constraints with Workload Identity Federation and IAM service account impersonation to eliminate long-lived service account keys and transition external workloads to a keyless security architecture.
iam.disableServiceAccountKeyCreation constraint blocks the generation of downloadable service account private key pairs (.json or .p12). Enforcing iam.disableServiceAccountKeyUpload prevents principals from uploading their own external public keys to Google Cloud service accounts. Applying these at the organization root ensures hierarchical inheritance across all folders and projects.roles/iam.serviceAccountTokenCreator) on a target service account allows it to impersonate that service account and generate short-lived OAuth 2.0 access tokens directly.This approach directly targets the root risk of credential leakage by disabling user-managed key operations organization-wide while adopting Google Cloud's best-practice federated identity architecture for external workloads.
Enforce the iam.allowedPolicyMemberDomains organization policy constraint at the project level, and configure Cloud Key Management Service (Cloud KMS) to generate asymmetric keypairs for external client signing.