Google Cloud Professional Cloud Architect · 20% practice allocation

Google Cloud Professional Cloud Architect: Design for security and compliance Practice Questions

5 free sample questions from the Design for security and compliance domain, with answers and explanations. The full Professional Cloud Architect bank has 251 questions across 6 domains. Questions are scenario-based and written from the official Google Cloud exam guide.

1.

An enterprise is building a data pipeline on Google Cloud that will process GDPR-regulated personal data of EU residents. The data must never be stored or processed outside the European Union. The architect needs to ensure this requirement is enforced at the infrastructure level, not just by policy documentation. Select TWO controls that should be implemented to enforce data residency. (Choose 2)

  • A. Apply a Cloud Armor security policy to block HTTP requests from non-EU geolocations.
  • B. Use Cloud DLP to scan all data stored in BigQuery and alert when non-EU data patterns are detected.
  • C. Apply the constraints/gcp.resourceLocations organization policy to restrict resource creation to EU regions only.✓ Correct
  • D. Configure VPC Service Controls with an access level that blocks API calls originating from non-EU IP addresses.
  • E. Enable the Assured Workloads EU Regions and Support package for the relevant folder or project.✓ Correct
Explanation

constraints/gcp.resourceLocations is an Organization Policy constraint that prevents GCP resources from being created or replicated outside specified locations. Setting this to EU regions ensures no storage or compute resources are provisioned outside the EU at the infrastructure level. Assured Workloads for EU provides a managed compliance framework that enforces data residency through technical controls including resource location restrictions, personnel access restrictions, and compliance monitoring, making it a strong complementary control. VPC Service Controls with IP-based access levels controls who can access the perimeter, not where data is stored or processed — it does not prevent resource creation outside the EU. Cloud DLP detects sensitive data patterns but cannot enforce where data is stored or processed; it is a detective control, not a preventive one for residency. Cloud Armor geographic restrictions block HTTP traffic at the load balancer level but do not prevent backend resources from being deployed or replicating data to non-EU regions.

2.

An organization wants to prevent any user — including organization administrators — from creating service account keys in all projects across the entire Google Cloud organization. Which is the most effective and scalable way to enforce this?

  • A. Remove the roles/iam.serviceAccountKeyAdmin role from all users in every project
  • B. Apply the iam.disableServiceAccountKeyCreation organization policy constraint at the organization node✓ Correct
  • C. Create an IAM deny policy at the organization level that denies iam.serviceAccountKeys.create for all principals
  • D. Deploy a Cloud Functions trigger on Pub/Sub audit log events to automatically delete any newly created service account keys
Explanation

Organization policy constraints are the correct mechanism for blanket, organization-wide restrictions. The iam.disableServiceAccountKeyCreation boolean constraint, applied at the organization node, prevents service account key creation in all child folders and projects, regardless of IAM roles held by users — including org admins. It cannot be overridden by individual project owners.

A (IAM deny policy) is plausible but wrong — An IAM deny policy can restrict specific principals, but you would need to enumerate all principals or use a complex binding. More importantly, org policy constraints are the idiomatic, scalable tool for this type of blanket resource restriction.

C (Removing IAM roles) is wrong — You would need to audit and modify every project individually, it doesn't scale, and new users granted those roles in the future would bypass the control.

D (Cloud Functions reactive deletion) is wrong — This is a compensating control, not a preventive one. There is a window during which the key exists and could be used or exfiltrated.

3.

A startup is deploying a containerized application on Google Kubernetes Engine (GKE). The security team requires that only container images signed by the company's internal build pipeline are allowed to run in the production cluster. Which Google Cloud service should you configure to enforce this requirement?

  • A. Binary Authorization with an attestor tied to the internal build pipeline✓ Correct
  • B. Container Analysis with vulnerability scanning enabled on Artifact Registry
  • C. Cloud Armor security policies with custom WAF rules
  • D. Security Command Center with container threat detection activated
Explanation

