Soru

Zorluk: KolayIdentity and Access Management (IAM) Roles and Resource Hierarchy

A DevOps engineer needs to configure access for a service account so that deployment pipelines can attach it to newly created Compute Engine virtual machine instances within a development project. The pipeline should not be granted administrative control over other service accounts or broad management rights over project resources. Which IAM role assignment strategy follows Google Cloud's principle of least privilege?

  1. Grant the Service Account User role (roles/iam.serviceAccountUser) on the specific target service account resource.Cevap
  2. B
    Grant the Service Account Admin role (roles/iam.serviceAccountAdmin) at the project level.
  3. C
    Grant the primitive Editor role (roles/editor) on the parent folder containing the project.
  4. D
    Configure VPC Service Controls perimeter rules without assigning IAM permissions.

Cevap

Grant the Service Account User role (roles/iam.serviceAccountUser) on the specific target service account resource.
Granting the Service Account User role (roles/iam.serviceAccountUser) bound specifically to the target service account resource allows the deployment identity to attach that service account to Compute Engine instances. This directly satisfies the requirement using the fine-grained predefined role and narrowest resource scope possible.

Adım Adım Çözüm

1
Identify the minimal permission required for compute workload deployment.
The deployment identity only requires permission to bind/use the service account with compute resources.
Attaching a service account to a Compute Engine instance requires the iam.serviceAccounts.actAs permission.
2
Evaluate the standard IAM predefined role that grants the actAs permission.
The Service Account User role (roles/iam.serviceAccountUser) provides the necessary actAs capability.
This role allows principals to attach the service account to GCP resources.
3
Select the narrowest resource scope in the GCP hierarchy.
Binding the role directly on the target service account identity limits access to only that specific resource.
Resource hierarchy inheritance allows fine-grained IAM policy bindings directly on individual service account resources.

Anahtar Kavram

Applying Least Privilege with Service Account User Roles and Hierarchy Scoping
Bu soruyu puanla