Google Associate Cloud Engineer Practice Test 66

Question 650

A developer needs to invoke an API as a service account using short-lived impersonated credentials from the CLI. What should the administrator do?

  1. Use the IAM Credentials signJwt operation with the required permission
  2. Grant appropriate roles/iam.serviceAccountTokenCreator on that service account
  3. Grant the administrator the required Service Account User permission on that service account
  4. Grant roles/iam.serviceAccountUser on the specific service account as appropriate
  5. Use IAM Credentials signBlob with suitable signing permission

Explanation

Correct Answer

B:

Service Account Token Creator includes permissions to mint short-lived credentials for impersonation. It should be granted only to trusted impersonators on the intended target identity.

Incorrect Answers

A:

It can sign a JWT through a service account credential API; however, it does not provide the specific operation to enable access token impersonation of a service account. The two controls serve different purposes.

C:

This alternative addresses compute engine service account attachment and adc by allowing a team to authorize an operator to attach a service account; The incident, however, requires the different action to enable access token impersonation of a service account, so its central configuration remains unchanged.

D:

Select this when the goal is to grant service account actAs for resource attachment. Here the decisive requirement is to enable access token impersonation of a service account, and that outcome is not achieved by this action.

E:

This mechanism is intended to sign arbitrary bytes through the IAM Credentials API. It does not implement the required action to enable access token impersonation of a service account, even though both are relevant to the same general service.

Question 651

A signing workflow needs to sign a JWT as a service account without downloading its private key. Which choice provides the required behavior?

  1. Obtain a short-lived OAuth 2.0 access token for the authorized service account
  2. Use the IAM Credentials signJwt operation with the required permission
  3. Use IAM Credentials signBlob with suitable signing permission
  4. Grant roles/iam.serviceAccountUser on the specific service account as appropriate
  5. Grant appropriate roles/iam.serviceAccountTokenCreator on that service account

Explanation

Correct Answer

B:

The IAM Credentials API can perform service-account signing operations without exposing a private key to the caller. The caller must possess the appropriate signing permission for that identity.

Incorrect Answers

A:

The technical effect is to use an OAuth access token for Google Cloud APIs, not to perform keyless JWT signing as a service account; That distinction matters here because the first operation serves authenticate API calls with a short-lived bearer token, rather than the scenario's required result.

C:

Its purpose is to sign arbitrary bytes through the IAM Credentials API. That distinction matters: the scenario calls for an action to perform keyless JWT signing as a service account, not this separate configuration task.

D:

This setting would grant service account actAs for resource attachment. That behavior does not establish the requested ability to perform keyless JWT signing as a service account; it addresses an adjacent concern instead.

E:

Using this action would permit minting short-lived impersonation credentials, not perform keyless JWT signing as a service account. Its function is different from the specific change described in the scenario.

Question 652

A transaction system must produce a cryptographic signature over arbitrary payload bytes with a service account without accessing its private key. Which approach should be selected?

  1. Set up local Application Default Credentials with service account impersonation
  2. Use the IAM Credentials signJwt operation with the required permission
  3. Grant roles/iam.serviceAccountUser on the specific service account as appropriate
  4. Grant appropriate roles/iam.serviceAccountTokenCreator on that service account
  5. Use IAM Credentials signBlob with suitable signing permission

Explanation

Correct Answer

E:

The IAM Credentials signBlob operation signs input bytes using the service account identity. Unlike generateAccessToken, this operation returns a signature for the supplied payload rather than an OAuth bearer token.

Incorrect Answers

A:

Choosing this would configure application default impersonated credentials, an appropriate action for cli and local development impersonation operations; It cannot take the place of the separate step needed to generate a keyless service account payload signature in this specific situation.

B:

The result of this choice would be to sign a JWT through a service account credential API. The requested outcome, to generate a keyless service account payload signature, is handled at a different layer or through another operation.

C:

Administrators use it to grant service account actAs for resource attachment, rather than to generate a keyless service account payload signature. Applying it would change the wrong component of this deployment.

D:

Select this when the goal is to permit minting short-lived impersonation credentials. Here the decisive requirement is to generate a keyless service account payload signature, and that outcome is not achieved by this action.

Question 653

A developer with an interactive user login must perform one gcloud operation using a deployment service account without exporting a private key. What is the most direct solution?

  1. Set up local Application Default Credentials with service account impersonation
  2. Use gcloud with --impersonate-service-account set to the deployment identity
  3. Verify the calling principal has Service Account Token Creator on the target account
  4. Replace the downloaded key workflow with supported short-lived service account impersonation

Explanation

Correct Answer

B:

The gcloud impersonation flag obtains short-lived credentials to run a supported command as the target service account. This avoids distributing a user-managed private key to the developer.

Incorrect Answers

A:

This choice is useful to configure application default impersonated credentials. The stated task is to execute one CLI operation as a workload identity, which requires a different mechanism or permission scope.

