Commit Graph

3532 Commits

Author SHA1 Message Date
Samirbous 116f48ccda [New] Elastic Defend Alert from Package Manager Install Ancestry (#5905)
* [New] Elastic Defend Alert from Package Manager Install Ancestry

Detects Elastic Defend alerts (behavior, malicious file, memory signature, shellcode) where the alerted process has a package-manager install context in its ancestry: npm (Node.js), PyPI (pip / Python / uv), or Rust (cargo). Install-time spawn chains are a common path for supply-chain and postinstall abuse; this Higher-Order rule surfaces Defend alerts
whose process tree includes such activity for prioritization.

* Update initial_access_elastic_defend_alert_package_manager_ancestor.toml

* Update rules/cross-platform/initial_access_elastic_defend_alert_package_manager_ancestor.toml

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>

* Update rules/cross-platform/initial_access_elastic_defend_alert_package_manager_ancestor.toml

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>

* Update initial_access_elastic_defend_alert_package_manager_ancestor.toml

---------

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
2026-03-31 23:33:46 +01:00
Ruben Groenewoud 62b60f9a78 [Rule Tuning] Curl or Wget Spawned via Node.js (#5904) 2026-03-31 18:36:59 +02:00
Terrance DeJesus c932ececd9 [Rule Tuning] M365 Identity Login from Atypical Travel Location - Reduce FP Noise (#5866)
* [Rule Tuning] M365 Identity Login from Atypical Travel Location - Reduce FP Noise
Fixes #5865

* removing CMSI for FNs
2026-03-26 16:03:38 -04:00
Terrance DeJesus 60beaff33f [Rule Tuning] Entra ID OAuth User Impersonation to Microsoft Graph (#5864)
* [Rule Tuning] Entra ID OAuth User Impersonation to Microsoft Graph
Fixes #5863

* Apply suggestion from @eric-forte-elastic

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>

* make sure sign in sources are not null

---------

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
2026-03-26 15:48:23 -04:00
github-actions[bot] d9890db6ff Lock versions for releases: 8.19,9.1,9.2,9.3 (#5888)
* Locked versions for releases: 8.19,9.1,9.2,9.3

* Update pyproject.toml

---------

Co-authored-by: Mikaayenson <Mikaayenson@users.noreply.github.com>
2026-03-26 12:31:50 -05:00
Ruben Groenewoud c6f843ef9d [New Rules] LiteLLM & Trivy TeamPCP Compromise (#5885)
* [New Rules] LiteLLM & Trivy TeamPCP Compromise

* ++

* Apply suggestion from @Samirbous

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>

* Apply suggestion from @Samirbous

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>

* ++

* ++

* Update rules/cross-platform/collection_data_encrypted_via_openssl.toml

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>

* Update rules/cross-platform/collection_data_encrypted_via_openssl.toml

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>

* ++

* ++

* ++

* ++

* Update rules/cross-platform/execution_suspicious_python_command_execution.toml

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/cross-platform/execution_suspicious_python_command_execution.toml

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/cross-platform/defense_evasion_data_encrypted_via_openssl.toml

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

* Update rules/cross-platform/defense_evasion_data_encrypted_via_openssl.toml

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

* ++

* ++

* ++

* ++

---------

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2026-03-26 11:16:30 -05:00
Terrance DeJesus a8033e14aa rule tuning add ICP blockchain indicator (#5887) 2026-03-26 11:09:51 -05:00
Ruben Groenewoud befd78524e [Rule Tuning] Python Path File (pth) Creation (#5880)
* [Rule Tuning] Python Path File (pth) Creation

* ++

* ++

* ++

---------

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2026-03-26 10:56:56 -05:00
Terrance DeJesus cd19b25485 [New Rule] M365 Azure Monitor Alert Email with Financial or Billing Theme (#5878)
* [New Rule] M365 Azure Monitor Alert Email with Financial or Billing Theme
Fixes #5877

* adding microsoft_exchange_online_message_trace to manifests/schemas; bumping patch

* updated mitre

* Update rules/integrations/microsoft_exchange_online_message_trace/initial_access_azure_monitor_callback_phishing_email.toml

Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>

* bumping patch

---------

Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>
2026-03-26 10:50:15 -05:00
Samirbous 06ea087363 [Tuning] Multiple Cloud Secrets Accessed by Source Address (#5884)
* Update credential_access_multi_could_secrets_via_api.toml

* Update credential_access_multi_could_secrets_via_api.toml

* Update credential_access_multi_could_secrets_via_api.toml

* Apply suggestion from @Mikaayenson

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

* Apply suggestion from @Mikaayenson

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2026-03-26 10:49:19 -05:00
Terrance DeJesus a08d6b4ff7 [Rule Tuning] Entra ID Federation Abuse to Production (#5881)
* [Rule Tuning] Entra ID Federation Abuse to Production

* adjusted file name

---------

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2026-03-26 10:45:12 -05:00
Terrance DeJesus 18a28762bf [Rule Tuning] M365 SharePoint/OneDrive File Access via PowerShell - Convert to new_terms (#5873)
Fixes #5872
2026-03-26 11:28:36 -04:00
Samirbous 5d5e1d9ca4 [Tuning] Expand compatibility to extra OS (#5883)
* Update and rename exfiltration_potential_curl_data_exfiltration.toml to exfiltration_potential_curl_data_exfiltration.toml

* Update exfiltration_potential_curl_data_exfiltration.toml

* Update exfiltration_potential_curl_data_exfiltration.toml

* Update exfiltration_potential_curl_data_exfiltration.toml

* Update execution_kubernetes_direct_api_request_via_curl_or_wget.toml

* ++

* ++

* Update rules/cross-platform/execution_kubernetes_direct_api_request_via_curl_or_wget.toml

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>

* Update rules/cross-platform/discovery_kubectl_secrets_all_namespaces.toml

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>

* Update rules/cross-platform/exfiltration_potential_curl_data_exfiltration.toml

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
2026-03-26 12:10:17 +00:00
Samirbous 09a3c0c813 [New] Potential Credential Discovery via Recursive Grep (#5882)
* [New] Potential Credential Discovery via Recursive Grep

Identifies recursive grep activity on Linux or macOS where the command line suggests hunting for secrets, credentials,
keys, tokens, or sensitive paths (for example .env, .git, .aws). Events are aggregated per host, user, parent process, and one-minute window, the rule surfaces activity only when at least three distinct grep command lines match in the same bucket, to reduce noise from one-off searches.

* Update credential_access_grep_recursive_credential_discovery.toml

* Update rules/cross-platform/credential_access_grep_recursive_credential_discovery.toml

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

* Update rules/cross-platform/credential_access_grep_recursive_credential_discovery.toml

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

* Update credential_access_grep_recursive_credential_discovery.toml

* Update credential_access_grep_recursive_credential_discovery.toml

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2026-03-26 11:27:33 +00:00
Eric Forte 75ffa5ec4e [FR] [DaC] Add fine-grained bypass env var for ES|QL keep and metadata validation (#5869)
* Add fine grain 'keep' req bypass

* Add metadata bypass
2026-03-24 14:36:45 -04:00
github-actions[bot] b14dec9efa Lock versions for releases: 8.19,9.1,9.2,9.3 (#5875) 2026-03-23 23:45:25 +05:30
shashank-elastic 07ccecb94b Add investigation guide for database dumping activity (#5871) 2026-03-23 22:22:52 +05:30
Samirbous 057fe30199 [New] RMM Rules (#5848) 2026-03-23 22:11:52 +05:30
Jonhnathan 3ce89a3ccf [Rule Tuning] Sensitive Audit Policy Sub-Category Disabled (#5859)
* [Rule Tuning] Sensitive Audit Policy Sub-Category Disabled

* ++

* Update rules/windows/defense_evasion_audit_policy_disabled_winlog.toml

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Apply suggestion from @w0rk3r

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
Co-authored-by: Colson Wilhoit <48036388+DefSecSentinel@users.noreply.github.com>
2026-03-23 13:25:35 -03:00
Jonhnathan 38e1456eca [Rule Tuning] Misc Rule Tuning (#5858)
* [Rule Tuning] Misc Rule Tuning

* Update defense_evasion_elastic_agent_service_terminated.toml
2026-03-23 13:01:06 -03:00
Terrance DeJesus 4217c76ed4 [Rule Tuning] M365 Exchange Inbox Forwarding Rule Created (#5852)
* [Rule Tuning] M365 Exchange Inbox Forwarding Rule Created

* adding back filebeat

* adjusted tags

* Update rules/integrations/o365/collection_exchange_new_inbox_rule.toml

Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>

---------

Co-authored-by: Colson Wilhoit <48036388+DefSecSentinel@users.noreply.github.com>
Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>
2026-03-23 10:25:58 -04:00
Terrance DeJesus c0abe39f8a [Rule Tuning] Remove OIDC email scope from Microsoft Graph Email Access Rule (#5856)
* [Rule Tuning] Remove OIDC email scope from Microsoft Graph Email Access Rule

* removing mailboxSettings FPs

* updated query optimization & format
2026-03-23 10:08:47 -04:00
Terrance DeJesus 53553e0bfb [Rule Tuning] Microsoft Graph Request User Impersonation by Unusual Client (#5861) 2026-03-23 09:46:40 -04:00
Eric Forte 24dc5af02f Initial DaC Issue Template (#5854) 2026-03-23 08:56:29 -04:00
Samirbous 062a065722 [Tuning] Add Missing executable file extensions (#5857)
Add Missing executable file extensions such as execution_windows_script_from_internet.toml didn't cover wsf and sct.
2026-03-23 12:23:51 +00:00
Samirbous e788ab7e73 [New/tuning] WarLock coverage (#5846)
* [New/tuning] WarLock coverage

Improve coverage for https://www.trendmicro.com/tr_tr/research/26/c/dissecting-a-warlock-attack.html

* ++

* Update command_and_control_velociraptor_shell_execution.toml

* Update command_and_control_tunnel_cloudflared.toml

* Update command_and_control_tunnel_yuze.toml

* Update command_and_control_velociraptor_shell_execution.toml

* Update exfiltration_rclone_cloud_upload.toml

* Update rules/windows/exfiltration_rclone_cloud_upload.toml

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>

* Update rules/windows/command_and_control_velociraptor_shell_execution.toml

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>

* Update command_and_control_tunnel_vscode.toml

* Update command_and_control_tunnel_yuze.toml

* Update command_and_control_tunnel_yuze.toml

---------

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2026-03-23 11:01:12 +00:00
Samirbous 7bde0a9d2d [Tuning] Mis Rules Tuning (#5817)
* [Tuning] Mis Rules Tuning

tuning of recently created or tuned rules.

* Apply suggestion from @Mikaayenson

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

* Update command_and_control_dns_rmm_domains_non_browser.toml

* Update credential_access_bruteforce_admin_account.toml

* ++

* ++

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2026-03-23 10:49:23 +00:00
Ruben Groenewoud 5216bf2d0c [New Rules] AppArmor Exploitation (CrackArmor) (#5842)
* [New Rule] AppArmor Profile Compilation via apparmor_parser

* [New Rule] Suspicious Write Attempt to AppArmor Policy Management Files

* ++

* 2 more rules for Auditd

* ++

* Update defense_evasion_apparmor_profile_compilation.toml

* Apply suggestion from @Aegrah

* Update rules/linux/defense_evasion_apparmor_profile_compilation.toml
2026-03-23 09:37:42 +01:00
Samirbous 02adbfb2b0 [New / Tuning] LeakNet cov (#5850)
* [Tuning] LeakNet cov

https://reliaquest.com/blog/threat-spotlight-casting-a-wider-net-clickfix-deno-and-leaknets-scaling-threat

* Update execution_susp_javascript_via_deno.toml

* Update execution_susp_javascript_via_deno.toml

* Apply suggestion from @w0rk3r

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>

* Apply suggestion from @w0rk3r

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>

* Apply suggestion from @w0rk3r

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>

* Update execution_susp_javascript_via_deno.toml

---------

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2026-03-20 21:11:26 +00:00
Mika Ayenson, PhD ade7de7be4 [New Rules] External Promotion Alert for IBM QRadar (#5843) 2026-03-20 14:42:43 -05:00
Ruben Groenewoud de6eb0f10d [New Rule] Potential snap-confine Privilege Escalation via CVE-2026-3888 (#5845)
* [New Rule] Potential snap-confine Privilege Escalation via CVE-2026-3888

* Added IG

* ++

* ++

* IG fix
2026-03-20 09:34:17 +01:00
Ruben Groenewoud 71bcbef8d0 [Rule Tuning] Tuning Host Name to Agent Name for Compatibility (#5849)
* [Rule Tuning] Tuning Host Name to Agent Name for Compatibility

* ++
2026-03-19 14:43:34 +01:00
Ruben Groenewoud a4b614c681 [New/Tuning] New DB Dump Rule & Tuning wget/curl DRs (#5832)
* [Rule Tuning] Tuning wget/curl DRs

* [New Rule] Potential Database Dumping Activity

* Update exfiltration_potential_curl_data_exfiltration.toml

* Expand URL patterns in curl data exfiltration rule

* Update rules/linux/exfiltration_potential_wget_data_exfiltration.toml

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>

* Simplify process name conditions for database dumping

---------

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2026-03-19 13:57:34 +01:00
Isai e49a3f0310 [New Rule] AWS API Activity from Uncommon S3 Client by Rare User (#5694)
* [New Rule] AWS API Activity from S3 Browser Client

Detects AWS API activity originating from the S3 Browser application based on the user agent string. S3 Browser is a Windows-based graphical client for managing S3 buckets that is rarely used in enterprise environments but has been observed in use by threat actors for data exfiltration due to its ease of use and bulk download capabilities. This rule was inspired by the Permiso LUCR-3 research which documented Scattered Spider using S3 Browser (v10.9.9) for data theft operations. No usage captured in alert telemetry and only one user utilized this browser in prod data.

Existing Related Coverage: We have several S3-related exfiltration rules covering bucket replication, policy modifications, and ransomware indicators. This new rule closes a gap by detecting a specific attacker tooling fingerprint rather than relying solely on behavioral patterns.

* Update rules/integrations/aws/exfiltration_s3_browser_user_agent.toml

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>

* [New Rule] AWS API Activity from Uncommon S3 Client by Rare User

This rule detects AWS API activity from S3 Browser and Cyberduck desktop clients based on user agent strings. Both are graphical S3 management tools that provide bulk upload/download capabilities and have been observed in use by threat actors for data exfiltration. S3 Browser usage is specifically documented in the Permiso blog on LUCR-3 (Scattered Spider), while Cyberduck is referenced in the MITRE ATT&CK Threat Emulation of Scattered Spider. The rule uses a New Terms approach on cloud.account.id and user.name to alert only on the first occurrence per user/account, reducing noise from repeated GetObject or PutObject operations while still capturing new suspicious tool usage.
No existing rules currently detect activity based on these specific S3 client user agents. This fills a gap in detecting exfiltration tooling commonly used in post-compromise data theft operations.

* adding space to S3 Browser

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
2026-03-18 18:07:15 -04:00
Isai 7ae298005d [Bug] KQL Validation Add Wildcard w/ Space token value (#5753)
* [Bug] KQL Validation Add Wildcard w/ Space token value

## Summary
Fixes KQL parser to support wildcard values containing spaces (e.g., `*S3 Browser*`), which work in Kibana but were rejected by our unit tests.

**Issue:** #5750

## Changes

### Grammar (`lib/kql/kql/kql.g`)
- Added `WILDCARD_LITERAL` token with priority 3 to match wildcard patterns containing spaces
- Uses negative lookahead to stop before `or`/`and`/`not` keywords
- Added to `value` rule (not `literal`) so field names remain unaffected

### Parser (`lib/kql/kql/parser.py`)
- Handle new `WILDCARD_LITERAL` token type as wildcards
- Quoted strings (`"*text*"`) now treated as literals, matching Kibana behavior

## Behavior

| Query | Before | After |
|-------|--------|-------|
| `field: *S3 Browser*` |  Parse error |  Wildcard |
| `field: *test*` |  Wildcard |  Wildcard |
| `common.*: value` |  Works |  Works |
| `field: "*text*"` | Wildcard |  Literal (matches Kibana) |

## Test plan
- [x] All 63 existing KQL unit tests pass
- [x] New wildcard-with-spaces patterns parse correctly
- [x] Wildcard field names (`common.*`) still work
- [x] Keywords (`or`, `and`, `not`) correctly recognized as separators
- [x] Tested against rule file from PR #5694

* update pyproject version

* update kibana and kql pyproject.toml versions

update kibana and kql pyproject.toml versions

* update wildcard_literal pattern to account for false matches with leading keywords

Add Negative lookahead at start of Pattern 2 - uses (?!(?:or|and|not)\b) at the start to prevent matching values that begin with keywords like 'not /path*'

* adding NOT keyword token and support for wildcard in the middle of spaced phrase

# KQL Parser Changes - Wildcard Spaces and NOT Prefix Fix

## Overview

This update fixes two issues in the KQL parser:
1. **Wildcard values with spaces** - Values like `*S3 Browser*` now parse correctly
2. **NOT prefix false match** - Values like `not /tmp/go-build*` are no longer incorrectly consumed as a single wildcard literal

## Files Modified

### `lib/kql/kql/kql.g` (Grammar)

**Added `optional_not` rule** to handle `NOT` as an explicit grammar element:
```
?list_of_values: "(" or_list_of_values ")"
| optional_not value
?optional_not: NOT optional_not
|
```

**Expanded `WILDCARD_LITERAL`** with 4 patterns to support all wildcard-with-space cases:

| Pattern | Description | Example |
|---------|-------------|---------|
| 1 | Starts with `*` | `*S3 Browser`, `*S3 Browser*` |
| 2 | Ends with `*` (doesn't start with `*`) | `S3 Browser*` |
| 3a | `*` appears after a space | `S3 B*owser` |
| 3b | `*` appears before a space | `S3* Browser` |

### `lib/kql/kql/parser.py`

Added methods to handle the new grammar rules:
- `list_of_values()` - handles `optional_not value` structure
- `optional_not()` - counts NOT occurrences and wraps values with `NotValue`

### `lib/kql/kql/kql2eql.py`

Added corresponding methods for EQL conversion:
- `list_of_values()` - handles `optional_not value` structure
- `optional_not()` - counts NOT occurrences and wraps with `eql.ast.Not`

## Test Results

All 63 kuery tests pass. Verified wildcard cases:

| Input | Result |
|-------|--------|
| `field: *S3 Browser*` | `field:*S3\ Browser*` |
| `field: S3 Browser*` | `field:S3\ Browser*` |
| `field: *S3 Browser` | `field:*S3\ Browser` |
| `field: S3 B*owser` | `field:S3\ B*owser` |
| `field: S3* Browser` | `field:S3*\ Browser` |
| `field: foo* bar* baz` | `field:foo*\ bar*\ baz` |
| `process.executable: not /tmp/go-build*` | `not process.executable:/tmp/go-build*` |
| `field < value` | `field < value` (range expression, not wildcard) |

## Technical Notes

### Pattern 3a Fix
Pattern 3a requires at least one character AFTER the `*` (uses `[...]+` instead of `[...]*`). This prevents Pattern 2 from incorrectly matching shorter strings like `S3 B*` when the full value is `S3 B*owser`.

### NOT Keyword Handling
The `optional_not` grammar approach explicitly parses `NOT` as a keyword before the value, preventing it from being consumed as part of a wildcard literal. This is safer than regex-only approaches because:
- `NOT` token only matches the exact word "not" (case-insensitive)
- Values like `notafile*` are still parsed as `UNQUOTED_LITERAL`
- Edge case: literal value "not" must be quoted: `field: "not"`

* Changes to Addresses Review Comments

### Changes to Addresses Review Comments @Mikaayenson

1. **Fixed regex patterns to prevent trailing whitespace capture** (`kql.g`)
   - Added `(?=\s|$|[()":{}])` lookahead to all WILDCARD_LITERAL patterns
   - This ensures patterns stop at boundaries without capturing trailing whitespace

2. **Removed `.rstrip()` workaround** (`parser.py`)
   - No longer needed since regex now handles boundaries correctly

3. **Added explicit WILDCARD_LITERAL handling** (`kql2eql.py`)
   - Now checks `token.type == "WILDCARD_LITERAL"` explicitly
   - Mirrors the approach used in `parser.py`

4. **Added unit tests** (`tests/kuery/test_parser.py`)
   - `test_wildcard_with_spaces` - all 4 WILDCARD_LITERAL patterns
   - `test_wildcard_with_spaces_and_keywords` - wildcards with `and`/`or` boundaries
   - `test_not_prefix_with_wildcard` - NOT keyword not consumed as wildcard
   - `test_quoted_wildcard_as_literal` - quoted wildcards are literal strings
   - `test_triple_not_optimization` - `not not not foo` → `not foo`

* changed test directory from tmp

* changed format of new tests

* Update pyproject.toml

Update pyproject.toml

---------

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
2026-03-18 17:38:24 -04:00
Terrance DeJesus f84617ba8e bumping date (#5847) 2026-03-18 17:22:55 -04:00
Davis Plumlee cb5b89f83e [FR] Includes deprecated rule stubs to the package for upstream testing (#5813)
* adds scripting to include deprecated rule stubs in package

* remove deprecated manifest from package

* adds 9.4 gate

* bump version

* fix merge conflict

* test

* revert commit hash

* adds deprecated_reason logic from comment

* fix lint error

* fix lint error

* fix formatting

* test

* revert commit hash

* Update detection_rules/packaging.py

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2026-03-18 14:34:25 -05:00
Samirbous 7bd2e2911c Update command_and_control_common_webservices.toml (#5831)
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2026-03-18 09:38:29 -03:00
Ruben Groenewoud 8b140d5811 [Rule Tuning] Added Traefik Compatibility to Web Server Access Rules (#5837)
* [Rule Tuning] Added Traefik Compatibility to Web Server Access Rules

* ++

* Bump pyproject.toml

* Bump pyproject.toml
2026-03-17 17:28:47 +01:00
Ruben Groenewoud 5d3e17eaff [Rule Tuning] Dynamic Linker Copy (#5841) 2026-03-17 17:12:08 +01:00
Colson Wilhoit 49b660a135 [New Rules] New Terms rules for malicious Python/Pickle model activity on macOS (#5780)
* [New Rules] New Terms rules for malicious Python/Pickle model activity on macOS

Adds three new_terms SIEM detection rules to close the detection gap identified in ia-trade-team#666 where malicious pickle/PyTorch model files execute arbitrary commands via Python deserialization without triggering existing GenAI-parent-gated endpoint rules.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Address PR feedback: broaden descriptions and simplify process.name

- Update descriptions across all three rules to not over-attribute to
  pickle/PyTorch — these rules detect any malicious Python activity
  (scripts, compromised dependencies, model deserialization, etc.)
- Simplify process.name from explicit enumeration to python* wildcard
  since KQL matching is case-insensitive
- Update investigation guides to reflect broader scope of potential
  attack vectors

Made-with: Cursor

* Apply suggestion from @DefSecSentinel

* Apply suggestion from @DefSecSentinel

* Apply suggestion from @DefSecSentinel

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-03-17 10:59:08 -05:00
Terrance DeJesus 937a7a35e6 [New Rule] Azure Arc Kubernetes Cluster Connect Abuse (#5824)
* [New Rule] Azure Arc Kubernetes Cluster Connect Abuse
Fixes #5823

* rename, adjusted query

* adding KEEP *

* adjusting maturity

* added to non-ecs schema

* updating rule

* addressing unit test failures

* adjustments to logic, mitre mappings, unit test failures, etc.

* Update rules/integrations/azure/initial_access_azure_arc_cluster_credential_access_unusual_source.toml

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2026-03-17 11:06:47 -04:00
Terrance DeJesus 4091323e0d [New Rule] M365 SharePoint Site Administrator Added (#5806)
* [New Rule] M365 SharePoint Site Administrator Added

* Update rules/integrations/o365/privilege_escalation_sharepoint_site_collection_admin_added.toml

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>

---------

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
2026-03-17 10:49:24 -04:00
Isai 3b59030211 [New Rule] AWS CloudShell Environment Created (#5830)
## Summary

This PR adds a new detection rule for AWS CloudShell environment creation, based on the **T1059.009 - Command and Scripting Interpreter: Cloud API** technique as documented in the [AWS Threat Technique Catalog](https://aws-samples.github.io/threat-technique-catalog-for-aws/Techniques/T1059.009.html).

AWS CloudShell is a browser-based shell that provides command-line access to AWS resources directly from the AWS Management Console. While convenient for administrators, CloudShell can be abused by adversaries who gain access to compromised console sessions to execute commands, install tools, or interact with AWS services without needing local CLI credentials.

This rule detects the `CreateEnvironment` API call, which occurs when:
- A user launches CloudShell for the **first time**
- A user accesses CloudShell in a **new AWS region** (each region maintains a separate environment)

### Why `CreateEnvironment` instead of `CreateSession`?
`
While both `CreateEnviroment` and `CreateSession` are noted in the catalog for this technique, during testing I observed that:
- **`CreateEnvironment`** is called when a new CloudShell environment is created (first-time user OR new region)
- **`CreateSession`** is called when reconnecting to an existing CloudShell environment that was previously created

By focusing on `CreateEnvironment`, we capture the meaningful signal (new environment creation) while avoiding noise from users simply reconnecting to existing sessions.
2026-03-17 08:46:59 -04:00
Mika Ayenson, PhD 49c9c283e6 [FR] Reset deprecated lock to the latest state during lock (#5827) 2026-03-16 17:04:56 -05:00
Terrance DeJesus d74c83140b [Maintenance] Update .gitignore for AI Artifacts (Skills, MCP, etc.) (#5833)
* Ignore AI Artifacts

* Update .gitignore

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2026-03-13 13:08:19 -04:00
Mika Ayenson, PhD 721ef0b9c7 [Rule Tuning] Misc GenAI Tuning (#5825)
* tune credential_access_genai_process_sensitive_file_access.toml to reduce 74% noise on local state

* tune defense_evasion_genai_config_modification.toml to conservatively reduce noise by 19% on file.path

* tune command_and_control_genai_process_unusual_domain.toml to reduce 34% noise by domains

* tune execution_openclaw_agent_child_process.toml to address 99 % of noise with ip/arp
2026-03-11 11:46:33 -05:00
Eric Forte ce3916f99f Bump minor version (#5822) 2026-03-10 13:39:49 -04:00
Eric Forte 57bf1546dd [Bug] [DAC] Add filtering to export-rules-from-repo (#5769)
* Add filtering to export-rules-from-repo
2026-03-10 13:03:52 -04:00
Terrance DeJesus 1d3dad243c [Rule Tuning] Entra ID OAuth Device Code Grant by Unusual User (#5791)
* [Rule Tuning] Entra ID OAuth Device Code Grant by Unusual User
Fixes #5790

* updated description and investigation guide
2026-03-10 10:37:38 -04:00