Binary Authorization is the correct answer. It enforces deploy-time policies on GKE (and Cloud Run) that require container images to be attested — cryptographically signed — before they are allowed to run. You configure an attestor linked to your internal build pipeline (e.g., Cloud Build), and the policy blocks any unsigned or improperly signed image.

A (Cloud Armor) is wrong — Cloud Armor is a WAF/DDoS protection layer for HTTP(S) traffic; it has no concept of container image signing.

C (Container Analysis) is wrong — Container Analysis provides vulnerability scanning metadata but does not itself enforce deployment policies; it can feed into Binary Authorization but is not the enforcement mechanism.

D (Security Command Center) is wrong — SCC detects threats and misconfigurations after the fact; it does not gate deployments based on image signatures.

4.

A company's security team needs to grant a contractor temporary access to a specific Cloud Storage bucket only during business hours (09:00–17:00 UTC) on weekdays. The contractor should have no access outside those hours. Which IAM feature enables this time-based restriction?

  • A. IAM Workforce Identity Federation with an attribute-based access control (ABAC) policy
  • B. An organization policy constraint that restricts IAM bindings to business hours
  • C. A VPC Service Controls access level with a time-based condition applied to the contractor's identity
  • D. An IAM role binding with a condition using the request.time attribute scoped to the specific bucket✓ Correct
Explanation

IAM Conditions allow you to attach attribute-based logic to role bindings. The request.time attribute supports date/time expressions (using CEL — Common Expression Language), enabling you to restrict a binding so it is only effective during a specified time window (e.g., weekdays 09:00–17:00 UTC). The condition is scoped to the specific Cloud Storage bucket resource.

A (Workforce Identity Federation with ABAC) is wrong — Workforce Identity Federation manages external identity providers and ABAC maps identity attributes to roles, but it doesn't natively enforce time-of-day access windows at the binding level by itself.

C (VPC Service Controls access level) is wrong — VPC-SC access levels can include time conditions, but they apply to the entire service perimeter, not to individual IAM role bindings on a specific resource, and they require the contractor to be inside a perimeter.

D (Org policy constraint) is wrong — Organization policies enforce resource configuration constraints (e.g., allowed locations, key settings); they cannot restrict when IAM bindings are effective for specific users.

5.

A security engineer is reviewing the organization's service account usage. They discover that many Compute Engine VMs are using the default Compute Engine service account with the Editor role. The engineer wants to remediate this situation and establish best practices. Select TWO actions that best address the security risk. (Choose 2)

  • A. Add an IAM Condition to the Editor role binding on the default service account to restrict it to specific resource types.
  • B. Rotate the default Compute Engine service account's key every 30 days to reduce the blast radius of a compromise.
  • C. Create dedicated, minimally-privileged service accounts for each workload and reassign VMs to use them.✓ Correct
  • D. Delete the default Compute Engine service account from all projects to force teams to create new ones.
  • E. Disable the automatic granting of the Editor role to the default service account by setting the organization policy constraint constraints/iam.automaticIamGrantsForDefaultServiceAccounts.✓ Correct
Explanation

Creating dedicated, minimally-privileged service accounts for each workload is the primary best practice for service account security, as it limits the blast radius of any single compromise and makes permissions auditable. Setting constraints/iam.automaticIamGrantsForDefaultServiceAccounts prevents GCP from automatically assigning the Editor role to the default service account in new projects, which is a proactive org-wide control. Rotating the service account key does not reduce the scope of the Editor role and addresses a different risk (key leakage, not over-privilege). Deleting the default service account can break existing workloads and services without a proper migration plan; it is disruptive and not a best practice recommendation. Adding IAM Conditions to the Editor role is complex, error-prone, and does not eliminate the fundamental problem of overly broad permissions; creating a minimally-privileged role is always preferred.

Test yourself across every Professional Cloud Architect domain

The free Professional Cloud Architect practice test mixes about 20 questions weighted like the exam. The full 251-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Design for security and compliance study guide (Professional Cloud Architect) →

Other Professional Cloud Architect domains

← All Google Cloud Professional Cloud Architect study resources