A health-tech company hosts a data ingestion microservice on Google Cloud Compute Engine Managed Instance Groups (MIGs) in Project A. The microservice needs to access sensitive third-party API credentials stored in GCP Secret Manager located in a central security project (Project B). The security team mandates strict enforcement of least privilege, zero exposure of static service account key JSON files, and proper service account lifecycle controls. Which TWO actions should the Lead Cloud Architect recommend to establish a secure authentication and access pattern? (Select TWO)
- Attach a dedicated custom service account to the Compute Engine instances and grant it the Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) strictly on the target secret resource in Project B.Answer
- BAssign the primitive Editor role (`roles/editor`) to the Compute Engine Default Service Account at the project level to simplify cross-project resource access.
- Configure cross-project service account impersonation by granting the caller service account in Project A the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) on the resource identity in Project B.Answer
- DGrant the caller service account in Project A the Service Account Admin role (`roles/iam.serviceAccountAdmin`) on the target service account to manage impersonation and service account lifecycle credentials.
- ERequire the application to manage raw encryption keys locally using Customer-Supplied Encryption Keys (CSEK) to encrypt secret values before uploading them to Secret Manager.
Answer
The architect should attach a dedicated custom service account to the compute instances with the Secret Manager Secret Accessor role granted on the specific secret resource, and configure cross-project impersonation using the Service Account Token Creator role.
Securing Secret Manager access and service account lifecycles requires using dedicated custom service accounts with narrow IAM roles. Assigning the Secret Manager Secret Accessor role directly on the targeted secret resource enforces granular access control. For cross-project identity delegation without downloading keys, granting the Service Account Token Creator role enables short-lived impersonation while maintaining strict governance.
Step-by-Step Solution
Key Concept
Service Account Lifecycle & Least-Privilege Secret Access