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 runs long-running batch analytics jobs on Amazon Web Services (AWS) EC2 instances that process and load data directly into Google Cloud BigQuery and Cloud Storage. The security team identified that developers are currently using downloaded, long-lived service account JSON keys on AWS, violating corporate security policies.
The security engineer must replace these static keys with Workload Identity Federation using AWS instance profiles. The batch pipeline runs for 4 consecutive hours, requiring a single short-lived impersonated service account token with a 4-hour (14,400-second) lifetime.
Which set of actions should the security engineer take to implement this architecture?
gcloud auth application-default login --login-config to authenticate the automated AWS EC2 batch workload.Workforce Identity Federation enables an enterprise to manage user-to-Google-Cloud access by federating external workforce identity providers (such as Microsoft Entra ID, Okta, or Ping Identity) using SAML 2.0 or OIDC. It is designed for human users (employees, contractors, and partners) accessing Google Cloud Console or using the gcloud CLI.
gcloud auth application-default login use interactive browser-based authentication flows, making them unsuitable for headless, automated batch pipelines running on AWS EC2.Human data engineers working from corporate laptops needed single sign-on (SSO) browser-based access to the Google Cloud Console or gcloud CLI authenticated against a third-party corporate IdP.
--service-account-token-lifetime-seconds 14400, configure the AWS Workload Identity Pool, and apply the constraints/iam.disableServiceAccountKeyCreation organization policy to automatically extend the maximum token lifetime.constraints/iam.disableServiceAccountKeyCreation doesThe constraints/iam.disableServiceAccountKeyCreation organization policy constraint is a boolean security guardrail that prevents users and automated processes from creating new external, downloadable service account private keys (.json or .p12 files).
constraints/iam.disableServiceAccountKeyCreation restricts key creation; it has no operational effect on extending access token validity durations beyond the default 1-hour limit.constraints/iam.allowServiceAccountCredentialLifetimeExtension list constraint to allow the service account explicitly.roles/iam.workloadIdentityUser) to the external identity provider subject.constraints/iam.disableServiceAccountKeyCreation is an essential preventative best practice to enforce keyless architectures across an entire GCP Organization.iam.serviceAccountKeys.create API calls rather than modifying STS or IAM token minting properties.The objective was solely to enforce an organizational compliance rule preventing developers from generating downloadable private service account keys.
--service-account-token-lifetime-seconds 14400, grant the external principal the roles/iam.workloadIdentityUser role on the target service account, and add the service account to the constraints/iam.allowServiceAccountCredentialLifetimeExtension organization policy constraint.Workload Identity Federation allows external workloads (such as AWS EC2 instances, Azure VMs, or on-premises servers) to authenticate to Google Cloud APIs by exchanging external ambient credentials for temporary, short-lived Google Cloud access tokens. This eliminates the need to create, download, and rotate static, long-lived service account JSON keys.
gcloud iam workload-identity-pools create-cred-config, passing --service-account-token-lifetime-seconds 14400 configures the impersonated service account token duration to 4 hours.constraints/iam.allowServiceAccountCredentialLifetimeExtension.roles/iam.workloadIdentityUser binds the federated AWS identity pool principal directly to the target Google service account.This approach directly satisfies the 4-hour token duration requirement using native Google Cloud IAM governance without requiring custom token-refresh daemon scripts or insecure long-lived key files.
Secret Manager is a centralized secret storage and management service in Google Cloud that allows applications to store, manage, and retrieve sensitive payloads like API keys, database passwords, and cryptographic certificates. Automated secret rotation typically involves a Cloud Functions trigger invoked periodically by Cloud Pub/Sub topics to generate and update stored secret versions.
The workload required storing external database passwords or third-party API keys within Google Cloud that needed scheduled rotation routines managed by Cloud Functions.
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