CLOUD-SECURITY-ENGINEER practice question 14 of 35

You plan to deploy your cloud infrastructure using a CI/CD cluster hosted on Compute Engine. You want to minimize the risk of its credentials being stolen by a third party. What should you do?

Full set: 317 questions
Answer options
A: Create a dedicated Cloud Identity user account for the cluster. Use a strong self-hosted vault solution to store the user's temporary credentials.
B: Create a dedicated Cloud Identity user account for the cluster. Enable the constraints/iam.disableServiceAccountCreation organization policy at the project level.
C: Create a custom service account for the cluster Enable the constraints/iam.disableServiceAccountKeyCreation organization policy at the project level. Correct answer
D: Create a custom service account for the cluster Enable the constraints/iam.allowServiceAccountCredentialLifetimeExtension organization policy at the project level.
Correct Answer:
C. Create a custom service account for the cluster Enable the constraints/iam.disableServiceAccountKeyCreation organization policy at the project level.
Explanation

The best practice for applications running on Compute Engine is to use a service account, not a user account. Service accounts are designed for non-human workloads. To minimize the risk of credential theft, you should prevent the creation of long-lived, user-managed service account keys. The constraints/iam.disableServiceAccountKeyCreation organization policy enforces this at scale. The CI/CD cluster can then use the more secure, automatically rotated credentials provided by the instance metadata server, eliminating the risk of static keys being leaked.

Why Incorrect

A. User accounts are for humans, not applications. Managing credentials in a self-hosted vault adds unnecessary complexity and risk compared to using attached service accounts.
B. A user account is the wrong identity type for a workload. Disabling service account creation prevents new service accounts but doesn't secure the one in use.
D. This policy relates to extending the lifetime of short-lived credentials, which is not the primary method for preventing the theft of long-lived static keys.

References

1. Google Cloud Documentation

"Best practices for working with service accounts"

Section: "Use service accounts for applications"

and Section: "Avoid using service account keys". It states

"We strongly recommend that you avoid using service account keys when possible... To further reduce risk

you can disable service account key creation".

2. Google Cloud Documentation

"Organization policy constraints"

Section: "IAM constraints". The description for iam.disableServiceAccountKeyCreation states it "Disables creation of external service account keys."

3. Google Cloud Documentation

"Authenticating workloads"

Section: "Best practices for workload authentication". It recommends using attached service accounts for workloads on Compute Engine.

Scroll to Top