C:

It can troubleshoot impersonator authorization for token minting; however, it does not provide the specific operation to execute one CLI operation as a workload identity. The two controls serve different purposes.

D:

Using this action would avoid static keys for command-line administrative automation, not execute one CLI operation as a workload identity. Its function is different from the specific change described in the scenario.

Question 654

A local application using Google client libraries should call APIs through a service account without keeping its JSON key. Which implementation matches this requirement?

  1. Verify the calling principal has Service Account Token Creator on the target account
  2. Create a user-managed service account dedicated to the inventory application
  3. Set up local Application Default Credentials with service account impersonation
  4. Replace the downloaded key workflow with supported short-lived service account impersonation
  5. Use gcloud with --impersonate-service-account set to the deployment identity

Explanation

Correct Answer

C:

Local ADC can be configured to use impersonated service-account credentials for supported clients. This keeps developer login credentials separate from the API identity and avoids a downloaded signing key.

Incorrect Answers

A:

Its purpose is to troubleshoot impersonator authorization for token minting. That distinction matters: the scenario calls for an action to enable local library calls as a service account, not this separate configuration task.

B:

While this can create a dedicated nonhuman application principal, the present task requires an action to enable local library calls as a service account. This operation does not supply the behavior described in the requirements.

D:

This mechanism is intended to avoid static keys for command-line administrative automation. It does not implement the required action to enable local library calls as a service account, even though both are relevant to the same general service.

E:

The result of this choice would be to run a gcloud command through service account impersonation. The requested outcome, to enable local library calls as a service account, is handled at a different layer or through another operation.

Question 655

A gcloud impersonation command fails despite the target service account having broad Storage roles. What should the administrator do?

  1. Use gcloud with --impersonate-service-account set to the deployment identity
  2. Grant the eligible federated principal Workload Identity User on the target service account
  3. Set up local Application Default Credentials with service account impersonation
  4. Verify the calling principal has Service Account Token Creator on the target account
  5. Replace the downloaded key workflow with supported short-lived service account impersonation

Explanation

Correct Answer

D:

Target service permissions determine what the impersonated identity may do after token issuance. The caller also independently requires permission to impersonate that identity.

Incorrect Answers

A:

Select this when the goal is to run a gcloud command through service account impersonation. Here the decisive requirement is to fix denied service account impersonation, and that outcome is not achieved by this action.

B:

Choosing this would authorize federated principal service-account impersonation, an appropriate action for workload identity federation with oidc ci operations; It cannot take the place of the separate step needed to fix denied service account impersonation in this specific situation.

C:

This choice is useful to configure application default impersonated credentials. The stated task is to fix denied service account impersonation, which requires a different mechanism or permission scope.

E:

The tool can avoid static keys for command-line administrative automation, but it cannot be substituted for the capability needed to fix denied service account impersonation. Its operational effect is not equivalent.

Question 656

A script stores a downloaded service account key merely to run administrative gcloud commands on behalf of a CI operator. Which choice provides the required behavior?

  1. Use Application Default Credentials with the VM's attached service account
  2. Verify the calling principal has Service Account Token Creator on the target account
  3. Replace the downloaded key workflow with supported short-lived service account impersonation
  4. Set up local Application Default Credentials with service account impersonation
  5. Use gcloud with --impersonate-service-account set to the deployment identity

Explanation

Correct Answer

C:

Short-lived impersonation reduces exposure of long-lived private credentials in scripts. Appropriate caller-to-target permissions still must be established for the desired operations.

Incorrect Answers

A:

This proposal can let client libraries obtain attached VM credentials, but the failure or goal described here calls for a way to replace a CLI key file with ephemeral credentials; It changes the wrong control or scope for the requested outcome.

B:

While this can troubleshoot impersonator authorization for token minting, the present task requires an action to replace a CLI key file with ephemeral credentials. This operation does not supply the behavior described in the requirements.

D:

This setting would configure application default impersonated credentials. That behavior does not establish the requested ability to replace a CLI key file with ephemeral credentials; it addresses an adjacent concern instead.

E:

This approach can run a gcloud command through service account impersonation. The requirement is to replace a CLI key file with ephemeral credentials, so it controls a different part of the workflow and leaves that result unaddressed.

Question 657

A service account workload must call a Google Cloud API that authorizes OAuth permissions on each request. How should the team proceed?

  1. Obtain a short-lived OAuth 2.0 access token for the authorized service account
  2. Call IAM Credentials generateAccessToken under a principal with appropriate delegation rights
  3. Generate an OIDC ID token for the destination audience and satisfy the service's invoker policy
  4. Request a fresh short-lived credential through the supported authentication flow

Explanation

Correct Answer

A:

Google Cloud APIs commonly use OAuth access tokens to authenticate the caller. The token does not substitute for resource IAM grants required by the target API.

