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 backend application runs on Cloud Run using an attached runtime service account (app-runtime-sa). You need to generate Cloud Storage V4 signed URLs so external users without Google accounts can download private objects for 15 minutes. Your solution must meet these requirements:
signer-sa) that holds the roles/storage.objectViewer role on the target bucket.Which IAM configuration allows your application to generate valid signed URLs?
In Google Cloud, a service account serves as the cryptographic signing identity for Cloud Storage signed URLs. Every service account has an internal Google-owned and managed RSA key pair whose private key is held securely in escrow and is never directly exposed. The Service Account Token Creator (roles/iam.serviceAccountTokenCreator) role allows a calling principal to impersonate a target service account to generate short-lived credentials and cryptographic signatures. Specifically, this role includes the iam.serviceAccounts.signBlob permission, which authorizes the caller to invoke the Service Account Credentials API's signBlob() method to sign arbitrary binary payloads—including the canonical string-to-sign used in a Cloud Storage V4 signed URL.
signer-sa): Because signer-sa holds roles/storage.objectViewer on the Cloud Storage bucket, Cloud Storage validates and honors read requests signed by signer-sa, granting external users 15-minute access without requiring Google identities.signBlob() uses Google-managed keys held in escrow, eliminating any need to create, download, or store user-managed private key files.roles/iam.serviceAccountTokenCreator directly on the signer-sa resource—rather than at the project level—restricts app-runtime-sa so it can only request signatures from signer-sa and cannot impersonate other service accounts.signBlob()), which is necessary for Cloud Storage URL signatures.Among Google Cloud IAM roles, Service Account Token Creator is the standard predefined role that provides iam.serviceAccounts.signBlob for keyless URL signing without violating organization policies against user-managed keys.
The Service Account Key Admin (roles/iam.serviceAccountKeyAdmin) role authorizes a principal to create, list, enable, disable, and delete user-managed service account keys (external RSA private key pairs) through permissions such as iam.serviceAccountKeys.create.
signBlob: The private key in a Google-owned and managed key pair is always held in escrow and cannot be retrieved or exported, even by a Key Admin. Additionally, roles/iam.serviceAccountKeyAdmin does not include the iam.serviceAccounts.signBlob permission needed to sign payloads remotely via the Service Account Credentials API.iam.serviceAccountKeys.* permissions for managing external, long-lived key files.signBlob, signJwt, or getAccessToken).An external workload running outside Google Cloud could not use Workload Identity Federation or the Credentials API, no organization policy restricted key creation, and an administrator needed to provision and rotate user-managed key files.
Administrators sometimes assume that key management permissions allow an application to sign data using a service account's internal key. In practice, keyless signing relies exclusively on iam.serviceAccounts.signBlob via the Service Account Token Creator role.
The Service Account OpenID Connect Identity Token Creator (roles/iam.serviceAccountOpenIdTokenCreator) role is a specialized, narrowly scoped role that grants the iam.serviceAccounts.getOpenIdToken permission. Its sole purpose is to allow a principal to generate short-lived OpenID Connect (OIDC) ID tokens on behalf of a service account.
iam.serviceAccounts.signBlob. An OIDC ID token is a JWT signed by the Google OIDC Provider (accounts.google.com) meant to verify identity in service-to-service HTTP requests, not to sign Cloud Storage URL query parameters.signBlob permission: Because this role only grants iam.serviceAccounts.getOpenIdToken, app-runtime-sa lacks authorization to call signBlob() on signer-sa.generateIdToken() to retrieve 1-hour OIDC JWTs signed by the Google JSON Web Key Set (JWKS).iam.serviceAccounts.signBlob, iam.serviceAccounts.signJwt, or iam.serviceAccounts.getAccessToken.The application needed app-runtime-sa to mint an OIDC ID token representing signer-sa in order to authenticate an HTTP call to an identity-verifying endpoint such as another private Cloud Run service.
While the broader Service Account Token Creator role includes getOpenIdToken as one of its permissions, Google Cloud offers the OIDC Identity Token Creator role specifically for workloads that need only ID tokens and not blob signing.
The Service Account User (roles/iam.serviceAccountUser) role grants the iam.serviceAccounts.actAs permission. This permission authorizes a principal to attach a service account to a Google Cloud resource—such as a Compute Engine VM instance, App Engine application, or Cloud Run service—when creating or configuring that resource so the workload can run under that identity.
roles/iam.serviceAccountUser does not include iam.serviceAccounts.signBlob, which is strictly required to call the Service Account Credentials API's signBlob() method for generating a Cloud Storage signature.iam.serviceAccounts.actAs does not allow a caller to dynamically request OAuth 2.0 access tokens, JWTs, or signed binary blobs for another service account at runtime. If app-runtime-sa attempts to sign a URL using signer-sa with only this role, the API request fails with a permission error.iam.serviceAccounts.actAs, iam.serviceAccounts.get, iam.serviceAccounts.list, and basic project read permissions.iamcredentials.googleapis.com signing endpoints.The scenario asked which role a developer or CI/CD pipeline needs in order to deploy a Cloud Run service or Compute Engine VM with a specific service account attached to it.
Confusing Service Account User (actAs) with Service Account Token Creator (signBlob) is a common misconception. Attaching an identity to a compute resource requires actAs, whereas signing payloads via the Service Account Credentials API requires iam.serviceAccounts.signBlob.
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