Skip to content

[New] Multiple Elastic Defend Alerts with Agentic Intent IDs - #7251

Open
Samirbous wants to merge 10 commits into
mainfrom
art26nov
Open

Samirbous wants to merge 10 commits into
mainfrom
art26nov

Conversation

@Samirbous

Copy link
Copy Markdown
Contributor

Detects a host with three or more Elastic Defend behavior alerts in an hour whose command line, parent command line, or executable path carries an agentic-framework intent ID. The ID is the unpadded counter ARTEX-family harnesses embed in filenames and comments, shaped like i42463_dbg.b64 or i43345sys. A single match is too common. The rule counts alerts on one host.id inside the one-hour lookback.

Detects a host with three or more Elastic Defend behavior alerts in an hour whose command line, parent command line, or executable path carries an agentic-framework intent ID. The ID is the unpadded counter ARTEX-family harnesses embed in filenames and comments, shaped like i42463_dbg.b64 or i43345sys. A single match is too common. The rule counts alerts on one host.id inside the one-hour lookback.
@Samirbous Samirbous self-assigned this Nov 26, 2026
Copilot AI balanced review requested due to automatic review settings November 26, 2026 13:26
@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 rule’s regexes allow bypassing the documented 16-character suffix limit, and its 9.4.0 minimum unnecessarily excludes supported 8.19 installations.

2 open issues
What changed in this PR

Adds a cross-platform ES|QL correlation rule to identify possible ARTEX-family activity from Elastic Defend behavior alerts containing agentic intent IDs.

Changes:

  • Requires at least three matching alerts from two distinct behavior rules on one host within an hour.
  • Runs every five minutes and suppresses repeat alerts for the same host for one hour.
  • Includes investigation guidance, false-positive advice, and MITRE ATT&CK Execution mappings.
File Description
rules/​cross-platform/​execution_multiple_endpoint_alerts_agentic_intent_id.toml Adds the correlation query, scheduling, suppression, and investigation guidance.

Review effort: Balanced

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

An underscore was both a token character and a trailing separator, so a long suffix could still match.

Co-authored-by: Cursor <cursoragent@cursor.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

A command line with three or more echo === labels is the same harness shape. Diagnostic rules stay out of the count.

Co-authored-by: Cursor <cursoragent@cursor.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

A label followed by && is an admin playbook. The harness form is echo ===label===;

Co-authored-by: Cursor <cursoragent@cursor.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

Esql.file_path_values = values(file.path),
Esql.user_name_values = values(user.name)
by host.id
| where Esql.alert_count >= 10 or Esql.rule_name_count_distinct >= 2

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.

Just double checking, I expect we want these numbers rather than the ones in the PR summary?

@eric-forte-elastic eric-forte-elastic 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.

Looks good to me 👍

Comment on lines +81 to +89
// Lucene RLIKE is a whole-string match and has no lookaround.
// i + 4-7 digits + at most 16 token characters. Underscore stays inside the token.
// Three or more echo "===section===" banners, each ending in ;. A label followed by && does not match.
| where process.command_line rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.parent.command_line rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.executable rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.parent.executable rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or file.path rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.command_line rlike "((.|\n|\r)*echo[^A-Za-z0-9\n\r]{0,3}={3}[^=\n\r]{1,80}={3}[^A-Za-z0-9\n\r;]{0,3};(.|\n|\r)*){3}"

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.

Suggested change
// Lucene RLIKE is a whole-string match and has no lookaround.
// i + 4-7 digits + at most 16 token characters. Underscore stays inside the token.
// Three or more echo "===section===" banners, each ending in ;. A label followed by && does not match.
| where process.command_line rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.parent.command_line rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.executable rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.parent.executable rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or file.path rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.command_line rlike "((.|\n|\r)*echo[^A-Za-z0-9\n\r]{0,3}={3}[^=\n\r]{1,80}={3}[^A-Za-z0-9\n\r;]{0,3};(.|\n|\r)*){3}"
// Lucene RLIKE is a whole-string match and has no lookaround.
// Arm 1: i + 4-7 digits + at most 16 token characters (e.g. i42693_logon.txt).
// Arm 2: Wiz-style anchored bare IDs (e.g. probe_i21481, artex-i42463).
// Arm 3: path-shaped bare IDs (e.g. /tmp/i21481/, Temp\i44184\). Not fully open bare iNNNN.
// Three or more echo "===section===" banners, each ending in ;. A label followed by && does not match.
| where process.command_line rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.command_line rlike ".*(artex|pentest|probe|canary)[-_]?i[0-9]{4,7}([^A-Za-z0-9].*)?"
or process.command_line rlike ".*[/\\\\]i[0-9]{4,7}([/\\\\].*)?"
or process.parent.command_line rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.parent.command_line rlike ".*(artex|pentest|probe|canary)[-_]?i[0-9]{4,7}([^A-Za-z0-9].*)?"
or process.parent.command_line rlike ".*[/\\\\]i[0-9]{4,7}([/\\\\].*)?"
or process.executable rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.executable rlike ".*(artex|pentest|probe|canary)[-_]?i[0-9]{4,7}([^A-Za-z0-9].*)?"
or process.executable rlike ".*[/\\\\]i[0-9]{4,7}([/\\\\].*)?"
or process.parent.executable rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or process.parent.executable rlike ".*(artex|pentest|probe|canary)[-_]?i[0-9]{4,7}([^A-Za-z0-9].*)?"
or process.parent.executable rlike ".*[/\\\\]i[0-9]{4,7}([/\\\\].*)?"
or file.path rlike "(.*[^A-Za-z0-9])?i[0-9]{4,7}[A-Za-z_][A-Za-z0-9_]{0,15}([^A-Za-z0-9_].*)?"
or file.path rlike ".*(artex|pentest|probe|canary)[-_]?i[0-9]{4,7}([^A-Za-z0-9].*)?"
or file.path rlike ".*[/\\\\]i[0-9]{4,7}([/\\\\].*)?"
or process.command_line rlike "((.|\n|\r)*echo[^A-Za-z0-9\n\r]{0,3}={3}[^=\n\r]{1,80}={3}[^A-Za-z0-9\n\r;]{0,3};(.|\n|\r)*){3}"

wdyt?

@@ -0,0 +1,140 @@
[metadata]
creation_date = "2026/11/26"

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.

Suggested change
creation_date = "2026/11/26"
creation_date = "2026/11/30"

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants