ZIA Password Expiration


Description

This rule detects when password expiration was set/removed.

Query · python

from panther_zscaler_helpers import zia_alert_context, zia_success


def rule(event):
    if not zia_success(event):
        return False
    action = event.deep_get("event", "action", default="ACTION_NOT_FOUND")
    category = event.deep_get("event", "category", default="CATEGORY_NOT_FOUND")
    password_exp_pre = event.deep_get(
        "event",
        "preaction",
        "passwordExpirationEnabled",
        default="",
    )
    password_exp_post = event.deep_get(
        "event",
        "postaction",
        "passwordExpirationEnabled",
        default="",
    )
    if action == "UPDATE" and category == "LOGIN" and password_exp_pre != password_exp_post:
        return True
    return False


def title(event):
    return (
        f"[Zscaler.ZIA]: Password expiration setting was changed by admin with id "
        f"[{event.deep_get('event', 'adminid', default='<ADMIN_ID_NOT_FOUND>')}]"
    )


def alert_context(event):
    return zia_alert_context(event)

Analyst notes

Verify that this change was planned. If not, revert the change and ensure this doesn't happen again.

Raw source ZIA Password Expiration · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: rule
RuleID: ZIA.Password.Expiration
Description: This rule detects when password expiration was set/removed.
DisplayName: ZIA Password Expiration
Runbook: Verify that this change was planned. If not, revert the change and ensure this doesn't happen again.
Reference: https://help.zscaler.com/zia/configuring-password-expiration
Enabled: true
Filename: zia_password_expiration.py
Severity: Medium
Reports:
  MITRE ATT&CK:
    - TA0007:T1201 # Password Policy Discovery
LogTypes:
  - Zscaler.ZIA.AdminAuditLog
DedupPeriodMinutes: 60
Threshold: 1
Tests:
  - Name: Administration Management > Administrator Management > Set Password Expriration 180 days
    ExpectedResult: true
    Log:
      {
        "event": {
          "action": "UPDATE",
          "adminid": "admin@16991311.zscalerbeta.net",
          "auditlogtype": "ZIA",
          "category": "LOGIN",
          "clientip": "123.123.123.123",
          "errorcode": "None",
          "interface": "UI",
          "postaction": {
            "passwordExpirationEnabled": true,
            "passwordExpiryDays": 180
          },
          "preaction": {
            "passwordExpirationEnabled": false,
            "passwordExpiryDays": 180
          },
          "recordid": "331",
          "resource": "None",
          "result": "SUCCESS",
          "subcategory": "PASSWORD_EXPIRY",
          "time": "2024-10-22 22:12:25.000000000"
        },
        "sourcetype": "zscalernss-audit"
      }
  - Name: Administration Management > Administrator Management > Remove Password Expriration
    ExpectedResult: true
    Log:
      {
        "event": {
          "action": "UPDATE",
          "adminid": "admin@16991311.zscalerbeta.net",
          "auditlogtype": "ZIA",
          "category": "LOGIN",
          "clientip": "123.123.123.123",
          "errorcode": "None",
          "interface": "UI",
          "postaction": {
            "passwordExpirationEnabled": false,
            "passwordExpiryDays": 180
          },
          "preaction": {
            "passwordExpirationEnabled": true,
            "passwordExpiryDays": 180
          },
          "recordid": "331",
          "resource": "None",
          "result": "SUCCESS",
          "subcategory": "PASSWORD_EXPIRY",
          "time": "2024-10-22 22:12:25.000000000"
        },
        "sourcetype": "zscalernss-audit"
      }


# ------ paired body: zia_password_expiration.py ------

from panther_zscaler_helpers import zia_alert_context, zia_success


def rule(event):
    if not zia_success(event):
        return False
    action = event.deep_get("event", "action", default="ACTION_NOT_FOUND")
    category = event.deep_get("event", "category", default="CATEGORY_NOT_FOUND")
    password_exp_pre = event.deep_get(
        "event",
        "preaction",
        "passwordExpirationEnabled",
        default="",
    )
    password_exp_post = event.deep_get(
        "event",
        "postaction",
        "passwordExpirationEnabled",
        default="",
    )
    if action == "UPDATE" and category == "LOGIN" and password_exp_pre != password_exp_post:
        return True
    return False


def title(event):
    return (
        f"[Zscaler.ZIA]: Password expiration setting was changed by admin with id "
        f"[{event.deep_get('event', 'adminid', default='<ADMIN_ID_NOT_FOUND>')}]"
    )


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