Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization has a production Google Cloud project named prod-backend. A software developer, dev-lead@example.com, needs to deploy, configure, and manage Cloud Run services within this project.
Company security policy mandates strict adherence to the principle of least privilege in production environments, specifically requiring:
Which gcloud command should you run to grant the appropriate access?
The Editor role (roles/editor) is a basic (primitive) role that predates fine-grained IAM. It provides expansive modify access across virtually all Google Cloud services in the project, including Compute Engine, BigQuery, VPCs, and Cloud Storage.
Assigning roles/editor violates the core principle of least privilege and fails two explicit requirements: it grants permissions to thousands of non-Cloud Run resources and provides excessive permissions across the entire project. Best practices explicitly forbid granting basic roles in production environments when predefined roles are available.
The assignment were made in an isolated sandbox or testing project where rapid prototyping is required and establishing fine-grained access boundaries is not necessary.
The Cloud Run Viewer role (roles/run.viewer) is a read-only role designed for monitoring and inspecting Cloud Run resources, such as viewing services, configuration specifications, and job execution logs.
Although this role complies with security restrictions by preventing IAM changes and denying access to other services, it fails the primary business requirement. A user with roles/run.viewer has read-only access and cannot create, modify, deploy, or delete Cloud Run services.
run.services.create, run.services.update, or run.services.delete permissions.The developer only required read-only access to view logs, monitor service health, and inspect existing configurations without performing deployments or altering configurations.
The Cloud Run Admin role (roles/run.admin) is the complete administrative role for Cloud Run. It confers full control over all Cloud Run resources, including services, revisions, jobs, and access policies.
While this role allows the developer to deploy and manage services, it violates the constraint that developers must not be allowed to modify access control policies. Cloud Run Admin explicitly includes run.services.setIamPolicy, which would allow the developer to grant access to other users, change service security settings, or make services publicly accessible.
roles/run.invoker to allUsers.The developer were a designated platform administrator responsible for configuring access policies, managing service-to-service authorization, and modifying IAM role bindings for the application.
The Cloud Run Developer role (roles/run.developer) is a specialized predefined IAM role tailored for software engineers. It grants the permissions required to deploy, update, manage, and delete Cloud Run services, jobs, and worker pools without conferring unnecessary administrative or cross-service privileges.
roles/run.developer role provides full operational permissions to create, update, and delete services, as well as inspect execution logs and revisions.getIamPolicy) but not modify (setIamPolicy) IAM policies, satisfying the requirement that the developer cannot alter security policies.roles/run.developer scopes access strictly to Cloud Run and does not grant access to Compute Engine, Cloud Storage, Cloud SQL, or other unrelated project services.gcloud projects add-iam-policy-binding with the proper user: identity prefix and role name to update the project's allow policy.
Granting roles/run.developer perfectly matches the stated requirements by giving the developer the tools needed to build and manage services without introducing security risks associated with broader roles such as Cloud Run Admin or project-wide Editor.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated