A Cloud Run app needs access to images in a private Cloud Storage bucket. You must grant access securely following Google best practices. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Enforce public access prevention for the bucket. Configure the Cloud Run service to use a user-managed service account and grant that account Storage Object Viewer on the bucket..
Why this is the answer
The correct approach is to enforce public access prevention and use a user-managed service account. Enforcing public access prevention ensures the bucket contents are not accidentally exposed. Configuring Cloud Run with a user-managed service account (instead of the default Compute Engine service account) adheres to the principle of least privilege and allows for granular control over permissions specific to the Cloud Run service. Granting Storage Object Viewer to this dedicated service account provides the necessary read access to the images without over-privileging. Signed URLs are for temporary, time-limited access for unauthenticated users, which is not the primary use case here for a Cloud Run service accessing its own resources.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed