Push Security SaaS App MFA Method Changed


Description

MFA method on SaaS app changed

Query · python

def rule(event):
    if event.get("object") != "ACCOUNT":
        return False

    if event.get("old") is None:
        return False

    new_mfa_methods = set(event.deep_get("new", "mfaMethods"))
    old_mfa_methods = set(event.deep_get("old", "mfaMethods", default=[]))

    if new_mfa_methods != old_mfa_methods:
        return True

    return False


def severity(event):
    if event.deep_get("new", "mfaMethods") == []:
        return "HIGH"
    return "LOW"


def title(event):
    mfa_methods = ", ".join(event.deep_get("new", "mfaMethods", default="No MFA"))
    new_email = event.deep_get("new", "email")
    new_apptype = event.deep_get("new", "appType")

    if mfa_methods == "":
        return f"{new_email} removed all MFA methods on {new_apptype}"
    return f"{new_email} changed MFA method to {mfa_methods} on {new_apptype}"
Raw source Push Security SaaS App MFA Method Changed · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: rule
Filename: push_security_mfa_method_changed.py
RuleID: "Push.Security.MFA.Method.Changed"
DisplayName: "Push Security SaaS App MFA Method Changed"
Enabled: true
LogTypes:
  - PushSecurity.Entities
Severity: Info
Description: MFA method on SaaS app changed
DedupPeriodMinutes: 60
Threshold: 1
Tests:
  - Name: All MFA methods removed
    ExpectedResult: true
    Log:
      id: d1e5794f-666d-4cba-abae-c6d889ca1903
      new:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods: []
        mfaRegistered: false
        passwordId: null
      object: ACCOUNT
      old:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods:
          - SMS
        mfaRegistered: false
        passwordId: null
      timestamp: 1.707775049e+09
      type: CREATE
      version: "1"
  - Name: First seen
    ExpectedResult: false
    Log:
      id: d1e5794f-666d-4cba-abae-c6d889ca1903
      new:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods:
          - SMS
          - APP_OTP
        mfaRegistered: false
        passwordId: null
      object: ACCOUNT
      old: null
      timestamp: 1.707775049e+09
      type: CREATE
      version: "1"
  - Name: MFA method added
    ExpectedResult: true
    Log:
      id: d1e5794f-666d-4cba-abae-c6d889ca1903
      new:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods:
          - SMS
          - APP_OTP
        mfaRegistered: false
        passwordId: null
      object: ACCOUNT
      old:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods:
          - SMS
        mfaRegistered: false
        passwordId: null
      timestamp: 1.707775049e+09
      type: CREATE
      version: "1"
  - Name: No MFA method change
    ExpectedResult: false
    Log:
      id: d1e5794f-666d-4cba-abae-c6d889ca1903
      new:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods:
          - SMS
          - APP_OTP
        mfaRegistered: false
        passwordId: null
      object: ACCOUNT
      old:
        appId: 67ef5c13-b5e6-4945-af7b-c11ac98f630f
        appType: CONTENTFUL
        creationTimestamp: 1.707775048e+09
        email: jet.black@issp.com
        employeeId: ca6cf7ce-90e6-4eb5-a262-7899bc48c39c
        id: 5e15ce4c-6b93-4fbf-aed9-1890775efa90
        lastUsedTimestamp: null
        loginMethods:
          oidcLogin: null
          oktaSwaLogin: false
          passwordLogin: false
          samlLogin: null
        mfaMethods:
          - SMS
          - APP_OTP
        mfaRegistered: false
        passwordId: null
      timestamp: 1.707775049e+09
      type: CREATE
      version: "1"


# ------ paired body: push_security_mfa_method_changed.py ------

def rule(event):
    if event.get("object") != "ACCOUNT":
        return False

    if event.get("old") is None:
        return False

    new_mfa_methods = set(event.deep_get("new", "mfaMethods"))
    old_mfa_methods = set(event.deep_get("old", "mfaMethods", default=[]))

    if new_mfa_methods != old_mfa_methods:
        return True

    return False


def severity(event):
    if event.deep_get("new", "mfaMethods") == []:
        return "HIGH"
    return "LOW"


def title(event):
    mfa_methods = ", ".join(event.deep_get("new", "mfaMethods", default="No MFA"))
    new_email = event.deep_get("new", "email")
    new_apptype = event.deep_get("new", "appType")

    if mfa_methods == "":
        return f"{new_email} removed all MFA methods on {new_apptype}"
    return f"{new_email} changed MFA method to {mfa_methods} on {new_apptype}"

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.