An organization requires developers to run local database migration scripts against a Cloud SQL instance by assuming the identity of a dedicated service account `[email protected]`. In accordance with Google Cloud security best practices, static service account key creation is strictly disabled by organizational policy. Which configuration allows the developers to authenticate as the service account while adhering to the security policy?
- Grant the developers the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) on the target service account resource to enable IAM service account impersonation.Cevap
- BGenerate a JSON service account key for [email protected] and distribute it securely to developer workstations.
- CGrant the developers the primitive Editor role (roles/editor) at the project level to grant full access to all service account operations in the project.
- DGrant the Service Account User role (roles/iam.serviceAccountUser) at the project level and apply an IAM deny policy on the Cloud SQL instance level to restrict authorization.
Cevap
Grant the developers the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) on the target service account resource to enable IAM service account impersonation.
The Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) granted on the specific service account resource allows users to impersonate the service account and obtain short-lived OAuth 2.0 access tokens. This meets the requirement of authenticating as the service account while following security best practices that prohibit long-lived static key exports.
Adım Adım Çözüm
Anahtar Kavram
Service Account Impersonation vs. Static Key Management