Logging metric filter and alert for project ownership assignments/changes should be configured Affecting Monitor service in Google


Severity

0.0
medium
0
10
    Severity Framework
    Snyk CCSS
    Rule category
    Logging / Logging

Is your enviroment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
    Frameworks
    CIS-Google HIPAA ISO-27001 NIST-800-53 PCI-DSS
  • Snyk ID SNYK-CC-00441
  • credit Snyk Research Team

Description

Logging metric filter and alert for project ownership assignments/changes should be configured. Project ownership has the highest level of privileges on a project. Users should only be granted the owner role if they have a legitimate purpose to manage the project's IAM policy because it contains sensitive access control data. All ownership assignments and changes should therefore be monitored.

How to fix?

Logging metric filter and alert for project ownership assignments/changes should be configured.

Example Configuration

resource "google_logging_metric" "allow_logging_metric_1" {
  name   = "logging_metric_1"
  filter = "(protoPayload.serviceName=\"cloudresourcemanager.googleapis.com\") AND (ProjectOwnership OR projectOwnerInvitee)"

  metric_descriptor {
    value_type  = "INT64"
    metric_kind = "DELTA"
  }
}

resource "google_logging_metric" "allow_logging_metric_2" {
  name   = "logging_metric_2"
  filter = "(protoPayload.serviceName=\"cloudresourcemanager.googleapis.com\") AND (protoPayload.serviceData.policyDelta.bindingDeltas.action=\"REMOVE\" AND protoPayload.serviceData.policyDelta.bindingDeltas.role=\"roles/owner\")"

  metric_descriptor {
    value_type  = "INT64"
    metric_kind = "DELTA"
  }
}

resource "google_logging_metric" "allow_logging_metric_3" {
  name   = "logging_metric_3"
  filter = "(protoPayload.serviceName=\"cloudresourcemanager.googleapis.com\") AND (protoPayload.serviceData.policyDelta.bindingDeltas.action=\"ADD\" AND protoPayload.serviceData.policyDelta.bindingDeltas.role=\"roles/owner\")"

  metric_descriptor {
    value_type  = "INT64"
    metric_kind = "DELTA"
  }
}