Google Cloud Associate Cloud Engineer · Domain 4 of 4 · 20% of the exam

Google Cloud Associate Cloud Engineer Domain 4: Configuring Access and Security

40 free practice questions for Configuring Access and Security in the Google Cloud Certified Associate Cloud Engineer exam. Try each question first, then open "Show answer" for the correct option and explanation.

Configuring Access and Security practice questions

  1. Question 1. Which type of IAM role should generally be avoided in production because it grants very broad permissions?

    1. Predefined roles such as Storage Object Viewer
    2. Custom roles with specific permissions
    3. Basic roles such as Owner and Editor
    4. Service account user roles
    Show answer

    Answer: C. Basic roles such as Owner and Editor

    Basic roles span all services. Predefined and custom roles support least privilege.

  2. Question 2. A developer needs to read objects in one bucket only. Which approach follows least privilege?

    1. Grant Storage Object Viewer on that bucket
    2. Grant Editor on the project
    3. Grant Storage Admin on the project
    4. Grant Owner on the organization
    Show answer

    Answer: A. Grant Storage Object Viewer on that bucket

    Grant the narrowest predefined role at the narrowest resource level.

  3. Question 3. When should a custom role be created?

    1. Whenever a new employee joins the organization
    2. When no predefined role fits the permissions needed
    3. To grant broader access than the Owner role
    4. To replace service accounts for applications
    Show answer

    Answer: B. When no predefined role fits the permissions needed

    Custom roles bundle specific permissions. They need maintenance as services add permissions.

  4. Question 4. At which levels can a custom role be created?

    1. Folder or bucket
    2. Zone or region
    3. VM or disk
    4. Organization or project
    Show answer

    Answer: D. Organization or project

    Custom roles are defined at the organization or project level, not at the folder level.

  5. Question 5. Which command grants a user the Compute Viewer role on a project?

    1. gcloud iam roles grant roles/compute.viewer --project=my-project --member=user:[email protected]
    2. gcloud compute instances add-iam-policy-binding --member=user:[email protected] --role=roles/compute.viewer
    3. gcloud projects set-role my-project --member=user:[email protected] --role=roles/compute.viewer
    4. gcloud projects add-iam-policy-binding my-project --member=user:[email protected] --role=roles/compute.viewer
    Show answer

    Answer: D. gcloud projects add-iam-policy-binding my-project --member=user:[email protected] --role=roles/compute.viewer

    add-iam-policy-binding adds one member-role pair to the project's allow policy.

  6. Question 6. How can an engineer see which roles a project grants and to whom?

    1. gcloud projects get-iam-policy my-project
    2. gcloud iam roles list --project
    3. gcloud projects describe my-project --roles
    4. gcloud config get-value iam
    Show answer

    Answer: A. gcloud projects get-iam-policy my-project

    get-iam-policy returns the bindings of roles to members. Policy Analyzer can also answer who has access.

  7. Question 7. What is a service account?

    1. A billing account for a service
    2. An admin account shared by the operations team
    3. A group of users in Cloud Identity
    4. An identity used by applications and workloads rather than people
    Show answer

    Answer: D. An identity used by applications and workloads rather than people

    Service accounts let workloads authenticate to Google APIs with their own IAM permissions.

  8. Question 8. A VM application must write to a bucket. What is the recommended way to give it access?

    1. Store a user's password in the application code
    2. Download a service account key and copy it to the VM
    3. Attach a dedicated service account with the needed role to the VM
    4. Make the bucket public
    Show answer

    Answer: C. Attach a dedicated service account with the needed role to the VM

    Attached service accounts provide short-lived credentials through the metadata server, with no keys to manage.

  9. Question 9. Why should service account keys be avoided when possible?

    1. Keys cannot be used outside Google Cloud
    2. Keys are billed per API call
    3. Keys expire after one hour
    4. Long-lived keys can leak and be misused if not rotated
    Show answer

    Answer: D. Long-lived keys can leak and be misused if not rotated

    Leaked keys are a common cause of breaches. Use attached service accounts, impersonation, or workload identity federation.

  10. Question 10. An on-premises application must call Google Cloud APIs without a service account key. What should be used?

    1. Workload Identity Federation with the company's identity provider
    2. A shared user account with MFA disabled
    3. A public bucket for the application's data
    4. The default Compute Engine service account key
    Show answer

    Answer: A. Workload Identity Federation with the company's identity provider

    Workload Identity Federation exchanges external credentials, such as OIDC or AWS tokens, for short-lived Google credentials.

  11. Question 11. How should GKE workloads authenticate to Google Cloud APIs?

    1. Mounting a service account key as a Kubernetes Secret
    2. Using the node's default service account for all Pods
    3. Workload Identity Federation for GKE, mapping Kubernetes service accounts to IAM
    4. Using a user's OAuth token in each Pod
    Show answer

    Answer: C. Workload Identity Federation for GKE, mapping Kubernetes service accounts to IAM

    Workload Identity gives each workload its own identity without keys.

  12. Question 12. Which role lets a user attach a service account to a VM or deploy code that runs as it?

    1. Service Account Key Admin
    2. Service Account User
    3. Compute Viewer
    4. Security Reviewer
    Show answer

    Answer: B. Service Account User

    Service Account User allows acting as the service account, so grant it carefully.

  13. Question 13. An administrator wants to run gcloud commands temporarily as a service account without a key. What should they use?

    1. Download a key and activate it
    2. Add their own email to the service account
    3. Service account impersonation with --impersonate-service-account
    4. Change the project owner to the service account
    Show answer

    Answer: C. Service account impersonation with --impersonate-service-account

    Impersonation needs the Service Account Token Creator role and produces short-lived tokens.

  14. Question 14. What are access scopes on Compute Engine VMs?

    1. Firewall rules applied to the VM's network tags
    2. IAM roles granted to the users of the VM
    3. Quotas on the VM's network egress bandwidth
    4. A legacy limit on which APIs the VM can call
    Show answer

    Answer: D. A legacy limit on which APIs the VM can call

    Best practice is to use the cloud-platform scope and control access with IAM roles instead.

  15. Question 15. Which service stores API keys and database passwords with versioning and IAM-controlled access?

    1. Cloud KMS only
    2. Secret Manager
    3. Cloud Storage public buckets
    4. Instance metadata
    Show answer

    Answer: B. Secret Manager

    Secret Manager stores secrets securely, supports rotation, and audits access.

  16. Question 16. A company must control and rotate the keys that encrypt its Cloud Storage data. What should it use?

    1. Google default encryption with no changes
    2. Signed URLs for every object
    3. Object Versioning
    4. Customer-managed encryption keys (CMEK) in Cloud KMS
    Show answer

    Answer: D. Customer-managed encryption keys (CMEK) in Cloud KMS

    CMEK lets the customer manage key rotation and disable keys. Google still performs encryption.

  17. Question 17. Is data in Google Cloud encrypted at rest by default?

    1. No, encryption must be enabled per resource
    2. Only in Cloud Storage, not in databases
    3. Yes, all data is encrypted at rest with Google-managed keys
    4. Only for customers using CMEK
    Show answer

    Answer: C. Yes, all data is encrypted at rest with Google-managed keys

    Google encrypts all customer data at rest by default. CMEK and CSEK add customer control.

  18. Question 18. Which feature controls access to web applications based on user identity and context, without a VPN?

    1. Cloud NAT
    2. VPC peering
    3. Cloud DNS private zones
    4. Identity-Aware Proxy (IAP)
    Show answer

    Answer: D. Identity-Aware Proxy (IAP)

    IAP verifies identity and context before allowing access to apps behind a load balancer or VMs.

  19. Question 19. Which service creates a perimeter to prevent data exfiltration from services such as BigQuery and Cloud Storage?

    1. Firewall rules
    2. VPC Service Controls
    3. Cloud Armor
    4. IAM Conditions
    Show answer

    Answer: B. VPC Service Controls

    VPC Service Controls restrict API access to services from outside a defined perimeter, even with valid credentials.

  20. Question 20. Which service protects an internet-facing load balancer from DDoS and common web attacks?

    1. Cloud NAT
    2. Cloud Router
    3. Secret Manager
    4. Google Cloud Armor
    Show answer

    Answer: D. Google Cloud Armor

    Cloud Armor provides WAF rules and DDoS protection for external load balancers.

  21. Question 21. How can someone without a Google account download a private object for one hour?

    1. Make the bucket public for one hour
    2. Add allUsers as an object viewer
    3. Generate a signed URL that expires after one hour
    4. Share the service account key temporarily
    Show answer

    Answer: C. Generate a signed URL that expires after one hour

    Signed URLs grant time-limited access to a specific object.

  22. Question 22. What does uniform bucket-level access do?

    1. Encrypts all objects with the same key
    2. Makes all objects publicly readable
    3. Disables object ACLs so access is controlled only by IAM
    4. Applies the same storage class to all objects
    Show answer

    Answer: C. Disables object ACLs so access is controlled only by IAM

    Uniform access simplifies permissions and is recommended for most buckets.

  23. Question 23. Which IAM feature grants a role only until a certain date or only for resources with a specific name prefix?

    1. IAM Conditions
    2. Custom roles
    3. Basic roles
    4. Organization policy tags
    Show answer

    Answer: A. IAM Conditions

    Conditions add attribute-based logic, such as time or resource name, to role bindings.

  24. Question 24. What do IAM deny policies do?

    1. Grant permissions that override organization policies
    2. Remove users from Cloud Identity
    3. Block specific permissions for principals regardless of allow policies
    4. Delete unused service accounts
    Show answer

    Answer: C. Block specific permissions for principals regardless of allow policies

    Deny policies are checked before allow policies, providing guardrails.

  25. Question 25. Which tool suggests removing permissions that a principal hasn't used in 90 days?

    1. The IAM role recommender
    2. The VM rightsizing recommender
    3. Cloud Monitoring uptime checks
    4. Billing budget alerts
    Show answer

    Answer: A. The IAM role recommender

    Role recommendations help reduce excess permissions to support least privilege.

  26. Question 26. Which statement about the default Compute Engine service account is correct?

    1. It is often granted Editor by default, so dedicated service accounts are safer
    2. It has no permissions and cannot be used
    3. It is shared across all Google Cloud customers
    4. It cannot be replaced with another service account
    Show answer

    Answer: A. It is often granted Editor by default, so dedicated service accounts are safer

    Many organizations disable the automatic Editor grant with an organization policy and use least-privilege accounts.

  27. Question 27. A contractor must be able to view resources but not change them in one project. Which role should they get?

    1. Viewer (or a narrower predefined viewer role) on that project
    2. Editor on the project
    3. Owner on the project
    4. Organization Viewer on the organization
    Show answer

    Answer: A. Viewer (or a narrower predefined viewer role) on that project

    Viewer grants read-only access. Narrower predefined roles are even better where possible.

  28. Question 28. Where can security teams see misconfigurations, vulnerabilities, and threats across projects?

    1. Cloud Scheduler
    2. Artifact Registry
    3. Cloud Build
    4. Security Command Center
    Show answer

    Answer: D. Security Command Center

    Security Command Center provides security posture findings and threat detection.

  29. Question 29. Which role lets a user manage IAM policies on a project without broader resource permissions?

    1. Project Editor
    2. Compute Admin
    3. Storage Admin
    4. Project IAM Admin
    Show answer

    Answer: D. Project IAM Admin

    Project IAM Admin can set IAM policies on the project. Editor can't manage IAM.

  30. Question 30. Which permission allows a principal to create keys for a service account?

    1. storage.objects.create
    2. iam.serviceAccountKeys.create
    3. compute.instances.create
    4. resourcemanager.projects.get
    Show answer

    Answer: B. iam.serviceAccountKeys.create

    Restrict key creation tightly, or block it with an organization policy.

  31. Question 31. An auditor needs read access to IAM policies and security settings without modifying anything. Which role fits?

    1. Security Admin
    2. Security Reviewer
    3. Owner
    4. IAM Admin
    Show answer

    Answer: B. Security Reviewer

    Security Reviewer grants list and get permissions on security-related resources.

  32. Question 32. A web application running on Cloud Run should be callable only by authenticated users of one service. What should be configured?

    1. Allow unauthenticated invocations and hide the URL
    2. Require authentication and grant roles/run.invoker to that service's identity
    3. Use a firewall rule on the Cloud Run URL
    4. Deploy the service in a private region
    Show answer

    Answer: B. Require authentication and grant roles/run.invoker to that service's identity

    Cloud Run checks IAM for the invoker role when authentication is required.

  33. Question 33. Which Cloud KMS key operation happens automatically when rotation is configured?

    1. All existing data is re-encrypted immediately
    2. A new key version is created and becomes primary
    3. The old key versions are destroyed immediately
    4. The key is moved to another region
    Show answer

    Answer: B. A new key version is created and becomes primary

    Rotation creates a new primary version for new encryption. Old versions stay available to decrypt existing data.

  34. Question 34. What happens to data encrypted with a CMEK if the key is disabled?

    1. The data is automatically decrypted and stored
    2. The data can't be read until the key is re-enabled
    3. Google switches to a Google-managed key
    4. Nothing changes for data already written
    Show answer

    Answer: B. The data can't be read until the key is re-enabled

    Disabling or destroying a CMEK key makes the protected data unreadable, which is a powerful control.

  35. Question 35. How can a team audit who accessed a secret in Secret Manager?

    1. Enable Data Access audit logs for Secret Manager
    2. Check the secret's version list
    3. Review billing reports
    4. Use VPC Flow Logs
    Show answer

    Answer: A. Enable Data Access audit logs for Secret Manager

    Data Access logs record secret access operations.

  36. Question 36. Which principal type in an IAM binding represents everyone on the internet?

    1. allUsers
    2. allAuthenticatedUsers only with MFA
    3. domain:example.com
    4. group:[email protected]
    Show answer

    Answer: A. allUsers

    Granting roles to allUsers makes resources public. Avoid it unless the resource is meant to be public.

  37. Question 37. How should a company give its developers temporary elevated access to production?

    1. Grant them Owner permanently
    2. Share one admin account among all developers
    3. Use Privileged Access Manager or time-bound IAM Conditions
    4. Give them the service account key
    Show answer

    Answer: C. Use Privileged Access Manager or time-bound IAM Conditions

    Time-limited, just-in-time access reduces standing privilege and is audited.

  38. Question 38. Which statement about IAM allow policies is correct?

    1. A project allow policy can remove access granted at the folder
    2. The most restrictive binding always wins
    3. They are additive; there is no way to remove inherited access with another allow
    4. Only one role can be granted per user per project
    Show answer

    Answer: C. They are additive; there is no way to remove inherited access with another allow

    Allow policies combine. Use deny policies or restructure grants to restrict access.

  39. Question 39. Which feature lets VMs in a subnet reach Google APIs using internal IPs while blocking public endpoints for sensitive services?

    1. Cloud NAT with external IPs
    2. Public buckets with signed URLs
    3. A global external load balancer
    4. Private Google Access with VPC Service Controls
    Show answer

    Answer: D. Private Google Access with VPC Service Controls

    Private Google Access provides internal routing, and VPC Service Controls restrict data movement.

  40. Question 40. A service account's key has leaked. What should be done FIRST?

    1. Disable the key, then check audit logs for misuse
    2. Rename the service account to hide it
    3. Increase the project's API quota
    4. Add MFA to the service account's login
    Show answer

    Answer: A. Disable the key, then check audit logs for misuse

    Revoke the compromised credential immediately, then review logs for misuse.

Google Cloud is a trademark of Google LLC. These questions are original study material, not questions from the real exam.