An organization hosts a data-processing workload on a Compute Engine virtual machine instance located in GCP Project `proj-analytics`. The application requires read-only access to a Cloud Storage bucket situated in a separate project named `proj-data-warehouse`. According to Google Cloud security best practices for creating and managing service accounts, which of the following actions should the administrator perform to enable cross-project authorization securely? (Select TWO correct answers.)
- Create a user-managed service account in `proj-analytics` and attach it to the Compute Engine VM instance upon creation.Answer
- Grant the user-managed service account principal from `proj-analytics` the Storage Object Viewer (`roles/storage.objectViewer`) role on the specific Cloud Storage bucket in `proj-data-warehouse`.Answer
- CGenerate a static JSON service account key for a service account created in `proj-data-warehouse` and store the key file locally on the Compute Engine VM disk.
- DAssign the primitive Editor (`roles/editor`) role to the compute instance's service account at the `proj-data-warehouse` project level.
- EEnable the Google Cloud APIs in `proj-data-warehouse` only, assuming cross-project service account access bypasses API enablement in `proj-analytics`.
Answer
To establish secure cross-project authorization, the administrator must create a dedicated user-managed service account in the source project hosting the Compute Engine instance and grant that service account's email address the predefined Storage Object Viewer role on the bucket in the destination project.
Secure cross-project access in Google Cloud relies on creating a custom user-managed service account within the source project where the compute resource resides, attaching that service account to the VM instance, and granting its email address a minimal predefined role (such as Storage Object Viewer) directly on the target resource in the remote project.
Step-by-Step Solution
Key Concept
Cross-Project Service Account Access and Principle of Least Privilege