[New Rules] macOS Unified Logs Login Window and XProtect Detections#5874
[New Rules] macOS Unified Logs Login Window and XProtect Detections#5874DefSecSentinel wants to merge 16 commits intomainfrom
Conversation
Adds 2 new alerting rules leveraging macOS Unified Logs telemetry for login item persistence and XProtect malware detection. New rules: - Login Item Persistence Execution via Unified Logs (T1547.015) com.apple.loginwindow.logging subsystem, performAutolaunch pattern - XProtect Malware Scan Match Detected (T1036) com.apple.XProtectFramework.PluginAPI subsystem, high severity Also adds message field as keyword in non-ECS schema for the logs-unified_logs.log-* index pattern to support EQL validation. Relates to: elastic/ia-trade-team#847 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
|
⛔️ Test failed Results
|
|
|
||
| query = ''' | ||
| any where event.dataset == "unified_logs.log" and host.os.type == "macos" and | ||
| message like "*performAutolaunch*" |
rules/integrations/unified_logs/defense_evasion_xprotect_malware_scan_match.toml
Outdated
Show resolved
Hide resolved
Switch from EQL to KQL since message is match_only_text. Use unified_log.subsystem keyword field for efficient filtering. Update index pattern and event.dataset to match actual integration naming. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
The ingest pipeline normalizes event.dataset to "unifiedlogs.log" regardless of the data stream name. Update all rules and index patterns accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
| [metadata] | ||
| creation_date = "2026/03/23" | ||
| integration = ["unified_logs"] | ||
| maturity = "development" |
There was a problem hiding this comment.
| maturity = "development" | |
| maturity = "production" |
| "system.process.cpu.total.norm.pct": "double", | ||
| "system.cpu.total.norm.pct": "double" | ||
| }, | ||
| "logs-unified_logs.log-*": { |
There was a problem hiding this comment.
This should probably be removed and instead add the integration manifest update
- Pull unifiedlogs integration manifest and schema via CLI - Fix integration tag: unified_logs -> unifiedlogs (matches EPR package) - Fix index pattern: logs-unifiedlogs.log-* -> logs-unifiedlogs.unifiedlogs-* - Fix event.dataset: unifiedlogs.log -> unifiedlogs.unifiedlogs - All rules pass local validation with updated schemas Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
data_stream.dataset is "unifiedlogs.unifiedlogs" but event.dataset is set to "unifiedlogs.log" by the integration. Rules query on event.dataset so must use the correct value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
KQL cannot query the message field (match_only_text type with no keyword sub-field). ES|QL's LIKE operator works correctly on text fields. Converted both rules to ES|QL with METADATA and KEEP. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
user.name, process.name, process.executable don't exist in the unifiedlogs index. Removed from KEEP to prevent query errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
event.dataset is unifiedlogs.log which maps to package=unifiedlogs, integration=log. Schema needs a 'log' dataset key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
The performAutolaunch pattern doesn't exist in the actual unified logs on current macOS versions. The real login item execution pattern is LoginItemsLauncher, which fires during user login when login items are launched. Updated rule query and description. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
Testing & Validation UpdateLogin Window and XProtect detection rules validated against live unified log data on the trade lab cluster ( Changes Made During Testing
Emulation Commands (run on macOS host with Unified Logs integration)Login Item Persistence Execution: # 1. Add a test login item
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Calculator.app", hidden:false}'
# 2. Log out and log back in (Apple Menu > Log Out)
# The LoginItemsLauncher events fire during the login window phase
# 3. Cleanup
osascript -e 'tell application "System Events" to delete login item "Calculator"'XProtect Malware Scan Match: Cannot be reliably emulated — requires an actual malware signature match from XProtect. Rule pattern validated structurally. Integration Prerequisites
Validation Results
|
Unified Logs integration is now GA. Rules are validated and ready for production use. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|

Summary
New Alerting Rules
com.apple.loginwindow.loggingperformAutolaunchcom.apple.XProtectFramework.PluginAPIDesign Notes
high(risk_score 73) given the confidence level.message: keywordtonon-ecs-schema.jsonforlogs-unified_logs.log-*(same fix as companion PRs).Relates to: https://github.com/elastic/ia-trade-team/issues/847
Test plan
detection_rules validate-rule🤖 Generated with Claude Code