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 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?
Generate the credential configuration file with --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.
Configure a Workload Identity Pool with an AWS provider, generate the credential configuration file specifying --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.
Configure Workforce Identity Federation with an OIDC provider, set the workforce pool session duration to 14,400 seconds, and use gcloud auth application-default login --login-config to authenticate the automated AWS EC2 batch workload.
Create a Workload Identity Pool and AWS provider, configure the AWS credentials in Google Cloud Secret Manager, set an automatic 4-hour Cloud Functions rotation trigger, and grant the Secret Accessor role to the AWS EC2 instance profile.
Generate the credential configuration file with --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.
Configure a Workload Identity Pool with an AWS provider, generate the credential configuration file specifying --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.
Configure Workforce Identity Federation with an OIDC provider, set the workforce pool session duration to 14,400 seconds, and use gcloud auth application-default login --login-config to authenticate the automated AWS EC2 batch workload.
Create a Workload Identity Pool and AWS provider, configure the AWS credentials in Google Cloud Secret Manager, set an automatic 4-hour Cloud Functions rotation trigger, and grant the Secret Accessor role to the AWS EC2 instance profile.