Slack IDP Configuration Changed


Description

Detects changes to the identity provider (IdP) configuration for Slack organizations.

Query · python

from panther_slack_helpers import slack_alert_context

IDP_CHANGE_ACTIONS = {
    "idp_configuration_added": "Slack IDP Configuration Added",
    "idp_configuration_deleted": "Slack IDP Configuration Deleted",
    "idp_prod_configuration_updated": "Slack IDP Configuration Updated",
}


def rule(event):
    return event.get("action") in IDP_CHANGE_ACTIONS


def title(event):
    if event.get("action") in IDP_CHANGE_ACTIONS:
        return IDP_CHANGE_ACTIONS.get(event.get("action"))
    return "Slack IDP Configuration Changed"


def alert_context(event):
    return slack_alert_context(event)
Raw source Slack IDP Configuration Changed · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: rule
Filename: slack_idp_configuration_change.py
RuleID: "Slack.AuditLogs.IDPConfigurationChanged"
DisplayName: "Slack IDP Configuration Changed"
Enabled: true
LogTypes:
  - Slack.AuditLogs
Tags:
  - Slack
  - Persistence
  - Credential Access
  - Modify Authentication Process
Reports:
  MITRE ATT&CK:
    - TA0003:T1556
    - TA0006:T1556
Severity: High
Description: Detects changes to the identity provider (IdP) configuration for Slack organizations.
Reference: https://slack.com/intl/en-gb/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org
DedupPeriodMinutes: 60
Threshold: 1
SummaryAttributes:
  - action
  - p_any_ip_addresses
  - p_any_emails
Tests:
  - Name: IDP Configuration Added
    ExpectedResult: true
    Log:
      {
        "action": "idp_configuration_added",
        "actor":
          {
            "type": "user",
            "user":
              {
                "email": "user@example.com",
                "id": "A012B3CDEFG",
                "name": "username",
                "team": "T01234N56GB",
              },
          },
        "context":
          {
            "ip_address": "1.2.3.4",
            "location":
              {
                "domain": "test-workspace",
                "id": "T01234N56GB",
                "name": "test-workspace",
                "type": "workspace",
              },
            "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
          },
        "date_create": "2022-07-28 16:48:14",
      }
  - Name: IDP Configuration Deleted
    ExpectedResult: true
    Log:
      {
        "action": "idp_configuration_deleted",
        "actor":
          {
            "type": "user",
            "user":
              {
                "email": "user@example.com",
                "id": "A012B3CDEFG",
                "name": "username",
                "team": "T01234N56GB",
              },
          },
        "context":
          {
            "ip_address": "1.2.3.4",
            "location":
              {
                "domain": "test-workspace",
                "id": "T01234N56GB",
                "name": "test-workspace",
                "type": "workspace",
              },
            "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
          },
        "date_create": "2022-07-28 16:48:14",
      }
  - Name: IDP Configuration Updated
    ExpectedResult: true
    Log:
      {
        "action": "idp_prod_configuration_updated",
        "actor":
          {
            "type": "user",
            "user":
              {
                "email": "user@example.com",
                "id": "A012B3CDEFG",
                "name": "username",
                "team": "T01234N56GB",
              },
          },
        "context":
          {
            "ip_address": "1.2.3.4",
            "location":
              {
                "domain": "test-workspace",
                "id": "T01234N56GB",
                "name": "test-workspace",
                "type": "workspace",
              },
            "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
          },
        "date_create": "2022-07-28 16:48:14",
      }
  - Name: User Logout
    ExpectedResult: false
    Log:
      {
        "action": "user_logout",
        "actor":
          {
            "type": "user",
            "user":
              {
                "email": "user@example.com",
                "id": "W012J3FEWAU",
                "name": "primary-owner",
                "team": "T01234N56GB",
              },
          },
        "context":
          {
            "ip_address": "1.2.3.4",
            "location":
              {
                "domain": "test-workspace-1",
                "id": "T01234N56GB",
                "name": "test-workspace-1",
                "type": "workspace",
              },
            "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
          },
        "date_create": "2022-07-28 15:22:32",
        "entity":
          {
            "type": "user",
            "user":
              {
                "email": "user@example.com",
                "id": "W012J3FEWAU",
                "name": "primary-owner",
                "team": "T01234N56GB",
              },
          },
        "id": "72cac009-9eb3-4dde-bac6-ee49a32a1789",
      }


# ------ paired body: slack_idp_configuration_change.py ------

from panther_slack_helpers import slack_alert_context

IDP_CHANGE_ACTIONS = {
    "idp_configuration_added": "Slack IDP Configuration Added",
    "idp_configuration_deleted": "Slack IDP Configuration Deleted",
    "idp_prod_configuration_updated": "Slack IDP Configuration Updated",
}


def rule(event):
    return event.get("action") in IDP_CHANGE_ACTIONS


def title(event):
    if event.get("action") in IDP_CHANGE_ACTIONS:
        return IDP_CHANGE_ACTIONS.get(event.get("action"))
    return "Slack IDP Configuration Changed"


def alert_context(event):
    return slack_alert_context(event)

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.