π‘οΈ Google Logging Log Metric Filter and Alerts for Project Ownership Assignments Changes do not existπ’
- Contextual name: π‘οΈ Log Metric Filter and Alerts for Project Ownership Assignments Changes do not existπ’
- ID:
/ce/ca/google/logging/project-ownership-assignments-and-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 Project Ownership Assignments Monitoring
Descriptionβ
Descriptionβ
To prevent unnecessary project ownership assignments to users or service accounts and reduce misuse of projects and resources, all
roles/Ownerassignments should be monitored.Members (users or service accounts) with a role assignment to the primitive role
roles/Ownerare project owners.The project owner has full privileges on the project. These are summarized below:
- All viewer permissions on all GCP Services within the project
- Permissions for actions that modify the state of all GCP services within the project
- Manage roles and permissions for a project and all resources within the project
- Set up billing for a project
Granting the owner role to a member (user or service account) allows that member to modify the Identity and Access Management (IAM) policy. Therefore, grant the owner role only if the member has a legitimate purpose to manage the IAM policy. This is because the project IAM policy contains sensitive access control data. Having a minimal set of users allowed to manage IAM policy simplifies auditing.
... 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:
(protoPayload.serviceName="cloudresourcemanager.googleapis.com")
AND (ProjectOwnership OR projectOwnerInvitee)
OR (protoPayload.serviceData.policyDelta.bindingDeltas.action="REMOVE"
AND protoPayload.serviceData.policyDelta.bindingDeltas.role="roles/owner")
OR (protoPayload.serviceData.policyDelta.bindingDeltas.action="ADD"
AND protoPayload.serviceData.policyDelta.bindingDeltas.role="roles/owner")Click
Submit Filter. Displayed 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.... see more