A cloud engineer needs to grant an external auditor access to inspect IAM policies for a specific Google Cloud project using the gcloud command-line interface. What is the correct sequence of command steps to authenticate, set the project context, assign the least-privilege predefined IAM role, and verify the assignment?
- 1Authenticate the gcloud CLI session by running 'gcloud auth login'.
- 2Set the active project context by running 'gcloud config set project PROJECT_ID'.
- 3Assign the predefined role by executing 'gcloud projects add-iam-policy-binding PROJECT_ID --member="user:[email protected]" --role="roles/iam.securityReviewer"'.
- 4Confirm the updated policy binding by executing 'gcloud projects get-iam-policy PROJECT_ID'.
Cevap
The correct operational sequence begins with authenticating the session, selecting the target project configuration, applying the least-privilege IAM policy binding with gcloud projects add-iam-policy-binding, and finally inspecting the policy with gcloud projects get-iam-policy to verify access.
The workflow follows standard Google Cloud management practices: first establish user identity ('gcloud auth login'), target the appropriate resource scope ('gcloud config set project'), execute the security policy modification using least-privilege predefined roles ('gcloud projects add-iam-policy-binding'), and finally audit the change ('gcloud projects get-iam-policy').
Adım Adım Çözüm
Anahtar Kavram
Managing IAM Roles and Resource Access Permissions via gcloud CLI