Detection rules › Panther

GCP External User Ownership Invite

Severity
high
Log types
GCP.AuditLog
Reference
https://cloud.google.com/resource-manager/docs/project-ownership
Source
github.com/panther-labs/panther-analysis

This rule detects when an external user is invited as an owner of a GCP project using the InsertProjectOwnershipInvite event.

Rule body yaml

AnalysisType: rule
DedupPeriodMinutes: 60
DisplayName: GCP External User Ownership Invite
Enabled: true
Filename: gcp_invite_external_user_as_owner.py
RuleID: "GCP.Project.ExternalUserOwnershipInvite"
Severity: High
LogTypes:
  - GCP.AuditLog
Description: >
  This rule detects when an external user is invited as an owner of a GCP project using the InsertProjectOwnershipInvite event.
Runbook: >
  Investigate the invitation to ensure it was authorized. Unauthorized invitations can lead to security risks. If the invitation was unauthorized, revoke the user's access to the project.
Reference: https://cloud.google.com/resource-manager/docs/project-ownership
Tests:
  - Name: External User Ownership Invite
    LogType: GCP.AuditLog
    ExpectedResult: true
    Log:
      {
        "insertId": "1abcd23efg456",
        "logName": "projects/test-project/logs/cloudaudit.googleapis.com%2Factivity",
        "protoPayload": {
          "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
          "methodName": "InsertProjectOwnershipInvite",
          "resourceName": "projects/target-project",
          "authenticationInfo": {
            "principalEmail": "user@runpanther.com"
          },
          "request": {
            "member": "user:attacker@gmail.com",
            "projectId": "target-project",
            "@type": "type.googleapis.com/google.internal.cloud.resourcemanager.InsertProjectOwnershipInviteRequest"
          },
          "response": {
            "@type": "type.googleapis.com/google.internal.cloud.resourcemanager.InsertProjectOwnershipInviteResponse"
          },
          "serviceName": "cloudresourcemanager.googleapis.com"
        },
        "resource": {
          "labels": {
            "project_id": "target-project"
          },
          "type": "gce_project"
        },
        "severity": "NOTICE",
        "timestamp": "2023-10-01T12:34:56.789Z"
      }
  - Name: Internal User Ownership Invite
    LogType: GCP.AuditLog
    ExpectedResult: false
    Log:
      {
        "insertId": "2hijk34lmn789",
        "logName": "projects/test-project/logs/cloudaudit.googleapis.com%2Factivity",
        "protoPayload": {
          "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
          "methodName": "InsertProjectOwnershipInvite",
          "resourceName": "projects/target-project",
          "authenticationInfo": {
            "principalEmail": "user@runpanther.com"
          },
          "request": {
            "member": "user:internal-user@runpanther.com",
            "projectId": "target-project",
            "@type": "type.googleapis.com/google.internal.cloud.resourcemanager.InsertProjectOwnershipInviteRequest"
          },
          "response": {
            "@type": "type.googleapis.com/google.internal.cloud.resourcemanager.InsertProjectOwnershipInviteResponse"
          },
          "serviceName": "cloudresourcemanager.googleapis.com"
        },
        "resource": {
          "labels": {
            "project_id": "target-project"
          },
          "type": "gce_project"
        },
        "severity": "NOTICE",
        "timestamp": "2023-10-01T12:45:56.789Z"
      }

Detection logic

Condition

protoPayload.response.error is_null
protoPayload.methodName eq "InsertProjectOwnershipInvite"

This rule also runs imperative logic the parser cannot express as a filter; the conditions above are the structured part it could extract.

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.methodNameeq
  • InsertProjectOwnershipInvite
protoPayload.response.erroris_null
  • (no value, null check)

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
memberprotoPayload.request.member