Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Security Engineer practice bank has 1,343 more like it. Try 10 free: instant score, no account.
A financial enterprise is hardening its Compute Engine infrastructure in Google Cloud. Security auditors found that developers have excessive privileges that allow them to view and modify sensitive custom instance metadata keys and deploy instances using privileged workload identities.
The security engineer must implement least-privilege access controls with the following requirements:
iam.serviceAccounts.actAs).Which configuration should the security engineer implement?
roles/compute.securityAdmin on the project, assign iam.serviceAccounts.actAs directly to developers on the project root, and disable the metadata server via firewall rules.This option grants developers the Security Admin role to manage firewall rules and SSL certificates, grants project-wide service account impersonation (actAs), and attempts to block instance metadata access via VPC firewall rules.
iam.serviceAccounts.actAs at the project level allows developers to impersonate and attach any service account across the entire project.roles/compute.securityAdmin focuses on security and network policies rather than instance troubleshooting.169.254.169.254 / metadata.google.internal), as metadata communication occurs over a local link that bypasses VPC egress firewall inspection.actAs permissions create substantial security risks and violate least privilege.The primary goal was to grant network security engineers permissions to manage VPC firewalls and Cloud Armor security policies across the project.
roles/compute.viewer combined with roles/iam.serviceAccountAdmin on the service account, and enforce access tokens with https://www.googleapis.com/auth/devstorage.read_only scope.This configuration grants developers the read-only Compute Viewer role alongside full administrative control over service account lifecycles (roles/iam.serviceAccountAdmin), while restricting the VM's OAuth scope exclusively to Cloud Storage read operations.
roles/iam.serviceAccountAdmin allows developers to create, delete, and manage IAM service accounts and keys, which exceeds the requirement to only inspect metadata.devstorage.read_only limits the instance exclusively to Cloud Storage reads, breaking workloads that require access to other Google Cloud APIs such as BigQuery, Monitoring, or Secret Manager.cloud-platform and managing access strictly through IAM role assignments.serviceAccountAdmin) to application developers.Developers were responsible for managing the lifecycle, keys, and IAM policies of service accounts rather than merely viewing instance metadata.
compute.instances.get on the VM instances, do not grant roles/iam.serviceAccountUser, and set the https://www.googleapis.com/auth/cloud-platform access scope on instances while restricting workload permissions strictly via IAM roles on the attached service account.This solution implements granular Identity and Access Management (IAM) permissions for administrators and developers outside the virtual machine while applying Google Cloud best practices for workload identities and API access scopes on Compute Engine instances.
compute.instances.get permission allows principals to retrieve instance metadata and configuration properties via the Google Cloud CLI, Console, or REST API without granting write permissions.roles/iam.serviceAccountUser role (which grants iam.serviceAccounts.actAs) and omitting compute.instances.setMetadata, developers cannot alter metadata scripts or launch/modify resources acting as the service account.https://www.googleapis.com/auth/cloud-platform access scope on VM instances delegates all authorization enforcement directly to IAM roles assigned to the user-managed service account, avoiding restrictive and inflexible legacy OAuth scope configurations.iam.serviceAccounts.actAs prevents unauthorized users from leveraging service account permissions bound to the VM.cloud-platform scope ensures IAM allow policies remain the single source of truth for application resource access.This approach aligns with Google Cloud architecture best practices by isolating metadata read operations from write/execution operations and centralizing application permission management in IAM rather than relying on double-filtering access scopes.
roles/compute.instanceAdmin.v1 and roles/iam.serviceAccountUser roles at the project level, and configure VM instances with the restricted https://www.googleapis.com/auth/compute.readonly access scope.This configuration grants developers full administrative control over Compute Engine instances (roles/compute.instanceAdmin.v1) and enables them to act as the attached service accounts (roles/iam.serviceAccountUser), while limiting the VM's access token scope to Compute Engine read operations.
roles/compute.instanceAdmin.v1 includes permissions such as compute.instances.setMetadata, which allows developers to overwrite custom metadata and startup scripts.roles/iam.serviceAccountUser explicitly provides the iam.serviceAccounts.actAs permission, allowing developers to attach privileged service accounts to arbitrary instances.cloud-platform scope combined with role-based IAM policies.Developers were full cloud operations administrators who needed permission to create, modify, and delete instances, attach arbitrary service accounts, and manage instance lifecycles across the project.
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 Validated