ZIA Logs Downloaded


Description

This rule detects when ZIA Audit Logs were downloaded.

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")
    if action == "DOWNLOAD" and category == "AUDIT_LOGS":
        return True
    return False


def title(event):
    return (
        f"[Zscaler.ZIA]: Audit logs were downloaded 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, make sure no sensitive information was leaked.

Raw source ZIA Logs Downloaded · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: rule
RuleID: ZIA.Logs.Downloaded
Description: This rule detects when ZIA Audit Logs were downloaded.
DisplayName: ZIA Logs Downloaded
Runbook: Verify that this change was planned. If not, make sure no sensitive information was leaked.
Reference: https://help.zscaler.com/zia/about-audit-logs
Enabled: true
Filename: zia_logs_downloaded.py
Severity: Medium
Reports:
  MITRE ATT&CK:
    - TA0007:T1654 # Log Enumeration
LogTypes:
  - Zscaler.ZIA.AdminAuditLog
DedupPeriodMinutes: 60
Threshold: 1
Tests:
  - Name: Logs downloaded
    ExpectedResult: true
    Log:
      {
        "event": {
          "action": "DOWNLOAD",
          "adminid": "admin@test.zscalerbeta.net",
          "auditlogtype": "ZIA",
          "category": "AUDIT_LOGS",
          "clientip": "1.2.3.4",
          "errorcode": "None",
          "interface": "UI",
          "postaction": { },
          "preaction": { },
          "recordid": "363",
          "resource": "None",
          "result": "SUCCESS",
          "subcategory": "AUDIT_LOGS",
          "time": "2024-11-04 16:31:24.000000000"
        },
        "sourcetype": "zscalernss-audit"
      }
  - Name: Other event
    ExpectedResult: false
    Log:
      {
        "event": {
          "action": "SIGN_IN",
          "adminid": "admin@test.zscalerbeta.net",
          "auditlogtype": "ZIA",
          "category": "LOGIN",
          "clientip": "1.2.3.4",
          "errorcode": "None",
          "interface": "UI",
          "postaction": { },
          "preaction": { },
          "recordid": "354",
          "resource": "None",
          "result": "SUCCESS",
          "subcategory": "LOGIN",
          "time": "2024-11-04 16:27:37.000000000"
        },
        "sourcetype": "zscalernss-audit"
      }


# ------ paired body: zia_logs_downloaded.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")
    if action == "DOWNLOAD" and category == "AUDIT_LOGS":
        return True
    return False


def title(event):
    return (
        f"[Zscaler.ZIA]: Audit logs were downloaded 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.