π‘οΈ Google Logging Log Metric Filter and Alerts for Custom Role Changes do not existπ’
- Contextual name: π‘οΈ Log Metric Filter and Alerts for Custom Role Changes do not existπ’
- ID: /ce/ca/google/logging/custom-role-changes-monitoring
- Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
 
- Policy Type: COMPLIANCE_POLICY
- Policy Categories: SECURITY
Logicβ
- π§ prod.logic.yamlπ’
Similar Policiesβ
- Cloud Conformity: Enable Monitoring for Custom Role Changes
Descriptionβ
Descriptionβ
It is recommended that a metric filter and alarm be established for changes to Identity and Access Management (IAM) role creation, deletion and updating activities.
Rationaleβ
Google Cloud IAM provides predefined roles that give granular access to specific Google Cloud Platform resources and prevent unwanted access to other resources. However, to cater to organization-specific needs, Cloud IAM also provides the ability to create custom roles. Project owners and administrators with the Organization Role Administrator role or the IAM Role Administrator role can create custom roles. Monitoring role creation, deletion and updating activities will help in identifying any over-privileged role at early stages.
Impactβ
Enabling of logging may result in your project being charged for the additional logs usage.
Auditβ
From Google Cloud Consoleβ
Ensure that the prescribed log metric is present:
- Go to
Logging/Logs-based Metricsby visiting https://console.cloud.google.com/logs/metrics.- In the
User-defined Metricssection, ensure that at least one metric<Log_Metric_Name>is present with filter text:... see more
Remediationβ
Remediationβ
From Google Cloud Consoleβ
Create the prescribed log metricβ
Go to
Logging/Logs-based Metricsby visiting https://console.cloud.google.com/logs/metrics and click "CREATE METRIC".
Click the down arrow symbol on the
Filter Barat the rightmost corner and selectConvert to Advanced Filter.
Clear any text and add:
resource.type="iam_role"
AND (protoPayload.methodName = "google.iam.admin.v1.CreateRole"
OR protoPayload.methodName="google.iam.admin.v1.DeleteRole"
OR protoPayload.methodName="google.iam.admin.v1.UpdateRole")
Click
Submit Filter. Display logs appear based on the filter text entered by the user.
In the
Metric Editormenu on the right, fill out the name field. SetUnitsto1(default) andTypetoCounter. This ensures that the log metric counts the number of log entries matching the advanced logs query.
Click
Create Metric.Create a prescribed Alert Policyβ
- Identify the new metric that was just created under the section
User-defined Metricsat https://console.cloud.google.com/logs/metrics.... see more