Ensures that logging and log alerts exist for audit configuration changes. Project Ownership is the highest level of privilege on a project, any changes in audit configuration should be heavily monitored to prevent unauthorized changes.
This filter will match any changes to the IAM policy for your project.
Under “Configuration”, select “Create Alert from Metric”.
Configure your alert as desired, including the notification channels you want to use.
Save your alert.
By following these steps, you will have enabled Audit Configuration Change Log Alerts on GCP, allowing you to be notified whenever changes are made to your project’s IAM policy.
To remediate the misconfiguration “Audit Configuration Change Log Alerts Should Be Enabled” for GCP using GCP CLI, please follow the below steps:
Open the GCP Cloud console and navigate to the Security Command Center.
Click on the “Security Health Analytics” tab and select “Audit Configuration Change Log Alerts” from the list of security checks.
If the check is failed, click on the “Remediate” button.
In the “Remediation” dialog box, select the “GCP CLI” option.
Open the Cloud Shell in the GCP console.
Run the following command to enable the audit configuration change log alerts:
Copy
Ask AI
gcloud logging sinks create [SINK_NAME] storage.googleapis.com/[BUCKET_NAME] --log-filter='resource.type="audited_resource" AND protoPayload.methodName="google.cloud.audit.AuditLogService.UpdateConfig"'
Note: Replace [SINK_NAME] with a name for the sink and [BUCKET_NAME] with the name of the destination bucket.
After running the above command, verify that the audit configuration change log alerts are enabled by running the following command:
Copy
Ask AI
gcloud logging sinks describe [SINK_NAME]
Check the output of the above command to ensure that the “logFilter” parameter is set to resource.type="audited_resource" AND protoPayload.methodName="google.cloud.audit.AuditLogService.UpdateConfig".
Once the above steps are completed, the misconfiguration “Audit Configuration Change Log Alerts Should Be Enabled” for GCP using GCP CLI will be remediated.
Using Python
To remediate the misconfiguration “Audit Configuration Change Log Alerts Should Be Enabled” for GCP using Python, you can follow these steps:
Install the Google Cloud SDK and authenticate with your GCP account using the following command:
Copy
Ask AI
gcloud auth login
Install the required Python libraries using the following command: