More Info:

Ensure that the log metric filter and alerts exist for Custom Role changes.

Risk Level

Medium

Address

Security

Compliance Standards

CISGCP, CBP, HIPAA, ISO27001, HITRUST, SOC2, NISTCSF, PCIDSS

Triage and Remediation

Remediation

To remediate the misconfiguration “Custom Role Change Log Alerts Should Be Enabled” in GCP using GCP console, you can follow the below steps:

  1. Open the GCP console and select the project for which you want to enable the Custom Role Change Log Alerts.

  2. Click on the “Navigation menu” on the top-left corner of the console and select “Logging” under the “TOOLS” section.

  3. In the Logging page, click on the “Create Sink” button.

  4. In the “Create Sink” page, provide a name for the sink in the “Name” field.

  5. In the “Sink Service” section, select “Cloud Pub/Sub” as the sink service.

  6. In the “Cloud Pub/Sub topic” field, select or create a new topic to which the logs will be sent.

  7. In the “Filter” section, add the following filter:

protoPayload.methodName="google.iam.admin.v1.CreateRole" OR protoPayload.methodName="google.iam.admin.v1.UpdateRole" OR protoPayload.methodName="google.iam.admin.v1.DeleteRole"

This filter will capture the logs for any changes made to custom roles.

  1. Click on the “Create Sink” button to create the sink.

  2. Once the sink is created, click on the “Create Alert” button to create an alert based on the sink.

  3. In the “Create Alerting Policy” page, provide a name for the alert in the “Name” field.

  4. In the “Condition” section, click on the “Add Condition” button and select “Log-based Metric” as the condition type.

  5. In the “Log-based Metric” section, select the sink that you created in step 4.

  6. In the “Aggregation” section, select “Count” as the aggregation type and set the “Period” to 1 minute.

  7. In the “Filter” section, add the same filter that you added in step 7.

  8. In the “Configuration” section, set the “Threshold” to 1 and the “For” duration to 1 minute.

  9. In the “Notification Channels” section, select the notification channels to which you want to send the alerts.

  10. Click on the “Save” button to save the alerting policy.

Now, whenever a custom role is created, updated or deleted, a log entry will be created and sent to the Cloud Pub/Sub topic. The log-based metric and alerting policy that you created will capture these logs and send alerts to the specified notification channels.