Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team is developing a financial web application on Google Cloud with an App Engine frontend and private Cloud Run backend services fronted by API Gateway, deployed via Cloud Build. To harden endpoints and integrate security into your development lifecycle, you must meet these requirements:
Which set of security controls should you implement?
IAP-secured Web App User role, grant the API Gateway service account roles/run.invoker on each Cloud Run service, enforce constraints/iam.automaticIamGrantsForDefaultServiceAccounts, and trigger Web Security Scanner via its API in Cloud Build.This strategy combines zero-trust application access, least-privilege IAM, preventive organization guardrails, and shift-left dynamic vulnerability scanning across the software delivery lifecycle. Rather than relying solely on network perimeters, each layer independently verifies identity, limits permissions, and validates application behavior before production release.
IAP-secured Web App User role ensures every request is authenticated and authorized by identity and context before reaching the application.roles/run.invoker (run.routes.invoke) at the individual service level restricts invocation strictly to the gateway for only those specific services.constraints/iam.automaticIamGrantsForDefaultServiceAccounts organization policy constraint stops Google Cloud from automatically assigning the overly permissive roles/editor role to newly created default service accounts.Unlike network-only controls, container-only image scanners, or broad project-level IAM roles, this combination addresses every layer—user access, gateway-to-backend authorization, identity hygiene, and runtime web application security—with minimal operational overhead.
roles/run.admin at the project level, enforce Binary Authorization attestations in Cloud Build to block XSS vulnerabilities, and rotate default service account keys every 90 days.This approach relies on Google Cloud Armor for edge filtering, project-wide administrative IAM permissions for API Gateway, Binary Authorization for deployment policy enforcement, and periodic key rotation for default service accounts.
roles/run.admin at the project level allows the API Gateway service account to create, update, and delete any Cloud Run service in the project, far exceeding the roles/run.invoker permission needed on specific services.roles/editor permissions granted automatically to default service accounts; moreover, App Engine and Cloud Run rely on managed identities rather than downloaded keys.The primary goal were to mitigate DDoS attacks at the edge with Cloud Armor and enforce signed container provenance for GKE or Cloud Run deployments using Binary Authorization.
Combining Binary Authorization with Web Security Scanner works well as a shift-left pattern: the scanner tests the staging app, and a passing result can be used to sign an attestation before production deployment.
roles/viewer role, grant allAuthenticatedUsers the roles/run.invoker role on Cloud Run, enforce constraints/iam.disableServiceAccountKeyCreation, and enable Artifact Analysis vulnerability scanning in Artifact Registry during Cloud Build.This configuration mixes Identity-Aware Proxy (IAP) with basic IAM project roles, public authenticated invocation on Cloud Run, key-creation restrictions, and Artifact Analysis container scanning. While each tool serves a legitimate Google Cloud security purpose, several controls are misapplied for these requirements.
roles/viewer provides read-only access to Google Cloud project resources, not HTTPS access through an IAP-protected App Engine application. Users must hold the IAP-secured Web App User role to pass the proxy.roles/run.invoker to allAuthenticatedUsers permits any authenticated Google account on the internet to call the Cloud Run endpoints directly, bypassing API Gateway and violating least privilege.constraints/iam.disableServiceAccountKeyCreation constraint prevents downloading long-lived JSON keys, but it does not stop Google Cloud from automatically granting roles/editor to default service accounts.allAuthenticatedUsers is global: It includes every Google account and service account worldwide, not just users within your organization.constraints/iam.automaticIamGrantsForDefaultServiceAccounts is specifically required to block automatic Editor grants.The goal were solely to block service account key downloads and scan container images for known OS package vulnerabilities before deployment, without securing IAP web access, restricting Cloud Run to API Gateway, or scanning for runtime web flaws.
In a mature CI/CD pipeline, Artifact Analysis and Web Security Scanner complement each other—one checks build artifacts for vulnerable packages while the other tests deployed web endpoints for application-layer flaws.
This design centers on network-perimeter controls—VPC Service Controls, Cloud VPN, VPC ingress restrictions, and Cloud Intrusion Detection System (Cloud IDS)—alongside custom IAM roles for default service accounts.
--allow-unauthenticated) removes service-level authorization checks, violating defense in depth and failing to enforce least-privilege IAM between API Gateway and Cloud Run.roles/editor unless constraints/iam.automaticIamGrantsForDefaultServiceAccounts is enforced.The objective were to prevent API data exfiltration across Google Cloud services using VPC Service Controls and inspect VPC network flows for network-level threats with Cloud IDS.
Zero-trust architectures pair resource-centric perimeters like VPC Service Controls with application-layer proxies like IAP and service-level IAM so that neither network compromise nor missing authentication exposes backend data.
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