Sensitive File Access followed by Compression

Last updated 12 days ago on 2026-01-30
Created 12 days ago on 2026-01-30

About

Detects when a sensitive file is accessed followed by the immediate creation of a compressed file in a suspicious location. This activity can indicate an attempt to collect sensitive local data and stage it for exfiltration.
Tags
Domain: EndpointOS: macOSUse Case: Threat DetectionTactic: CollectionData Source: Elastic DefendLanguage: eql
Severity
high
Risk Score
73
MITRE ATT&CK™

Collection (TA0009)(external, opens in a new tab or window)

Exfiltration (TA0010)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.file-*
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
sequence by process.entity_id with maxspan=30s [file where host.os.type == "macos" and event.action == "open" and not file.name in~ ("System.keychain", "login.keychain-db", "preferences.plist", "com.apple.TimeMachine.plist")] [file where host.os.type == "macos" and event.action == "modification" and file.extension in ("zip", "gzip", "gz") and file.path like~ ("/Users/Shared/*", "/Library/WebServer/*", "/Users/*/Library/WebServer/*", "/Library/Graphics/*", "/Users/*/Library/Graphics/*", "/Library/Fonts/*", "/Users/*/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/tmp/*", "/var/tmp/*", "/private/tmp/*") and not file.path like~ ("/Library/Logs/CrashReporter/*", "/private/tmp/publish.*")]

Install detection rules in Elastic Security

Detect Sensitive File Access followed by Compression in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).