Skip to content

MacOS detection rules tuning#5667

Open
DefSecSentinel wants to merge 6 commits intomainfrom
mactuning
Open

MacOS detection rules tuning#5667
DefSecSentinel wants to merge 6 commits intomainfrom
mactuning

Conversation

@DefSecSentinel
Copy link
Contributor

@DefSecSentinel DefSecSentinel commented Feb 2, 2026

Associated Issue

#4456

Summary

Syncs and tunes macOS detection rules based on endpoint-rules logic and 90-day telemetry analysis.

Changes

Endpoint Rules Sync (5 rules)

Rule Fix
Bifrost Kerberos Fixed broken query logic - parentheses grouping was incorrect
Osascript Phishing Added authenticate pattern, NinjaRMM exclusion, sudo parent exclusion
SCP Privacy Bypass Changed 127.0.0.1 to 127.0.0.? pattern to catch alternate loopback bypass
Kext Unload Added EndpointSecurity wildcard pattern
Safari Settings Changed from broad catch-all to targeted dangerous settings

Telemetry-Based Tuning (1 rule)

Rule Alerts (90d) Fix
Hosts File Modified 5,074 Added Parallels Desktop exclusion for macOS

Context

These detection rules have counterparts in the endpoint-rules repository that are regularly tuned. This PR brings the detection-rules versions up to parity with the endpoint-rules logic and reduces false positives based on telemetry analysis.

- Fix Bifrost Kerberos query logic (broken parentheses grouping)
- Add authenticate pattern and NinjaRMM exclusion to osascript phishing rule
- Update SCP privacy bypass to use 127.0.0.? loopback pattern
- Add wildcard EndpointSecurity pattern to kext unload rule
- Change from broad catch-all with exclusions to targeted dangerous settings
- Only detect IncludeDevelopMenu and JavaScript setting changes
- Reduces false positives from benign Safari preference changes
- Excludes /Applications/Parallels Desktop.app/Contents/MacOS/prl_naptd (5,074 alerts in 90 days)
@tradebot-elastic
Copy link

tradebot-elastic commented Feb 2, 2026

⛔️ Test failed

Results
  • ❌ Potential Kerberos Attack via Bifrost (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Prompt for Credentials with Osascript (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Modification of Safari Settings via Defaults Command (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ✅ Attempt to Unload Elastic Endpoint Security Kernel Extension (eql)
  • ✅ Hosts File Modified (eql)
  • ❌ Potential Privacy Control Bypass via Localhost Secure Copy (eql)
    • stack_validation_failed: no_alerts - 0 alerts

@DefSecSentinel DefSecSentinel changed the title Sync macOS detection rules with endpoint-rules logic MacOS detection rules tuning Feb 2, 2026
@DefSecSentinel DefSecSentinel added the Rule: Tuning tweaking or tuning an existing rule label Feb 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Rule: Tuning - Guidelines

These guidelines serve as a reminder set of considerations when tuning an existing rule.

Documentation and Context

  • Detailed description of the suggested changes.
  • Provide example JSON data or screenshots.
  • Provide evidence of reducing benign events mistakenly identified as threats (False Positives).
  • Provide evidence of enhancing detection of true threats that were previously missed (False Negatives).
  • Provide evidence of optimizing resource consumption and execution time of detection rules (Performance).
  • Provide evidence of specific environment factors influencing customized rule tuning (Contextual Tuning).
  • Provide evidence of improvements made by modifying sensitivity by changing alert triggering thresholds (Threshold Adjustments).
  • Provide evidence of refining rules to better detect deviations from typical behavior (Behavioral Tuning).
  • Provide evidence of improvements of adjusting rules based on time-based patterns (Temporal Tuning).
  • Provide reasoning of adjusting priority or severity levels of alerts (Severity Tuning).
  • Provide evidence of improving quality integrity of our data used by detection rules (Data Quality).
  • Ensure the tuning includes necessary updates to the release documentation and versioning.

Rule Metadata Checks

  • updated_date matches the date of tuning PR merged.
  • min_stack_version should support the widest stack versions.
  • name and description should be descriptive and not include typos.
  • query should be inclusive, not overly exclusive. Review to ensure the original intent of the rule is maintained.

Testing and Validation

  • Validate that the tuned rule's performance is satisfactory and does not negatively impact the stack.
  • Ensure that the tuned rule has a low false positive rate.

@DefSecSentinel DefSecSentinel self-assigned this Feb 3, 2026
@tradebot-elastic
Copy link

tradebot-elastic commented Feb 3, 2026

⛔️ Test failed

Results
  • ❌ Potential Kerberos Attack via Bifrost (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Prompt for Credentials with Osascript (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Modification of Safari Settings via Defaults Command (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ✅ Attempt to Unload Elastic Endpoint Security Kernel Extension (eql)
  • ✅ Hosts File Modified (eql)
  • ❌ Potential Privacy Control Bypass via Localhost Secure Copy (eql)
    • stack_validation_failed: no_alerts - 0 alerts

@tradebot-elastic
Copy link

tradebot-elastic commented Feb 4, 2026

⛔️ Test failed

Results
  • ❌ Potential Kerberos Attack via Bifrost (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Prompt for Credentials with Osascript (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Modification of Safari Settings via Defaults Command (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ✅ Attempt to Unload Elastic Endpoint Security Kernel Extension (eql)
  • ✅ Hosts File Modified (eql)
  • ❌ Potential Privacy Control Bypass via Localhost Secure Copy (eql)
    • stack_validation_failed: no_alerts - 0 alerts

@tradebot-elastic
Copy link

tradebot-elastic commented Feb 4, 2026

⛔️ Test failed

Results
  • ❌ Potential Kerberos Attack via Bifrost (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Prompt for Credentials with Osascript (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ❌ Modification of Safari Settings via Defaults Command (eql)
    • stack_validation_failed: no_alerts - 0 alerts
  • ✅ Attempt to Unload Elastic Endpoint Security Kernel Extension (eql)
  • ✅ Hosts File Modified (eql)
  • ❌ Potential Privacy Control Bypass via Localhost Secure Copy (eql)
    • stack_validation_failed: no_alerts - 0 alerts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants