A developer requests a service account JSON key file to authenticate an application running on a Compute Engine virtual machine instance to BigQuery. Following Google Cloud security best practices, which approach should you take to provide authentication for the application?
- Attach a custom service account with the necessary predefined BigQuery roles directly to the Compute Engine instance.Cevap
- BGenerate a new service account JSON key file and upload it to the Compute Engine instance's local file system.
- CGrant the primitive Owner role to the Compute Engine default service account and store its default key in the application configuration.
- DEnable the BigQuery API at the organization level and download the organization root service account credentials.
Cevap
Attach a custom service account with the necessary predefined BigQuery roles directly to the Compute Engine instance.
Attaching a custom service account directly to a Compute Engine instance allows applications to retrieve access tokens automatically via the internal metadata server. This eliminates the need to generate, store, or rotate service account JSON keys, adhering strictly to Google Cloud security best practices.
Adım Adım Çözüm
Anahtar Kavram
Service Account Attachment vs. Key File Export