An organization uses an automated CI/CD build pipeline running inside a central management project (`ci-build-proj`). The build process executes under a dedicated service account `[email protected]`. During the deployment phase, this pipeline must provision resources in a production project (`prod-scope-proj`) using a production service account `[email protected]`. Corporate security policies mandate that no service account keys can be exported or stored. Which IAM configuration correctly enables `ci-runner` to generate short-lived credentials to act as `prod-deployer` while strictly following the principle of least privilege?
- Grant `[email protected]` the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) directly on the `[email protected]` service account resource.Cevap
- BGenerate a service account JSON key for `[email protected]` and store it securely in the build system's secret storage.
- CGrant `[email protected]` the Service Account User role (`roles/iam.serviceAccountUser`) and Project Editor role (`roles/editor`) at the `prod-scope-proj` project level.
- DGrant `[email protected]` the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) directly on the `[email protected]` service account resource.
Cevap
Grant `[email protected]` the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) directly on the `[email protected]` service account resource.
To enable short-lived credentials and service account impersonation without key exports, the executing principal (the build runner service account) must be granted the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) directly on the target service account's IAM resource policy.
Adım Adım Çözüm
Anahtar Kavram
Service Account Impersonation via Service Account Token Creator