Medium1 markMultiple Choice

GCP ACE · Question 26 · Domain 3.3: Deploying Cloud Run and Cloud Functions

You are deploying a container image to Cloud Run. You want to ensure that unauthenticated users cannot access the service. How should you configure the deployment?

Answer options:

A.

Deploy the service with the --allow-unauthenticated flag and handle authentication in your application code.

B.

Deploy the service without the --allow-unauthenticated flag and grant the roles/run.invoker role only to authorized identities.

C.

Configure a VPC firewall rule to block public IP addresses.

D.

Use Cloud Armor to block unauthenticated requests.

How to approach this question

Identify the native IAM role used to control access to Cloud Run services.

Full Answer

B.Deploy the service without the --allow-unauthenticated flag and grant the roles/run.invoker role only to authorized identities.✓ Correct
Deploy the service without the --allow-unauthenticated flag and grant the roles/run.invoker role only to authorized identities.
By default, Cloud Run services are secure and require authentication. You must explicitly grant the `roles/run.invoker` IAM role to users, groups, or service accounts that need to access the service. Using the `--allow-unauthenticated` flag grants this role to `allUsers`, making it public.

Common mistakes

Thinking VPC firewall rules apply directly to public Cloud Run endpoints.

Practice the full GCP Associate Cloud Engineer Practice Exam 1

50 questions · hints · full answers · grading

More questions from this exam