Detection rules › Panther

GCP IAM and Tag Enumeration

Severity
informational
Log types
GCP.AuditLog
Tags
attack.reconnaissance, attack.t1548, gcp, iam, tagbinding
Source
github.com/panther-labs/panther-analysis

Detects enumeration of IAM policies and tags in GCP, which could be a precursor to privilege escalation attempts via tag-based access control.

Rule body yaml

AnalysisType: rule
RuleID: GCP.IAM.Tag.Enumeration
Description: >
  Detects enumeration of IAM policies and tags in GCP, which could be a precursor
  to privilege escalation attempts via tag-based access control.
DisplayName: GCP IAM and Tag Enumeration
Enabled: true
Filename: gcp_iam_tag_enumeration.py
LogTypes:
  - GCP.AuditLog
CreateAlert: false
Runbook: |
  Review if the user has legitimate business need for these enumeration operations.
  If unauthorized, review and update IAM policies.
Severity: Info
Tags:
  - attack.reconnaissance
  - attack.t1548
  - gcp
  - iam
  - tagbinding
Tests:
  - Name: IAM Policy Enumeration
    ExpectedResult: true
    Log:
      {
        "protoPayload": {
          "methodName": "GetIamPolicy",
          "authenticationInfo": {
            "principalEmail": "test@example.com"
          },
          "resourceName": "projects/test-project"
        },
        "resource": {
          "labels": {
            "project_id": "test-project"
          }
        },
        "timestamp": "2024-01-01T00:00:00Z"
      }

  - Name: Tag Keys Enumeration
    ExpectedResult: true
    Log:
      {
        "protoPayload": {
          "methodName": "TagKeys.ListTagKeys",
          "authenticationInfo": {
            "principalEmail": "test@example.com"
          },
          "resourceName": "projects/test-project"
        },
        "resource": {
          "labels": {
            "project_id": "test-project"
          }
        },
        "timestamp": "2024-01-01T00:00:00Z"
      }

  - Name: Normal Operation
    ExpectedResult: false
    Log:
      {
        "protoPayload": {
          "methodName": "compute.instances.list",
          "authenticationInfo": {
            "principalEmail": "test@example.com"
          },
          "resourceName": "projects/test-project"
        },
        "resource": {
          "labels": {
            "project_id": "test-project"
          }
        },
        "timestamp": "2024-01-01T00:00:00Z"
      } 

Detection logic

Condition

protoPayload.methodName contains "GetIamPolicy" or protoPayload.methodName contains "TagKeys.ListTagKeys" or protoPayload.methodName contains "TagKeys.ListTagValues" or protoPayload.methodName contains "TagBindings.ListEffectiveTags"

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
protoPayload.methodNamecontains
  • GetIamPolicy
  • TagBindings.ListEffectiveTags
  • TagKeys.ListTagKeys
  • TagKeys.ListTagValues

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
projectresource.labels.project_id
principalprotoPayload.authenticationInfo.principalEmail
caller_ipprotoPayload.requestMetadata.callerIP
methodNameprotoPayload.methodName
resourceNameprotoPayload.resourceName
serviceNameprotoPayload.serviceName