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
-
Question 1. Which type of IAM role should generally be avoided in production because it grants very broad permissions?
Show answer
Answer: C. Basic roles such as Owner and Editor
Basic roles span all services. Predefined and custom roles support least privilege.
-
Question 2. A developer needs to read objects in one bucket only. Which approach follows least privilege?
Show answer
Answer: A. Grant Storage Object Viewer on that bucket
Grant the narrowest predefined role at the narrowest resource level.
-
Question 3. When should a custom role be created?
Show answer
Answer: B. When no predefined role fits the permissions needed
Custom roles bundle specific permissions. They need maintenance as services add permissions.
-
Question 4. At which levels can a custom role be created?
Show answer
Answer: D. Organization or project
Custom roles are defined at the organization or project level, not at the folder level.
-
Question 5. Which command grants a user the Compute Viewer role on a project?
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.
-
Question 6. How can an engineer see which roles a project grants and to whom?
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.
-
Question 7. What is a service account?
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.
-
Question 8. A VM application must write to a bucket. What is the recommended way to give it access?
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.
-
Question 9. Why should service account keys be avoided when possible?
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.
-
Question 10. An on-premises application must call Google Cloud APIs without a service account key. What should be used?
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.
-
Question 11. How should GKE workloads authenticate to Google Cloud APIs?
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.
-
Question 12. Which role lets a user attach a service account to a VM or deploy code that runs as it?
Show answer
Answer: B. Service Account User
Service Account User allows acting as the service account, so grant it carefully.
-
Question 13. An administrator wants to run gcloud commands temporarily as a service account without a key. What should they use?
Show answer
Answer: C. Service account impersonation with --impersonate-service-account
Impersonation needs the Service Account Token Creator role and produces short-lived tokens.
-
Question 14. What are access scopes on Compute Engine VMs?
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.
-
Question 15. Which service stores API keys and database passwords with versioning and IAM-controlled access?
Show answer
Answer: B. Secret Manager
Secret Manager stores secrets securely, supports rotation, and audits access.
-
Question 16. A company must control and rotate the keys that encrypt its Cloud Storage data. What should it use?
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.
-
Question 17. Is data in Google Cloud encrypted at rest by default?
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.
-
Question 18. Which feature controls access to web applications based on user identity and context, without a VPN?
Show answer
Answer: D. Identity-Aware Proxy (IAP)
IAP verifies identity and context before allowing access to apps behind a load balancer or VMs.
-
Question 19. Which service creates a perimeter to prevent data exfiltration from services such as BigQuery and Cloud Storage?
Show answer
Answer: B. VPC Service Controls
VPC Service Controls restrict API access to services from outside a defined perimeter, even with valid credentials.
-
Question 20. Which service protects an internet-facing load balancer from DDoS and common web attacks?
Show answer
Answer: D. Google Cloud Armor
Cloud Armor provides WAF rules and DDoS protection for external load balancers.
-
Question 21. How can someone without a Google account download a private object for one hour?
Show answer
Answer: C. Generate a signed URL that expires after one hour
Signed URLs grant time-limited access to a specific object.
-
Question 22. What does uniform bucket-level access do?
Show answer
Answer: C. Disables object ACLs so access is controlled only by IAM
Uniform access simplifies permissions and is recommended for most buckets.
-
Question 23. Which IAM feature grants a role only until a certain date or only for resources with a specific name prefix?
Show answer
Answer: A. IAM Conditions
Conditions add attribute-based logic, such as time or resource name, to role bindings.
-
Question 24. What do IAM deny policies do?
Show answer
Answer: C. Block specific permissions for principals regardless of allow policies
Deny policies are checked before allow policies, providing guardrails.
-
Question 25. Which tool suggests removing permissions that a principal hasn't used in 90 days?
Show answer
Answer: A. The IAM role recommender
Role recommendations help reduce excess permissions to support least privilege.
-
Question 26. Which statement about the default Compute Engine service account is correct?
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.
-
Question 27. A contractor must be able to view resources but not change them in one project. Which role should they get?
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.
-
Question 28. Where can security teams see misconfigurations, vulnerabilities, and threats across projects?
Show answer
Answer: D. Security Command Center
Security Command Center provides security posture findings and threat detection.
-
Question 29. Which role lets a user manage IAM policies on a project without broader resource permissions?
Show answer
Answer: D. Project IAM Admin
Project IAM Admin can set IAM policies on the project. Editor can't manage IAM.
-
Question 30. Which permission allows a principal to create keys for a service account?
Show answer
Answer: B. iam.serviceAccountKeys.create
Restrict key creation tightly, or block it with an organization policy.
-
Question 31. An auditor needs read access to IAM policies and security settings without modifying anything. Which role fits?
Show answer
Answer: B. Security Reviewer
Security Reviewer grants list and get permissions on security-related resources.
-
Question 32. A web application running on Cloud Run should be callable only by authenticated users of one service. What should be configured?
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.
-
Question 33. Which Cloud KMS key operation happens automatically when rotation is configured?
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.
-
Question 34. What happens to data encrypted with a CMEK if the key is disabled?
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.
-
Question 35. How can a team audit who accessed a secret in Secret Manager?
Show answer
Answer: A. Enable Data Access audit logs for Secret Manager
Data Access logs record secret access operations.
-
Question 36. Which principal type in an IAM binding represents everyone on the internet?
Show answer
Answer: A. allUsers
Granting roles to allUsers makes resources public. Avoid it unless the resource is meant to be public.
-
Question 37. How should a company give its developers temporary elevated access to production?
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.
-
Question 38. Which statement about IAM allow policies is correct?
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.
-
Question 39. Which feature lets VMs in a subnet reach Google APIs using internal IPs while blocking public endpoints for sensitive services?
Show answer
Answer: D. Private Google Access with VPC Service Controls
Private Google Access provides internal routing, and VPC Service Controls restrict data movement.
-
Question 40. A service account's key has leaked. What should be done FIRST?
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.