Repository navigation
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Starting the rule tests ... |
|
Starting the rule tests ... |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Starting the rule tests ... |
Aegrah
requested review from
Samirbous,
bryans3c,
litemars and
terrancedejesus
November 26, 2026 14:25
Removed references to outdated URLs for unusual execution rules.
|
Starting the rule tests ... |
|
Starting the rule tests ... |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active findings identify a recency-window boundary that can cause false alerts, rejection of delayed-ingestion events, and aggregation that can combine fields from different executions into a misleading process context.
3 open issues
What changed in this PR
Adds a Linux ES|QL detection rule for newly observed command lines launched directly by systemd, cron, or crond, complementing existing signature-based persistence detections.
Changes:
- Groups activity by agent and exact command line using seven days of history plus a ten-minute scheduling guard.
- Preserves investigation context and suppresses repeated alerts for one hour.
- Documents telemetry requirements, triage steps, and the distinction between systemd service and timer execution.
| File | Description |
|---|---|
rules/linux/persistence_newly_observed_systemd_cron_command_line.toml |
Adds the detection query, scheduling, suppression, threat mappings, and investigation guide. |
Review effort: Balanced
Comment on lines
+115
to
+127
| Esql.first_time_seen = MIN(@timestamp), | ||
| Esql.last_time_seen = MAX(@timestamp), | ||
| Esql.host_id_values = VALUES(host.id), | ||
| Esql.host_name_values = VALUES(host.name), | ||
| Esql.user_name_values = VALUES(user.name), | ||
| Esql.process_entity_id_values = VALUES(process.entity_id), | ||
| Esql.process_executable_values = VALUES(process.executable), | ||
| Esql.process_working_directory_values = VALUES(process.working_directory), | ||
| Esql.process_parent_name_values = VALUES(process.parent.name), | ||
| Esql.process_parent_executable_values = VALUES(process.parent.executable), | ||
| Esql.process_parent_command_line_values = VALUES(process.parent.command_line) | ||
| BY agent.id, process.command_line | ||
| | EVAL Esql.first_seen_minutes_ago = DATE_DIFF("minute", Esql.first_time_seen, NOW()) |
| Esql.process_parent_command_line_values = VALUES(process.parent.command_line) | ||
| BY agent.id, process.command_line | ||
| | EVAL Esql.first_seen_minutes_ago = DATE_DIFF("minute", Esql.first_time_seen, NOW()) | ||
| | WHERE Esql.first_seen_minutes_ago >= 0 AND Esql.first_seen_minutes_ago <= 10 |
Comment on lines
+132
to
+136
| user.name = MV_FIRST(Esql.user_name_values), | ||
| process.entity_id = MV_FIRST(Esql.process_entity_id_values), | ||
| process.executable = MV_FIRST(Esql.process_executable_values), | ||
| process.parent.name = MV_FIRST(Esql.process_parent_name_values), | ||
| process.parent.executable = MV_FIRST(Esql.process_parent_executable_values) |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Starting the rule tests ... |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request
Issue link(s): N/A
Summary - What I changed
systemd,cron, orcrondwhen it has not been observed on the sameagent.idduring the previous seven days.systemdparent can represent an ordinary service or transient unit and does not necessarily prove timer execution.How To Test
python -m detection_rules toml-lint -f rules/linux/persistence_newly_observed_systemd_cron_command_line.tomlpython -m detection_rules validate-rule rules/linux/persistence_newly_observed_systemd_cron_command_line.tomlChecklist
Contributor checklist