Exam Professional-Cloud-Security-Engineer Topic 2 Question 180 Discussion

Actual exam question for Google's Professional-Cloud-Security-Engineer exam
Question #: 180
Topic #: 2
Your company is developing a new application for your organization The application consists of two Cloud Run services, service A and service B Service A provides a web-based user front-end Service B provides back-end services that are called by service A You need to set up identity and access management for the application Your solution should follow the principle of least privilege What should you do?

Suggested Answer: B Vote an answer

The problem describes an application with two Cloud Run services (Service A - frontend, Service B - backend) and requires setting up IAM with the principle of least privilege Service A calls Service B Principle of Least Privilege: This principle dictates that each entity (in this case, a Cloud Run service) should only have the minimum permissions necessary to perform its function Separate Service Accounts for Separate Services: To adhere to the principle of least privilege, it's best practice to assign a unique service account to each distinct service or component This ensures that a compromise of one service account does not grant excessive permissions across other services Service A needs permissions to run itself and to invoke Service B Service B only needs permissions to run itselfExtract Reference: "Assign a service account to a Cloud Run service The service account acts as the identity for your service and determines what permissions your revisions have when executing requests It is a best practice to grant each service account only the permissions that are required to run the specific service (principle of least privilege)" (Google Cloud documentation: https://cloudgooglecom/run/docs/configuring/service-accounts) Authentication for Cloud Run Services: When one Cloud Run service (caller) needs to invoke another Cloud Run service (callee), the caller must be authorized to do so This is typically achieved by assigning the roles/runinvoker role on the callee service to the caller's service accountExtract Reference: "To allow a service to invoke another service, grant the roles/runinvoker role on the called service to the caller's service account" (Google Cloud documentation: https://cloudgooglecom/run/docs/securing/service-to-service) Let's evaluate the options:
A Create a new service account with the permissions to run service A and service B Require authentication for service B Permit only the new service account to call the backend This violates the principle of least privilege by giving a single service account permissions for both services If that service account were compromised, both services would be affected B Create two separate service accounts Grant one service account the permissions to execute service A, and grant the other service account the permissions to execute service B Require authentication for service B Permit only the service account for service A to call the back-end This aligns perfectly with least privilege Service A gets its own identity, Service B gets its own identity Service A's service account is then granted runinvoker permissions on Service B, allowing it to call the backend while Service B requires authentication This is the recommended approach C Use the Compute Engine default service account to run service A and service B Require authentication for service B Permit only the default service account to call the backend The Compute Engine default service account often has broad permissions (eg, editor role in its project) Using it violates the principle of least privilege and is generally discouraged for production applications due to the potential for excessive permissions D Create three separate service accounts Grant one service account the permissions to execute service A Grant the second service account the permissions to run service B Grant the third service account the permissions to communicate between both services A and B Require authentication for service B Call the back-end by authenticating with a service account key for the third service account This introduces unnecessary complexity with a third service account just for communication More critically, using a service account key for authentication is generally discouraged in Cloud Run environments where ADC (Application Default Credentials) can be used, as managing keys securely becomes an operational overhead and security risk Cloud Run services automatically use their attached service accounts for authentication when making calls to other Google Cloud services, including other Cloud Run services Therefore, option B is the best solution, adhering to the principle of least privilege and Google Cloud best practices for Cloud Run service-to-service authentication

by Elaine at Oct 06, 2026, 04:30 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10