Skip to content

[New Rule/Tuning] Correlate Linux Web Server Compromise Signals - #7247

Open
Aegrah wants to merge 5 commits into
mainfrom
linux-web-server-compromise-correlation
Open

Aegrah wants to merge 5 commits into
mainfrom
linux-web-server-compromise-correlation

Conversation

@Aegrah

@Aegrah Aegrah commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Issue link(s): N/A

Summary - What I changed

  • Adds a Linux higher-order ES|QL rule that correlates suspicious and unusual web-server process alerts with unusual file creation on the same host within 10 minutes.
  • Uses weighted scoring while requiring at least three contributing alerts, a suspicious process alert, and at least two process-execution alerts.
  • Converts "Unusual Child Execution via Web Server" and "Unusual Command Execution via Web Server" to building-block rules for higher-order correlation.
  • Moves the two source rules into rules_building_block and adds the required BBR metadata, tags, timing bypass, and low-severity classification.

How To Test

  • python -m detection_rules toml-lint -f rules/linux/initial_access_potential_web_server_compromise_from_multiple_alerts.toml
  • python -m detection_rules validate-rule rules/linux/initial_access_potential_web_server_compromise_from_multiple_alerts.toml
  • python -m detection_rules validate-rule rules_building_block/persistence_webserver_unusual_child_execution.toml
  • python -m detection_rules validate-rule rules_building_block/persistence_webserver_unusual_command_execution.toml
  • Import and enable the five source rules and the higher-order rule, then verify that the unusual child and command signals are generated as building blocks and contribute to the correlation.

Checklist

  • Added applicable PR labels.
  • Secret and sensitive material has been managed correctly.
  • Automated testing was updated or added to match the most common scenarios.
  • Documentation and comments were added where required.

Contributor checklist

  • Signed the contributor license agreement.
  • Followed the contributor guidelines.

Aegrah and others added 2 commits November 26, 2026 13:34
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Aegrah Aegrah added OS: Linux Rule: New Proposal for new rule Rule: Tuning tweaking or tuning an existing rule bbr Building Block Rules labels Nov 26, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@Aegrah Aegrah self-assigned this Nov 26, 2026
@Aegrah Aegrah changed the title [New Rule] Correlate Linux Web Server Compromise Signals [New Rule/Tuning] Correlate Linux Web Server Compromise Signals Nov 26, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@Aegrah
Aegrah marked this pull request as ready for review November 26, 2026 14:24
Copilot AI balanced review requested due to automatic review settings November 26, 2026 14:24
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The correlation can trigger without a required suspicious-process alert and miss valid 10-minute alert chains because of host-wide aggregation and an insufficient lookback.

3 open issues
What changed in this PR

Adds a Linux higher-order detection that correlates web-server process and file alerts to identify potential compromise, supported by two existing rules converted to building blocks.

Changes:

  • Adds host-level ES|QL correlation with weighted scoring, a 10-minute duration limit, and alert suppression.
  • Converts unusual child and command execution rules to low-severity building blocks while preserving their detection queries.
  • Documents source-rule prerequisites and investigation guidance.
File Description
rules/​linux/​initial_access_potential_web_server_compromise_from_multiple_alerts.toml Adds weighted alert correlation and investigation guidance.
rules_building_block/​persistence_webserver_unusual_command_execution.toml Converts unusual command execution detection to a building block.
rules_building_block/​persistence_webserver_unusual_child_execution.toml Converts unusual child execution detection to a building block.

Review effort: Balanced

Comment on lines +20 to +21
from = "now-11m"
interval = "5m"
)
| WHERE Esql.alerts_count >= 3
AND Esql.process_alert_count >= 2
AND Esql.correlation_score >= 6
| WHERE Esql.alerts_count >= 3
AND Esql.process_alert_count >= 2
AND Esql.correlation_score >= 6
AND Esql.correlation_duration_seconds <= 600
Co-authored-by: Cursor <cursoragent@cursor.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

This branch has not been deployed

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

Labels

backport: auto bbr Building Block Rules currentrelease Domain: Endpoint OS: Linux Rule: New Proposal for new rule Rule: Tuning tweaking or tuning an existing rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants