A developer needs to execute local gcloud commands to manage Cloud Storage objects on behalf of a target service account, [email protected]. Following Google Cloud security best practices, the developer must temporarily impersonate this service account without downloading static key files. Which IAM configuration correctly enables this service account impersonation?
- Grant the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to the developer's user identity on the target service account.Cevap
- BGenerate and download a JSON service account key for [email protected] and authenticate using gcloud auth activate-service-account.
- CGrant the primitive Editor role (roles/editor) to the developer's user identity directly on the target service account resource.
- DGrant the Storage Admin role to the developer at the project level while revoking all permissions on the service account resource level.
Cevap
Grant the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) to the developer's user identity on the target service account.
To impersonate a Google Cloud service account, a principal must be granted the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) on that service account. This allows the principal to create short-lived credentials and act on behalf of the service account without creating or downloading long-lived JSON service account keys.
Adım Adım Çözüm
Anahtar Kavram
Configuring Service Account Impersonation