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.
A security engineer is configuring access for a new data pipeline in Google Cloud. The deployment involves two projects:
Workloads running on Compute Engine in Project A must use a user-managed service account named data-processor@project-a.iam.gserviceaccount.com to read BigQuery data in Project B. A DevOps engineer needs permission to deploy and configure Compute Engine instances in Project A and attach data-processor@project-a.iam.gserviceaccount.com to those instances. The DevOps engineer must not be permitted to attach or impersonate any other service account in Project A, nor access BigQuery data directly with their personal identity.
Which combination of IAM role bindings meets these requirements while enforcing least privilege?
This configuration grants the BigQuery read permissions directly to the DevOps engineer's personal identity on Project B, while erroneously attempting to grant the Service Account User role to the service account itself on Project A.
roles/iam.serviceAccountUser to the service account (data-processor@...) gives the service account permission to act as other service accounts, rather than allowing the human engineer to attach the service account to compute instances.actAs Authorization: The DevOps engineer lacks the iam.serviceAccounts.actAs permission on the service account, causing VM deployment with an attached service account to fail.The DevOps engineer required direct SQL exploration capabilities inside the BigQuery console on Project B, and the service account needed to execute batch jobs on behalf of other automated project identities.
This configuration grants the Service Account User role (roles/iam.serviceAccountUser) to the DevOps engineer at the Project A project level instead of binding it directly to the specific service account resource.
roles/iam.serviceAccountUser at the project level allows the DevOps engineer to attach any service account in Project A (including default service accounts and administrative service accounts) to new compute resources.OVER_PRIVILEGED_SERVICE_ACCOUNT_USER finding.The organization had a flat security structure and wanted the DevOps engineer to have unrestricted authority to deploy VMs using any current or future service account created inside Project A.
In Google Cloud IAM, service accounts possess a dual nature: they act as identities that can be granted access to resources, and as resources that other principals can manage, attach, or impersonate. Granting the Service Account User role (roles/iam.serviceAccountUser) directly on the service account resource provides granular control over who can attach that specific identity to compute resources.
roles/bigquery.dataViewer to serviceAccount:data-processor@project-a.iam.gserviceaccount.com on Project B treats the service account as an identity, giving the workload the necessary read permissions without exposing data to unauthorized users.roles/compute.instanceAdmin.v1 to the DevOps engineer on Project A provides the necessary permissions to create and manage virtual machine instances.roles/iam.serviceAccountUser specifically on the service account resource (data-processor@project-a.iam.gserviceaccount.com) allows the engineer to attach only this designated service account to VMs, without granting access to other service accounts in Project A.Managing IAM policies at the individual service account resource level adheres to the principle of least privilege by avoiding project-wide roles/iam.serviceAccountUser bindings that would inadvertently allow attachment of any existing or future service account in the project.
This option grants the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to the DevOps engineer at the Project A level instead of granting the Service Account User role on the specific service account resource.
iam.serviceAccounts.actAs permission, provided by roles/iam.serviceAccountUser. The roles/iam.serviceAccountTokenCreator role only permits generating short-lived OAuth2 access tokens and signing JSON Web Tokens (JWTs).roles/iam.serviceAccountTokenCreator at the project level enables the engineer to generate OAuth credentials for every service account in Project A, violating least privilege and risking broad privilege escalation.iam.serviceAccounts.getAccessToken (in Token Creator) is used for direct programmatic impersonation, not for attaching service accounts to VM metadata.The requirement called for the DevOps engineer to generate temporary OAuth 2.0 access tokens via the IAM credentials API to test BigQuery API endpoints locally without deploying any VM instances.
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