Professional Cloud Architect free question 6 / 10 · Domain 3: Designing for security and compliance
You want operations staff to work with a privileged service account only during incident response. For auditing, the condition is that the logs must later show which staff member acted as that service account. Which method follows the IAM page that explains how service accounts are used?
- Hand out a service account key only during the incident. The identity of the person who used it is also kept in most audit logs
- Let staff switch to the service account in the console only during the incident. The identity of the person who switched is also kept in most audit logs
- Let staff SSH into a VM that uses that service account only during the incident. The identity of the person who acted is kept in most audit logs
- Let staff obtain short-lived credentials by impersonation only during the incident. The identity of the impersonator is also kept in most audit logs
Show the answer and explanation
Answer: D
Why this is correct
The page explains that in impersonation, an authenticated principal obtains a token for the service account and authenticates as the service account. It lists temporarily granting powerful access as a use case, and says the short-lived credentials expire within hours. When resources are accessed through impersonation, most audit logs record both the identity of the person and the identity of the impersonated service account.
Why the other options are wrong
"Hand out a service account key only during the incident. The identity of the person who used it is also kept in most audit logs" … The page says that when you authenticate with a service account key, the only identity involved is the service account, and the audit log records only the service account’s identity. You cannot tell from the records who used the key.
"Let staff SSH into a VM that uses that service account only during the incident. The identity of the person who acted is kept in most audit logs" … When code runs as the service account attached to a VM, the only identity involved is also that service account, and the identity of the person who ran code on the VM is not in the audit log. The page says that using privileged resources this way, such as an SSH session, creates privilege-escalation and non-repudiation risks.
"Let staff switch to the service account in the console only during the incident. The identity of the person who switched is also kept in most audit logs" … The page says that in the Google Cloud console you always authenticate with your own user credentials, and that you cannot impersonate a service account to access resources. There is no way to switch in the console.
Related settings
Impersonation requires the iam.serviceAccounts.getAccessToken permission, which is included in roles such as Service Account Token Creator. With the gcloud flag --impersonate-service-account, short-lived credentials are used to run the command. It can also be used to test whether a combination of permissions is enough for the work, or to develop locally an application that can only run as a service account.