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.
Your company wants to improve its security posture by minimizing the risks associated with long-lived credentials. An internal audit revealed that developers frequently generate user-managed service account keys and download them to local workstations, increasing the risk of credential leakage and unauthorized privilege escalation. Your organization wants to establish a centralized guardrail that strictly blocks developers from generating any new user-managed service account keys across all existing and future projects.
Which action should you take to achieve this goal?
The Service Account User role (roles/iam.serviceAccountUser) grants a principal permission to attach a service account to a compute resource (such as a Compute Engine virtual machine or Cloud Run service) and run workloads under that service account's identity.
roles/iam.serviceAccountUser role does not control the creation or deletion of service account keys. Service account key creation is governed by key management permissions found in roles like Service Account Key Admin (roles/iam.serviceAccountKeyAdmin), Editor (roles/editor), or Owner (roles/owner).This approach would be appropriate if your objective was to prevent developers from attaching privileged service accounts to unvetted virtual machines or executing code under that service account's identity.
A common misconception is that all service account permissions stem from the Service Account User role. However, Google Cloud IAM maintains a clear separation between using a service account (actAs permissions) and administrating service account keys (iam.serviceAccountKeys.* permissions).
An Organization Policy provides centralized, programmatic control over an organization's cloud resources. Organization policy constraints allow cloud administrators to configure specific restrictions across the entire resource hierarchy (organization, folders, and projects). The constraints/iam.disableServiceAccountKeyCreation constraint specifically prevents users and automated processes from creating new user-managed service account keys.
gcloud), or Cloud APIs is rejected immediately.
orgpolicy.policy.set permission. Basic roles such as Owner (roles/owner) and Editor (roles/editor) do not have this permission, preventing project developers from bypassing the restriction.Enforcing the organization policy constraint is the most effective and administrative-friendly solution. Rather than attempting to micromanage permissions across hundreds of projects or reacting after keys are already generated and leaked, an organization policy establishes a hard prevention guardrail at the foundational resource hierarchy level.
Google Cloud Secret Manager is a secure storage system for sensitive data such as API keys, database passwords, certificates, and configuration secrets. It encrypts secrets at rest and in transit, provides audit logging, and supports automated rotation workflows.
This answer would be appropriate if you needed to store and automatically rotate third-party API credentials, database connection strings, or external partner tokens that cannot leverage native Google Cloud IAM.
Best practices explicitly advise against storing user-managed service account keys in secret vaults like Secret Manager, Azure Key Vault, or AWS Secrets Manager when accessing Google Cloud services, as cloud-native authentication mechanisms provide superior security.
Key expiry allows administrators to set a maximum lifetime on newly generated service account keys (for example, hours, days, or weeks) so that they automatically become invalid after a specified time without requiring manual deletion.
This approach would be correct if the organization permitted the temporary use of service account keys for sandbox testing or third-party tools and wanted to ensure those newly generated keys would expire automatically after a project ended.
To effectively protect production workloads, Google recommends using keys that do not expire while managing their lifecycle via structured key rotation, or ideally eliminating user-managed keys altogether using Workload Identity Federation and IAM policies.
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