GCP ACE · Question 45 · Domain 5.2: Managing service accounts
An application running on a Compute Engine VM needs to read files from a specific Cloud Storage bucket. You want to follow the principle of least privilege.
How should you grant the VM access to the bucket?
Answer options:
Use the default Compute Engine service account and grant it the Storage Admin role.
Create a custom Service Account, grant it the Storage Object Viewer role on the bucket, and attach the Service Account to the VM.
Generate a Service Account JSON key and hardcode it into the application's source code.
Make the Cloud Storage bucket public.
50 questions · hints · full answers · grading