An organization is deploying an application on a Compute Engine virtual machine instance that needs read-only access to objects stored in a Cloud Storage bucket. Which configuration aligns with Google Cloud recommended best practices for service account security and least privilege?
- Create a user-managed service account with the Storage Object Viewer role assigned to it, and attach this service account to the Compute Engine instance.Cevap
- BAttach the default Compute Engine service account to the VM instance and grant it the project-level Editor primitive role.
- CGenerate a service account JSON key file, grant the developer the Service Account Admin role, and embed the key file directly into the application source code.
- DConfigure Customer-Supplied Encryption Keys (CSEK) on the Cloud Storage bucket and store the raw encryption key in an unencrypted startup script on the VM.
Cevap
Create a user-managed service account with the Storage Object Viewer role assigned to it, and attach this service account to the Compute Engine instance.
The optimal architecture attaches a user-managed service account with minimal predefined roles (Storage Object Viewer) directly to the Compute Engine instance. This enables seamless authentication via the metadata server without exporting service account keys or granting excessive permissions.
Adım Adım Çözüm
Anahtar Kavram
Service Account Lifecycle and Least Privilege Security
Tahmini Süre:50s