A security engineer needs to configure short-lived credential access for a developer working from a local terminal. The developer must deploy Cloud Storage resources by impersonating a dedicated service account named `[email protected]` without exporting service account JSON keys. Arrange the steps in the correct order to configure and enable service account impersonation using the gcloud CLI.
- 1Grant the required Cloud Storage Admin permissions to the target service account `[email protected]`.
- 2Grant the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) on `[email protected]` to the developer's Google Account.
- 3Authenticate the developer's local workstation CLI using `gcloud auth login` with their user account credentials.
- 4Configure the gcloud CLI to impersonate the target service account by running `gcloud config set auth/impersonate_service_account [email protected]`.
Cevap
The correct order begins with granting resource permissions to the target service account, followed by assigning the Service Account Token Creator role on the target service account to the developer, authenticating the user identity with `gcloud auth login`, and finally setting `gcloud config set auth/impersonate_service_account`.
To establish secure, keyless service account impersonation for local gcloud CLI execution, the workflow follows a precise logical sequence. First, the target service account must be granted the necessary workload permissions on target GCP resources. Second, the user identity must be granted the `Service Account Token Creator` role (`roles/iam.serviceAccountTokenCreator`) on the target service account to authorize short-lived token generation. Third, the user logs into gcloud using `gcloud auth login` to authenticate their user principal. Finally, running `gcloud config set auth/impersonate_service_account` configures the local gcloud environment to transparently request short-lived tokens for the specified target service account during resource operations.
Adım Adım Çözüm
Anahtar Kavram
Configuring Service Account Impersonation via gcloud CLI