
Answer-first summary for fast verification
Answer: Enable Workload Identity for GKE. Assign a Kubernetes service account to the application and configure that Kubernetes service account to act as an Identity and Access Management (IAM) service account. Grant the required roles to the IAM service account.
Option B is the correct answer because it implements Workload Identity, which is Google's recommended best practice for securely granting GKE workloads access to Google Cloud services. Workload Identity allows Kubernetes service accounts to impersonate IAM service accounts, providing fine-grained, short-lived credentials without exposing long-lived service account keys. This follows the principle of least privilege and eliminates the security risks associated with static service account keys. Option A is insecure as it uses the default Compute Engine service account, which typically has overly broad permissions. Option C is better than A but still grants permissions at the node level rather than the workload level, violating the principle of least privilege. Option D is explicitly discouraged by Google security best practices because it involves creating and managing service account keys, which are long-lived credentials that pose significant security risks if compromised.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your organization is migrating its primary web application from on-premises to Google Kubernetes Engine (GKE). You need to advise the development team on the security best practices for granting their applications access to Google Cloud services from within GKE. What should you tell them to do?
A
Configure the GKE nodes to use the default Compute Engine service account.
B
Enable Workload Identity for GKE. Assign a Kubernetes service account to the application and configure that Kubernetes service account to act as an Identity and Access Management (IAM) service account. Grant the required roles to the IAM service account.
C
Create a user-managed service account with only the roles required for the specific workload. Assign this service account to the GKE nodes.
D
Create an application-specific IAM service account and generate a user-managed service account key for it. Inject the key to the workload by storing it as a Kubernetes secret within the same namespace as the application.