A security team is establishing identity and access management controls for an automated workload running on Compute Engine virtual machines in a workload project `stg-workloads`. The workload requires read access to sensitive database credentials stored in Google Cloud Secret Manager in a centralized security project `sec-mgmt`. Which of the following architectural security controls should be implemented to enforce service account lifecycle security and least privilege access? (Select TWO.)
- Attach a dedicated service account to the Compute Engine instances and rely on Application Default Credentials (ADC) instead of generating long-lived service account JSON keys.Answer
- Grant the compute service account the Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) bound directly to the target secret resource in project `sec-mgmt`.Answer
- CAssign the primitive Editor role (`roles/editor`) on project `sec-mgmt` to the compute service account to ensure seamless API connectivity across all security services.
- DGrant the Service Account Admin role (`roles/iam.serviceAccountAdmin`) to the compute service account so it can create runtime tokens for administrative tasks.
- ERequire Customer-Supplied Encryption Keys (CSEK) to encrypt secret payloads in Secret Manager to avoid using Google managed KMS key rotation.
Answer
The correct security controls are to attach a dedicated service account to the Compute Engine instances using Application Default Credentials (ADC) rather than exporting static JSON keys, and to grant that service account the Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) restricted specifically to the target secret resource.
The correct approach combines keyless authentication and resource-level role assignment. Attaching a dedicated service account to Compute Engine instances enables Application Default Credentials (ADC), eliminating service account key management overhead and exposure. Furthermore, granting the Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) specifically on the target secret enforces strict least privilege across project boundaries.
Step-by-Step Solution
Key Concept
Keyless Authentication and Least-Privilege IAM Secret Access
Estimated Time:1m 30s