An organization runs an enterprise application on Google Kubernetes Engine (GKE) in `project-app-prod`. The application needs to read objects from a Cloud Storage bucket located in a separate project, `project-data-shared`. Security policies strictly mandate adherence to the principle of least privilege and prohibit creating or downloading long-lived service account private keys (`.json` key files). Which of the following configuration steps must you perform to grant the application keyless cross-project access securely? (Select TWO.)
- Grant the predefined Cloud Storage Object Viewer role (`roles/storage.objectViewer`) to the Google Service Account directly on the target Cloud Storage bucket in `project-data-shared`.Cevap
- Bind the Kubernetes Service Account (KSA) to the Google Service Account (GSA) by granting the `roles/iam.workloadIdentityUser` role on the GSA to the KSA principal member.Cevap
- CCreate and export a JSON private key file for the Google Service Account, mounting it as a secret inside the GKE pod container environment.
- DGrant the primitive Owner role (`roles/owner`) to the Google Service Account at the `project-data-shared` project level to ensure full permission inheritance across all buckets.
- EEnable the Google Kubernetes Engine API in `project-data-shared` instead of `project-app-prod` so that cross-project identity token exchange can be processed.
Cevap
To securely enable cross-project access without static credentials, you must grant the Google Service Account the predefined Cloud Storage Object Viewer role (`roles/storage.objectViewer`) on the target bucket in `project-data-shared`, and bind the Kubernetes Service Account to the Google Service Account using the `roles/iam.workloadIdentityUser` role.
The combination of granting the `roles/iam.workloadIdentityUser` role on the Google Service Account to the Kubernetes Service Account and assigning `roles/storage.objectViewer` directly on the destination storage bucket establishes a secure, keyless cross-project authentication path adhering strictly to least privilege.
Adım Adım Çözüm
Anahtar Kavram
Cross-Project Service Account Management and Workload Identity