Question 640
A developer proposes assigning their personal Google user account to a VM to call APIs while unattended. Which configuration best meets the requirement?
- Apply least-privilege IAM roles to its attached service account and account for VM access scopes
- Create and attach separate user-managed service accounts with only the permissions each job needs
- Inspect the Compute Engine default service account attached to the VM
- Attach a service account to the VM instead of relying on a human user's credentials
- Retain required Google-managed service agents and review their assigned service-agent roles
Explanation
Correct Answer
D:Service accounts provide a nonhuman principal suitable for deployed workloads. Embedding personal credentials creates lifecycle, revocation, and accountability problems.
Incorrect Answers
A:The choice is aimed at a different purpose: to reduce API authority of a VM workload; Even if it can manage both service account IAM and applicable VM scopes, that would not accomplish the stated requirement to authenticate unattended VM API calls without a user credential.
B:Select this when the goal is to isolate workload privileges with dedicated identities. Here the decisive requirement is to authenticate unattended VM API calls without a user credential, and that outcome is not achieved by this action.
C:This mechanism is intended to identify the default runtime identity used by a VM. It does not implement the required action to authenticate unattended VM API calls without a user credential, even though both are relevant to the same general service.
E:Administrators use it to preserve a Google-managed service agent used by infrastructure, rather than to authenticate unattended VM API calls without a user credential. Applying it would change the wrong component of this deployment.
Question 641
A VM-based reporting tool must read one Cloud Storage bucket without storing long-lived JSON keys on disk. Which choice provides the required behavior?
- Attach a service account to the VM and grant it the required bucket permission
- Apply least-privilege IAM roles to its attached service account and account for VM access scopes
- Use Application Default Credentials with the VM's attached service account
- Grant the administrator the required Service Account User permission on that service account
Explanation
Correct Answer
A:An attached VM service account supplies credentials through the metadata server. Bucket-level IAM grants provide the storage access without a downloaded private key.
Incorrect Answers
B:This choice is useful to manage both service account IAM and applicable VM scopes. The stated task is to authorize VM-to-bucket access without storing keys, which requires a different mechanism or permission scope.
C:Using this action would let client libraries obtain attached VM credentials, not authorize VM-to-bucket access without storing keys. Its function is different from the specific change described in the scenario.
D:This setting would authorize an operator to attach a service account. That behavior does not establish the requested ability to authorize VM-to-bucket access without storing keys; it addresses an adjacent concern instead.
Question 642
A VM administrator can update machine settings but gets a permission error when attaching a particular service account. Which approach should be selected?
- Grant the administrator the required Service Account User permission on that service account
- Use Application Default Credentials with the VM's attached service account
- Attach a service account to the VM and grant it the required bucket permission
- Apply least-privilege IAM roles to its attached service account and account for VM access scopes
- Set up local Application Default Credentials with service account impersonation
Explanation
Correct Answer
A:Attaching a service account requires permission to act as that identity, in addition to relevant Compute Engine permissions. VM administration alone need not authorize impersonating every account.
Incorrect Answers
B:Its purpose is to let client libraries obtain attached VM credentials. That distinction matters: the scenario calls for an action to fix service account attachment permissions, not this separate configuration task.
C:Administrators use it to use an attached VM identity for keyless Cloud Storage access, rather than to fix service account attachment permissions. Applying it would change the wrong component of this deployment.
D:While this can manage both service account IAM and applicable VM scopes, the present task requires an action to fix service account attachment permissions. This operation does not supply the behavior described in the requirements.
E:In a workflow for cli and local development impersonation, it can configure application default impersonated credentials; This question instead asks how to fix service account attachment permissions; substituting the former action would leave that distinct technical requirement unmet.
Question 643
Application code on a correctly configured Google Cloud VM needs credentials for client-library API calls. Which method addresses the task?
- Attach a service account to the VM and grant it the required bucket permission
- Apply least-privilege IAM roles to its attached service account and account for VM access scopes
- Grant the administrator the required Service Account User permission on that service account
- Grant roles/iam.serviceAccountUser on the specific service account as appropriate
- Use Application Default Credentials with the VM's attached service account
Explanation
Correct Answer
E:Google Cloud client libraries can discover attached workload credentials through Application Default Credentials. Hardcoding a private key is unnecessary when the runtime metadata service is available.
Incorrect Answers
A:This choice is useful to use an attached VM identity for keyless Cloud Storage access. The stated task is to authenticate VM application code through ADC, which requires a different mechanism or permission scope.
B:The tool can manage both service account IAM and applicable VM scopes, but it cannot be substituted for the capability needed to authenticate VM application code through ADC. Its operational effect is not equivalent.
C:It can authorize an operator to attach a service account; however, it does not provide the specific operation to authenticate VM application code through ADC. The two controls serve different purposes.
D:The choice is aimed at a different purpose: to allow VM identity attachment without token minting; Even if it can grant service account actAs for resource attachment, that would not accomplish the stated requirement to authenticate VM application code through ADC.
Question 644
A security engineer wants to reduce the effective API permissions available to an application on a Compute Engine VM. What is the best next step?
- Grant the deployer suitable permission to act as the selected runtime service account
- Attach a service account to the VM and grant it the required bucket permission
- Use Application Default Credentials with the VM's attached service account
- Grant the administrator the required Service Account User permission on that service account
- Apply least-privilege IAM roles to its attached service account and account for VM access scopes
Explanation
Correct Answer
E:A VM application's access is constrained by the service account's IAM permissions and relevant OAuth access scopes. Giving the account a broad role while narrowing only one surface can be incomplete.
Incorrect Answers
A:This alternative addresses cloud run runtime service identity by allowing a team to authorize deployer attachment of a runtime service account; The incident, however, requires the different action to reduce API authority of a VM workload, so its central configuration remains unchanged.
B:While this can use an attached VM identity for keyless Cloud Storage access, the present task requires an action to reduce API authority of a VM workload. This operation does not supply the behavior described in the requirements.
C:Its purpose is to let client libraries obtain attached VM credentials. That distinction matters: the scenario calls for an action to reduce API authority of a VM workload, not this separate configuration task.
D:This setting would authorize an operator to attach a service account. That behavior does not establish the requested ability to reduce API authority of a VM workload; it addresses an adjacent concern instead.
Question 645
An authenticated client invokes a private Cloud Run service. The service itself must then read a private Cloud Storage object. Which TWO identity authorizations are independently required? (Choose TWO.)
- Give the Cloud Run runtime service account the required Cloud Storage object-read permission on the bucket
- Give the calling principal the appropriate Cloud Run Invoker authorization on the target service
- Make the bucket public and remove invocation authentication from the service
- Grant the HTTP caller Project Owner and assume the runtime inherits that caller's full IAM privileges
Explanation
Correct Answers
A:The running Cloud Run service calls Cloud Storage using its configured service identity. That runtime principal needs the appropriate bucket authorization regardless of which caller invoked it.
B:Private service invocation checks the identity of the HTTP caller. The caller's ability to invoke is distinct from the runtime's permissions to read downstream data.
Incorrect Answers
C:Publishing both the object store and the endpoint undermines the private-access requirements. Separate IAM grants can authorize both links without public exposure.
D:Cloud Run uses a configured runtime service identity for its Google API calls; it does not automatically inherit a caller's broad roles. Project Owner also violates least privilege.
Question 646
A Cloud Run revision receives permission-denied responses when reading a Cloud Storage bucket even though deployment succeeded. Which choice provides the required behavior?
- Configure its service identity to a dedicated user-managed service account
- Grant the Cloud Run runtime service account an appropriate role on the target bucket
- Grant Secret Manager Secret Accessor to its runtime service account for the required secret
- Grant the deployer suitable permission to act as the selected runtime service account
Explanation
Correct Answer
B:Deployment permission and runtime data access are separate concerns. A successful revision rollout does not grant the runtime identity permission to read protected objects.
Incorrect Answers
A:This choice is useful to set a dedicated Cloud Run runtime principal. The stated task is to fix storage authorization for a running service, which requires a different mechanism or permission scope.
C:This setting would allow Cloud Run runtime retrieval of a protected secret. That behavior does not establish the requested ability to fix storage authorization for a running service; it addresses an adjacent concern instead.
D:Using this action would authorize deployer attachment of a runtime service account, not fix storage authorization for a running service. Its function is different from the specific change described in the scenario.
Question 647
A Cloud Run workload must retrieve a secret payload from Secret Manager at request time. Which approach should be selected?
- Grant the Cloud Run runtime service account an appropriate role on the target bucket
- Grant Secret Manager Secret Accessor to its runtime service account for the required secret
- Create a user-managed service account dedicated to the inventory application
- Configure its service identity to a dedicated user-managed service account
- Grant the deployer suitable permission to act as the selected runtime service account
Explanation
Correct Answer
B:Secret Manager authorization is evaluated against the identity making the access request. A narrow secret-level access grant avoids unnecessary access to unrelated secrets.
Incorrect Answers
A:While this can authorize Cloud Run runtime access to a bucket, the present task requires an action to permit reading one Secret Manager secret. This operation does not supply the behavior described in the requirements.
C:This alternative addresses service account creation and lifecycle by allowing a team to create a dedicated nonhuman application principal; The incident, however, requires the different action to permit reading one Secret Manager secret, so its central configuration remains unchanged.
D:The result of this choice would be to set a dedicated Cloud Run runtime principal. The requested outcome, to permit reading one Secret Manager secret, is handled at a different layer or through another operation.
E:This mechanism is intended to authorize deployer attachment of a runtime service account. It does not implement the required action to permit reading one Secret Manager secret, even though both are relevant to the same general service.
Question 648
A CI operator can deploy a Cloud Run service but cannot configure it to run as a specified user-managed service account. Which method addresses the task?
- Create and attach separate user-managed service accounts with only the permissions each job needs
- Grant Secret Manager Secret Accessor to its runtime service account for the required secret
- Grant the deployer suitable permission to act as the selected runtime service account
- Configure its service identity to a dedicated user-managed service account
- Grant the Cloud Run runtime service account an appropriate role on the target bucket
Explanation
Correct Answer
C:The deployer and the deployed service have different identities. Permission to deploy infrastructure does not automatically allow attaching an arbitrary service account as runtime identity.
Incorrect Answers
A:The technical effect is to isolate workload privileges with dedicated identities, not to resolve Cloud Run service-identity assignment denial; That distinction matters here because the first operation serves remove a shared overly privileged service account, rather than the scenario's required result.
B:Using this action would allow Cloud Run runtime retrieval of a protected secret, not resolve Cloud Run service-identity assignment denial. Its function is different from the specific change described in the scenario.
D:The tool can set a dedicated Cloud Run runtime principal, but it cannot be substituted for the capability needed to resolve Cloud Run service-identity assignment denial. Its operational effect is not equivalent.
E:This choice is useful to authorize Cloud Run runtime access to a bucket. The stated task is to resolve Cloud Run service-identity assignment denial, which requires a different mechanism or permission scope.
Question 649
An operator needs to attach a service account to a Compute Engine instance, but should not be given permission to mint arbitrary access tokens. Which implementation matches this requirement?
- Grant appropriate roles/iam.serviceAccountTokenCreator on that service account
- Use IAM Credentials signBlob with suitable signing permission
- Use the IAM Credentials signJwt operation with the required permission
- Grant roles/iam.serviceAccountUser on the specific service account as appropriate
Explanation
Correct Answer
D:Service Account User provides permission to actAs for supported resource attachment flows. It is not the same as granting the broader ability to create impersonation tokens directly.
Incorrect Answers
A:Its purpose is to permit minting short-lived impersonation credentials. That distinction matters: the scenario calls for an action to allow VM identity attachment without token minting, not this separate configuration task.
B:While this can sign arbitrary bytes through the IAM Credentials API, the present task requires an action to allow VM identity attachment without token minting. This operation does not supply the behavior described in the requirements.
C:Administrators use it to sign a JWT through a service account credential API, rather than to allow VM identity attachment without token minting. Applying it would change the wrong component of this deployment.
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?
- Use the IAM Credentials signJwt operation with the required permission
- Grant appropriate roles/iam.serviceAccountTokenCreator on that service account
- Grant the administrator the required Service Account User permission on that service account
- Grant roles/iam.serviceAccountUser on the specific service account as appropriate
- 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.