Commit Graph

3547 Commits

Author SHA1 Message Date
Jonhnathan a950f4738e [Rule Tuning] Windows High-Severity Rules Revamp - 2 (#5900)
* [Rule Tuning] Windows High-Severity Rules Revamp - 2

* ++

* Compress guides

* ++

* ++
2026-04-06 13:06:24 -03:00
Jonhnathan 2c42c12c26 [Rule Tuning] Windows High-Severity Rules Revamp - 1 (#5899)
* [Rule Tuning] Windows High-Severity Rules Revamp - 1

* ++

* Guide compression

* ++

* revert unit test removal

* Apply suggestion from @w0rk3r

* Update command_and_control_headless_browser.toml

---------

Co-authored-by: shashank-elastic <91139415+shashank-elastic@users.noreply.github.com>
2026-04-06 12:30:43 -03:00
Isai a6d31d7dfd [New Rules] AWS IAM Long-Term Creds Abuse Coverage (#5918)
* [New Rules] AWS Long-Term Creds Abuse Coverage

This adds a two-layer approach to long-term IAM access key (AKIA*) abuse, aligned with reporting on stolen or leaked keys often abused as seen in Kudelski Security — Trivy supply-chain report.

### Layer 1 — AWS Long-Term Access Key First Seen from Source IP (9f8e3c5e-f72e-4e91-93f6-e98a4fae3e4f)
New Terms on CloudTrail when a given AKIA succeeds from a new `source.ip` in the history window.
Goal: catch novel use of a durable key (travel, new egress, or attacker infrastructure).

### Layer 2 — AWS Long-Term Access Key Correlated with Elevated Detection Alerts
Higher-order rule on open alerts that requires both the Layer 1 rule and at least one other open alert on the same `source.ip` at medium+ severity (or equivalent risk score).
Goal: raise priority when “new IP for this key” happens together with stronger, post-compromise-style signals.

The higher-order rule correlates on `source.ip` in .alerts-security.* index. In testing, I chose to tie the same sessions together using `source.ip` vs `access_key.id` because the alerts index did not expose this field for queries.

Screenshots below show testing that verified the approach. The same operator/session across Layer 1 rule, the sibling alert, and the Layer 2 correlation rule for two separate lab scenarios (e.g. a high-severity sibling rule and a  medium-severity sibling rule).

* adding IAM to rule names

* removing unnecessary ref

* Fixed Mitre tactics and tags

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2026-04-06 10:36:39 -04:00
Isai ca821414a4 [New Rule] AWS S3 Rapid Bucket Posture API Calls from a Single Principal (#5911)
* [New Rule] AWS S3 Rapid Bucket Posture API Calls from a Single Principal

Detects the same principal (`aws.cloudtrail.user_identity.arn`) from the same `source.ip` successfully calling a tight set of read-only S3 management APIs: ``` GetBucketAcl, GetBucketPublicAccessBlock, GetBucketPolicy, GetBucketPolicyStatus, GetBucketVersioning ``` against more than 15 distinct buckets (`aws.cloudtrail.resources.arn`) within a 10-second window.

The idea is grounded in cloud reconnaissance and scanner-style behavior discussed in Kudelski Security’s analysis of the Trivy supply chain story and related cloud activity. It explicitly called out automated assessment tooling and posture-oriented API use across ~24 buckets in a short time. It also highlighted the user's blind spot in telemetry with no Data events captured for S3 buckets. So would need to rely on management APIs for detection.

All our existing detections related to S3 rely on Data events and we have no explicit detections for scanner style recon sweeps as described in this threat report.

### Rule Design

- ES|QL with date_trunc(10 seconds, …) and count_distinct(aws.cloudtrail.resources.arn) grouped by time bucket, identity ARN, and source.ip.
- Management level API calls that are commonly used to identify bucket posture including public accessibility status and whether or not versioning is enabled (necessary info for ransomeware objectives)
- Excludes AWSService, requires source.ip, non-null aws.cloudtrail.resources.arn and user_identity.arn, and session_credential_from_console IS NULL to capture programmatic sessions over console behavior.
- Threshold 15 after evaluating rule in production environment to reduce noise from benign scanners and automation.
- low severity as this rule is FP prone until users add exclusions for known scanner behaviors specific to their environment

* correcting highlighted fields

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2026-04-06 10:06:35 -04:00
Jonhnathan c78c6363b0 Remove OSQuery/Investigate Plugin disclaimer enforcement (#5921)
* Remove OSQuery/Investigate Plugin disclaimer enforcement

* Update pyproject.toml
2026-04-06 10:53:00 -03:00
Terrance DeJesus 48128c1c66 [Rule Tuning] Entra ID Illicit Consent Grant via Registered Application - Fix New Terms Field (#5894)
* [Rule Tuning] Entra ID Illicit Consent Grant via Registered Application - Fix New Terms Field
Fixes #5893

* adding non-admin consented filter

* converting to ESQL

* additional query adjustments

* adjusted query KEEP

* updating non-ecs

* Apply suggestion from @terrancedejesus
2026-04-06 09:40:21 -04:00
Terrance DeJesus 6f23fb8d08 [Rule Tuning] M365 Identity OAuth Illicit Consent Grant by Rare Client and User (#5917)
Fixes #5916
2026-04-06 09:30:07 -04:00
Terrance DeJesus 1924fc3fae [Rule Tuning] Entra ID Service Principal with Unusual Source ASN (#5915)
* [Rule Tuning] Entra ID Service Principal with Unusual Source ASN
Fixes #5914

* optimizing query
2026-04-06 08:59:28 -04:00
Jonhnathan 0a8c89d3f5 [Rule Tuning] Misc Windows (#5906) 2026-04-06 09:42:29 -03:00
shashank-elastic 199a4d6160 Monthly Manifest and Schema Updation (#5920) 2026-04-06 17:35:33 +05:30
Isai c0b852a23d [New Rule][Rule Tuning] AWS Organizations/Account Discovery Coverage (#5910)
* [New Rule][Rule Tuning] AWS Organizations/Account Discovery Coverage

In response to the supply chain attack highlighted in (Kudelski’s Trivy / TeamPCP analysis)[https://kudelskisecurity.com/research/investigating-two-variants-of-the-trivy-supply-chain-compromise], I've added coverage for AWS Organization and Account reconnaissance which was called out in the research.

### AWS Discovery API Calls via CLI from a Single Resource
- Expanded our existing Multi-service discovery rule to include `event.provider: oraganizations.amazonaws.com`
- added the new `aws.cloudtrail.session_credential_from_console` field to exclude console behavior from this rule, and added appropriate `min_stack` to account for introduction of the field.

GAP: This rule detects aws-cli usage only. In the mentioned reference, attackers used Botocore and Boto3 tooling for this recon activity.

SOLUTION:

### AWS Account Discovery By Rare User
- Created a new Discovery rule focused solely on Organization/Account reconnaissance.
- Made it a new terms rule to reduce false positive noise from common behavior that might be seen using Boto3 or Botocore tooling.
- excluded console session behavior and service account behavior

Testing:
- Ran PACU's organization__enum module
- created a script that can be run to validate the query
- plenty of test data in our stack to run the query against

* Update rules/integrations/aws/discovery_organization_discovery_by_rare_user.toml

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

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2026-04-03 14:54:25 -04:00
Terrance DeJesus ae5ecd5346 [Rule Tuning] AWS suspicious user agents (TruffleHog, Kali CLI/Boto3) (#5902)
* Expand AWS CloudTrail user-agent rule for TruffleHog and Kali

- Rename rule file to initial_access_suspicious_user_agent_detected_in_cloudtrail.toml
- Rule name: AWS Suspicious User Agent Fingerprint
- Match TruffleHog in user_agent.original (successful API calls)
- Retain Kali Linux distrib#kali fingerprint for aws-cli/Boto3
- Refresh narrative and references (incl. Kudelski Trivy supply-chain analysis)

Same rule_id f80ea920-f6f5-4c8a-9761-84ac97ec0cb2.

Made-with: Cursor

* Apply suggestion from @terrancedejesus
2026-04-03 11:50:28 -04:00
Susan 3e1c6f38e4 Update Entity related Kibana prebuilt ML rules with new _ea ML job ID and update minimum stack versions (#5794)
* Update euid job ids and min stack version

* Update euid job ids and min stack version

* Update job suffix from _euid to _ea

* Update pad okta rules

* Update min_stack_comments

* Update gcp audit rules

* Update rules based on new changes

* Add rule for v3_windows_rare_script_ea job

* Update updated_date for rule to pass test

* Remove integrations-only changes (moved to euid-rules-update-integrations branch)

DED, DGA, LMD, PAD, and ProblemChild ML rule changes have been moved to the
euid-rules-update-integrations branch which corresponds to integrations#17626.
This branch (euid-rules-update) now only contains Kibana-related ML rule changes.

Made-with: Cursor

* Update stale updated_date to 2026/04/01 across all modified ML rules

Made-with: Cursor

* Bump min_stack_version from 9.3.0 to 9.4.0 in azure/gcp city/country/user rules

Made-with: Cursor

* Add min_stack_comments to those missing
2026-04-02 09:25:14 -04:00
Ruben Groenewoud 778781cc13 [Rule Tuning] Potential snap-confine Privilege Escalation (#5889)
* [Rule Tuning] Potential snap-confine Privilege Escalation via CVE-2026-3888

* ++
2026-04-02 11:21:09 +02:00
Mika Ayenson, PhD 8993d1450b [Rule Tuning] Add Supplemental Mitre Mappings (#5876)
---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>
Co-authored-by: terrancedejesus <terrance.dejesus@elastic.co>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
Co-authored-by: eric-forte-elastic <eric.forte@elastic.co>
2026-04-01 09:12:42 -05:00
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