A security engineer must enable a developer to manage Cloud Storage buckets in a production project using service account impersonation, eliminating the need for long-lived service account keys. What is the correct sequence of steps to establish and verify this impersonated access?
- 1Grant the target service account the Storage Admin role on the destination project.
- 2Grant the developer's user identity the Service Account Token Creator role on the target service account.
- 3Authenticate the developer's local environment using gcloud auth login.
- 4Execute gcloud storage commands specifying the --impersonate-service-account flag with the target service account email.
Answer
The correct order to establish service account impersonation begins by assigning resource permissions to the target service account, granting the Service Account Token Creator role on the service account to the user, authenticating the user identity, and executing gcloud commands with the impersonation flag.
To configure service account impersonation securely, the target service account must first be granted necessary resource access permissions (Storage Admin). Next, the user principal must be granted the Service Account Token Creator role directly on the target service account. The user then authenticates their identity via gcloud auth login, and finally passes the --impersonate-service-account flag when running CLI commands.
Step-by-Step Solution
Key Concept
Configuring Service Account Impersonation