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 modernizing a cloud-native application consisting of microservices running on Google Kubernetes Engine (GKE) and an internal API deployed on Cloud Run. Currently, the GKE Pods mount exported service account JSON key files stored in Kubernetes Secrets to access Cloud Storage and invoke the private Cloud Run API. Another Cloud Run service also uses a mounted key file to call the internal Cloud Run API.
A security review requires you to enforce least-privileged access with the following constraints:
Which authentication architecture should you implement?
generateAccessToken DoManaged workload identities bind strongly attested cryptographic identities to Compute Engine and GKE workloads so they can establish mutual TLS (mTLS) connections with other workloads. Meanwhile, the generateAccessToken method of the IAM Credentials API mints short-lived OAuth 2.0 access tokens used to authorize calls to Google Cloud APIs.
identity endpoint or the generateIdToken API with the target service URL as the audience), not OAuth 2.0 access tokens from generateAccessToken.SERVICE_URL as the audience to prevent token replay against unintended services.Managed workload identities would be appropriate if your primary goal were establishing zero-trust mTLS connections directly between two GKE or Compute Engine workloads, while using Workload Identity Federation for GKE for Google Cloud API calls and generateIdToken (or metadata ID tokens) for Cloud Run invocations.
Workload Identity Federation for GKE and attached user-managed service accounts provide native, keyless authentication mechanisms for workloads running inside Google Cloud. Instead of distributing static private keys, these mechanisms rely on short-lived cryptographic tokens—OAuth 2.0 access tokens for Google Cloud APIs and OpenID Connect (OIDC) ID tokens for service-to-service invocations—issued dynamically by the platform's metadata server and the Security Token Service (STS).
PROJECT_ID.svc.id.goog workload identity pool) or via IAM service account impersonation.audience claim matches the target Cloud Run SERVICE_URL. Callers fetch this short-lived JWT (valid for approximately one hour) from the metadata server or the generateIdToken API and include it in the Authorization: Bearer (or X-Serverless-Authorization: Bearer) header.Compared to node-level service accounts or rotating JSON keys, combining Workload Identity Federation for GKE with attached user-managed service accounts and OIDC ID tokens completely removes long-lived credentials while enforcing strict per-service isolation across both Kubernetes and serverless environments.
A service account key is the private portion of a public/private RSA key pair downloaded as a JSON file. Applications can read this file (commonly via the GOOGLE_APPLICATION_CREDENTIALS environment variable) to sign assertions and authenticate as the corresponding IAM service account.
Using exported service account keys is only considered a fallback option for legacy external workloads running outside Google Cloud that cannot integrate with an external identity provider via Workload Identity Federation—and even then, it is strongly discouraged whenever keyless alternatives exist.
The Compute Engine default service account is an automatically created Google Cloud IAM service account assigned by default to resources like Compute Engine VMs, GKE node pools, and serverless services when no user-managed service account is specified. While it allows workloads to obtain short-lived tokens from the metadata server via Application Default Credentials (ADC) without key files, it is unsuitable for secure multi-service architectures.
audience parameter set to the target Cloud Run service URL.This approach would only be acceptable in an isolated, single-purpose sandbox or non-production prototype where strict multi-tenant isolation and least-privilege boundaries are not enforced. For production GKE and Cloud Run applications, you must use Workload Identity Federation for GKE and dedicated user-managed service accounts.
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