You are deploying a custom web application on a Compute Engine instance that needs to fetch static files from Cloud Storage and record application logs in Cloud Logging. Following Google Cloud security best practices for service account creation and management, which TWO steps should you take to grant the required permissions? (Select TWO)
- Provision a dedicated service account using the gcloud iam service-accounts create command.Cevap
- Grant the predefined roles roles/storage.objectViewer and roles/logging.logWriter directly to the service account.Cevap
- CGenerate a private JSON key file for the service account and upload it to the virtual machine local disk for application authentication.
- DGrant the primitive Editor role to the service account at the project level to simplify permission management.
- EEnable the Cloud Storage API at the Google Cloud organization level rather than within the specific project hosting the application.
Cevap
Create a dedicated service account using gcloud CLI and assign least-privilege predefined roles (roles/storage.objectViewer and roles/logging.logWriter) to it.
The correct approach involves creating a dedicated custom service account and assigning specific predefined IAM roles (`roles/storage.objectViewer` and `roles/logging.logWriter`). Compute Engine instances automatically authenticate workloads using attached service accounts via the metadata server, eliminating the need to store sensitive private key files on disk.
Adım Adım Çözüm
Anahtar Kavram
Creating service accounts and assigning least-privilege predefined roles for workload authentication.
Tahmini Süre:1m 0s