Description:
It is recommended that Cloud Audit Logging is configured to track all admin activities and read, write access to user data.
Rationale:
Cloud Audit Logging maintains two audit logs for each project, folder, and organization: Admin Activity and Data Access.
Admin Activity logs contain log entries for API calls or other administrative actions that modify the configuration or metadata of resources. Admin Activity audit logs are enabled for all services and cannot be configured.
Data Access audit logs record API calls that create, modify, or read user-provided data. These are disabled by default and should be enabled.
There are three kinds of Data Access audit log information:
It is recommended to have an effective default audit config configured in such a way that:
logtype is set to DATA_READ (to log user activity tracking) and DATA_WRITES (to log changes/tampering to user data).
audit config is enabled for all the services supported by the Data Access audit logs feature.
Logs should be captured for all users, i.e., there are no exempted users in any of the audit config sections. This will ensure overriding the audit config will not contradict the requirement.
There is no charge for Admin Activity audit logs.
Enabling the Data Access audit logs might result in your project being charged for the additional logs usage.
From Google Cloud Console
From Google Cloud CLI
gcloud projects get-iam-policy PROJECT_ID > /tmp/project_policy.yaml
Alternatively, the policy can be set at the organization or folder level. If setting the policy at the organization level, it is not necessary to also set it for each folder or project.
gcloud organizations get-iam-policy ORGANIZATION_ID > /tmp/org_policy.yaml
gcloud resource-manager folders get-iam-policy FOLDER_ID > /tmp/folder_policy.yaml
auditConfigs:
Note: 'exemptedMembers:' is not set as audit logging should be enabled for all the users
gcloud organizations set-iam-policy ORGANIZATION_ID /tmp/org_policy.yaml
gcloud resource-manager folders set-iam-policy FOLDER_ID /tmp/folder_policy.yaml
gcloud projects set-iam-policy PROJECT_ID /tmp/project_policy.yaml
If the preceding command reports a conflict with another change, then repeat these steps, starting with the first step.