Incorrect Answers

B:

The tool can mint access tokens using the IAM Credentials API, but it cannot be substituted for the capability needed to authenticate API calls with a short-lived bearer token. Its operational effect is not equivalent.

C:

The result of this choice would be to present an audience-bound identity token to Cloud Run. The requested outcome, to authenticate API calls with a short-lived bearer token, is handled at a different layer or through another operation.

D:

Select this when the goal is to refresh an expired service account credential. Here the decisive requirement is to authenticate API calls with a short-lived bearer token, and that outcome is not achieved by this action.

Question 658

A caller must invoke a private Cloud Run URL that checks a token audience. What is the most direct solution?

  1. Grant appropriate roles/iam.serviceAccountTokenCreator on that service account
  2. Request a fresh short-lived credential through the supported authentication flow
  3. Call IAM Credentials generateAccessToken under a principal with appropriate delegation rights
  4. Generate an OIDC ID token for the destination audience and satisfy the service's invoker policy
  5. Obtain a short-lived OAuth 2.0 access token for the authorized service account

Explanation

Correct Answer

D:

Authenticated Cloud Run invocation uses an identity token with a valid audience, alongside applicable authorization. An ordinary API access token is not interchangeable with an audience-bound ID token.

Incorrect Answers

A:

Choosing this would permit minting short-lived impersonation credentials, an appropriate action for service account user versus token creator operations; It cannot take the place of the separate step needed to authenticate a private Cloud Run HTTP request in this specific situation.

B:

This approach can refresh an expired service account credential. The requirement is to authenticate a private Cloud Run HTTP request, so it controls a different part of the workflow and leaves that result unaddressed.

C:

This setting would mint access tokens using the IAM Credentials API. That behavior does not establish the requested ability to authenticate a private Cloud Run HTTP request; it addresses an adjacent concern instead.

E:

This choice is useful to use an OAuth access token for Google Cloud APIs. The stated task is to authenticate a private Cloud Run HTTP request, which requires a different mechanism or permission scope.

Question 659

An application receives 401 errors because it reused an expired service account access token from yesterday. Which implementation matches this requirement?

  1. Request a fresh short-lived credential through the supported authentication flow
  2. Generate an OIDC ID token for the destination audience and satisfy the service's invoker policy
  3. Inspect relevant IAM Credentials API audit log records and configure required log visibility
  4. Obtain a short-lived OAuth 2.0 access token for the authorized service account
  5. Call IAM Credentials generateAccessToken under a principal with appropriate delegation rights

Explanation

Correct Answer

A:

Service account access tokens have limited lifetimes. Applications should refresh tokens rather than assume a minted access token remains valid indefinitely.

Incorrect Answers

B:

This mechanism is intended to present an audience-bound identity token to Cloud Run. It does not implement the required action to recover from expired API bearer tokens, even though both are relevant to the same general service.

C:

This proposal can inspect token-generation activity associated with impersonation, but the failure or goal described here calls for a way to recover from expired API bearer tokens; It changes the wrong control or scope for the requested outcome.

D:

The result of this choice would be to use an OAuth access token for Google Cloud APIs. The requested outcome, to recover from expired API bearer tokens, is handled at a different layer or through another operation.

E:

Administrators use it to mint access tokens using the IAM Credentials API, rather than to recover from expired API bearer tokens. Applying it would change the wrong component of this deployment.

Question 660

A central automation service must issue short-lived access tokens for an authorized service account without distributing its private key. What should the administrator do?

  1. Obtain a short-lived OAuth 2.0 access token for the authorized service account
  2. Use attached or federated short-lived credentials instead of creating a user-managed key
  3. Request a fresh short-lived credential through the supported authentication flow
  4. Generate an OIDC ID token for the destination audience and satisfy the service's invoker policy
  5. Call IAM Credentials generateAccessToken under a principal with appropriate delegation rights

Explanation

Correct Answer

E:

The IAM Credentials API supports issuing access tokens for a target service account. Authorized callers can use it to avoid exposing user-managed private keys.

Incorrect Answers

A:

This choice is useful to use an OAuth access token for Google Cloud APIs. The stated task is to obtain short-lived credentials for delegated service account access, which requires a different mechanism or permission scope.

B:

An operator would use this action to avoid distributing long-lived service account private keys, chiefly when trying to choose keyless workload authentication; The current requirement is to obtain short-lived credentials for delegated service account access, which remains unresolved by that operation.

C:

The tool can refresh an expired service account credential, but it cannot be substituted for the capability needed to obtain short-lived credentials for delegated service account access. Its operational effect is not equivalent.

D:

It can present an audience-bound identity token to Cloud Run; however, it does not provide the specific operation to obtain short-lived credentials for delegated service account access. The two controls serve different purposes.

Associate Cloud Engineer Practice Tests