Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A developer needs to run and test an application on a local workstation. The application requires specific Google Cloud permissions that are granted to a dedicated service account. The organization strictly enforces a security policy that prohibits downloading, storing, or managing persistent service account private key files (.json) on developer machines to prevent credential leakage.
Which approach should you implement to allow the developer to test the application securely?
roles/iam.serviceAccountTokenCreator) on the service account and configure the application to use service account impersonation.Service account impersonation is a keyless authentication mechanism in Google Cloud that allows authorized principals—such as user accounts or other service accounts—to temporarily assume the identity and IAM privileges of a target service account. Instead of relying on static, downloadable RSA private key pairs (often distributed as JSON files), impersonation generates short-lived OAuth 2.0 access tokens or OpenID Connect (OIDC) identity tokens via Google Cloud APIs. Granting the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator), which includes the iam.serviceAccounts.getAccessToken permission, grants a user the ability to generate short-lived credentials for that specific service account.
.json) on their local workstation, fully complying with the organizational policy prohibiting persistent keys.roles/iam.serviceAccountTokenCreator role can be bound directly to the specific service account resource rather than at the project or folder level, restricting the developer's ability to impersonate only the designated identity.gcloud) and Application Default Credentials (ADC) via impersonation flags and configuration properties.Service account impersonation is the recommended Google Cloud architectural best practice for local testing when service account permissions are required. It satisfies operational requirements without generating user-managed keys or over-granting direct project-level IAM privileges to the developer's personal account.
roles/editor) at the project level so their user account has broad permissions to perform the required actions directly.The Editor role (roles/editor) is a legacy primitive IAM role that provides broad write and modify permissions across almost all Google Cloud services in a project. It allows a principal to create, modify, and delete resources such as Compute Engine instances, Cloud Storage buckets, and Cloud SQL databases.
This option would be suitable only in early proof-of-concept, sandbox environments where granular security boundaries and least privilege are not required, and a single developer needs unrestricted administrative control to experiment with provisioning diverse Google Cloud resources.
Using primitive roles like Editor or Owner is discouraged in production-aligned development workflows. Predefined, service-specific IAM roles or custom roles must always be preferred over basic roles to prevent unintentional privilege escalation.
A user-managed service account key is an RSA private key pair generated by Google Cloud IAM and downloaded as an unencrypted JSON file to authenticate non-cloud environments. Administrators can define an expiry time to limit the key's validity period, after which Google Cloud automatically rejects authentication requests using that key.
.json file, creating an immediate attack vector.This option would be appropriate when connecting legacy third-party software running in a non-production on-premises environment that strictly requires a file-based service account key and cannot support short-lived impersonation or Workload Identity Federation.
While configuring expiration times on service account keys is a recommended defense-in-depth measure when physical keys are unavoidable, it does not replace keyless authentication strategies such as service account impersonation.
Secret Manager is a fully managed Google Cloud service designed to securely store, manage, and audit sensitive data such as API keys, database passwords, certificates, and arbitrary credentials at rest and in transit. The Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) allows principals to retrieve secret payloads.
Storing credentials in Secret Manager would be appropriate for external, third-party credentials—such as an external SaaS API token, third-party database connection string, or external TLS certificate—that applications need to consume dynamically at runtime.
Google Cloud documentation explicitly warns against storing service account keys in Secret Manager. Because accessing the secret requires an authenticated identity, teams should leverage that existing identity directly via service account impersonation or Workload Identity Federation instead.
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