Notion SAML SSO Configuration Changed


Description

A Notion User changed settings to enforce SAML SSO configurations for your organization.

Query · python

from panther_notion_helpers import notion_alert_context


def rule(event):

    return (
        event.deep_get("event", "type", default="<NO_EVENT_TYPE_FOUND>")
        == "workspace.settings.enforce_saml_sso_config_updated"
    )


def title(event):
    user = event.deep_get("event", "actor", "person", "email", default="<NO_USER_FOUND>")
    workspace_id = event.deep_get("event", "workspace_id", default="<NO_WORKSPACE_ID_FOUND>")
    state = event.deep_get(
        "event",
        "workspace.settings.enforce_saml_sso_config_updated",
        "state",
        default="<NO_STATE_FOUND>",
    )

    if state == "enabled":
        return (
            f"Notion User [{user}] updated settings to enable SAML SSO config "
            f"from workspace id {workspace_id}"
        )

    return (
        f"Notion User [{user}] updated settings to disable SAML SSO config "
        f"from workspace id {workspace_id}"
    )


def severity(event):
    state = event.deep_get(
        "event",
        "workspace.settings.enforce_saml_sso_config_updated",
        "state",
        default="<NO_STATE_FOUND>",
    )

    if state == "enabled":
        return "INFO"

    return "HIGH"


def alert_context(event):
    return notion_alert_context(event)

Analyst notes

Follow up with the Notion User to determine if this was done for a valid business reason and to ensure these settings get re-enabled quickly for best security practices.

Raw source Notion SAML SSO Configuration Changed · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: rule
Filename: notion_workspace_settings_enforce_saml_sso_config_updated.py
RuleID: "Notion.SAML.SSO.Configuration.Changed"
DisplayName: "Notion SAML SSO Configuration Changed"
Enabled: true
LogTypes:
  - Notion.AuditLogs
Tags:
  - Notion
  - Identity & Access Management
  - Credential Security
Severity: High
Description: A Notion User changed settings to enforce SAML SSO configurations for your organization.
DedupPeriodMinutes: 60
Threshold: 1
Runbook: Follow up with the Notion User to determine if this was done for a valid business reason and to ensure these settings get re-enabled quickly for best security practices.
Reference: https://www.notion.so/help/saml-sso-configuration
Tests:
  - Name: Other Event
    ExpectedResult: false
    Log:
      {
        "event":
          {
            "id": "...",
            "timestamp": "2023-05-15T19:14:21.031Z",
            "workspace_id": "..",
            "actor":
              {
                "id": "..",
                "object": "user",
                "type": "person",
                "person": { "email": "homer.simpson@yourcompany.io" },
              },
            "ip_address": "...",
            "platform": "web",
            "type": "workspace.content_exported",
            "workspace.content_exported": {},
          },
      }
  - Name: SAML SSO Enabled
    ExpectedResult: true
    Log:
      {
        "event":
          {
            "id": "...",
            "timestamp": "2023-05-15T19:14:21.031Z",
            "workspace_id": "..",
            "actor":
              {
                "id": "..",
                "object": "user",
                "type": "person",
                "person": { "email": "homer.simpson@yourcompany.io" },
              },
            "ip_address": "...",
            "platform": "web",
            "type": "workspace.settings.enforce_saml_sso_config_updated",
            "workspace.settings.enforce_saml_sso_config_updated":
              { "state": "enabled" },
          },
      }
  - Name: SAML SSO Disabled
    ExpectedResult: true
    Log:
      {
        "event":
          {
            "id": "...",
            "timestamp": "2023-05-15T19:14:21.031Z",
            "workspace_id": "..",
            "actor":
              {
                "id": "..",
                "object": "user",
                "type": "person",
                "person": { "email": "homer.simpson@yourcompany.io" },
              },
            "ip_address": "...",
            "platform": "web",
            "type": "workspace.settings.enforce_saml_sso_config_updated",
            "workspace.settings.enforce_saml_sso_config_updated":
              { "state": "disabled" },
          },
      }


# ------ paired body: notion_workspace_settings_enforce_saml_sso_config_updated.py ------

from panther_notion_helpers import notion_alert_context


def rule(event):

    return (
        event.deep_get("event", "type", default="<NO_EVENT_TYPE_FOUND>")
        == "workspace.settings.enforce_saml_sso_config_updated"
    )


def title(event):
    user = event.deep_get("event", "actor", "person", "email", default="<NO_USER_FOUND>")
    workspace_id = event.deep_get("event", "workspace_id", default="<NO_WORKSPACE_ID_FOUND>")
    state = event.deep_get(
        "event",
        "workspace.settings.enforce_saml_sso_config_updated",
        "state",
        default="<NO_STATE_FOUND>",
    )

    if state == "enabled":
        return (
            f"Notion User [{user}] updated settings to enable SAML SSO config "
            f"from workspace id {workspace_id}"
        )

    return (
        f"Notion User [{user}] updated settings to disable SAML SSO config "
        f"from workspace id {workspace_id}"
    )


def severity(event):
    state = event.deep_get(
        "event",
        "workspace.settings.enforce_saml_sso_config_updated",
        "state",
        default="<NO_STATE_FOUND>",
    )

    if state == "enabled":
        return "INFO"

    return "HIGH"


def alert_context(event):
    return notion_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.