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 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?
The iam.allowedPolicyMemberDomains constraint restricts IAM policy bindings to identities belonging to specified Cloud Identity or Google Workspace customer IDs. Using Cloud KMS asymmetric keys allows external applications to request cryptographic signing or decryption operations via API.
iam.allowedPolicyMemberDomains restricts which directory domains can receive IAM roles; it does not disable user-managed service account key creation (iam.disableServiceAccountKeyCreation) or public key uploads (iam.disableServiceAccountKeyUpload).The organization required restricting IAM policy assignments strictly to corporate Google Workspace/Cloud Identity domains and managing customer-managed cryptographic signing keys.
The iam.automaticGrantsForDefaultServiceAccounts organization policy constraint stops Google Cloud from automatically granting the broad Editor (roles/editor) primitive role to default service accounts when new APIs are enabled. The Service Account User role (roles/iam.serviceAccountUser) allows a principal to attach a service account to a compute resource (such as a VM or Cloud Run service).
iam.automaticGrantsForDefaultServiceAccounts does not block users from generating user-managed private key files or uploading public keys via the Cloud Console or IAM API.roles/iam.serviceAccountUser does not give an external workload the ability to exchange external identity tokens or generate short-lived OAuth access tokens; that operation specifically requires roles/iam.serviceAccountTokenCreator.iam.automaticGrantsForDefaultServiceAccounts addresses default role assignment over-privileging, not key lifecycle guardrails.roles/iam.serviceAccountUser is used for attaching identities to compute resources inside Google Cloud (actAs permission), not for creating short-lived tokens.The primary goal was preventing Google-managed default compute and App Engine service accounts from automatically receiving the Editor role upon project creation.
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.
The iam.serviceAccountKeyExposureResponse constraint defines automated remediation actions (such as disabling or notifying) when Google Cloud detects that a user-managed service account private key has been publicly leaked or exposed.
iam.serviceAccountKeyExposureResponse is a reactive control that handles credentials after they have already been created and compromised; it does not proactively prevent key creation or uploads.roles/pubsub.publisher grants permissions to publish messages to Pub/Sub topics but does not establish Workload Identity Federation or allow the external workload to acquire short-lived tokens.iam.disableServiceAccountKeyCreation or iam.disableServiceAccountKeyUpload.The goal was to configure automated disabling of credentials whenever a service account key was accidentally uploaded to a public repository.
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