Commit Graph

2904 Commits

Author SHA1 Message Date
shashank-elastic bbdde20f7b Fix variable usage impacting schema build performance (#4910) 2025-07-15 21:20:30 +05:30
Terrance DeJesus 51b6f0dbd7 [Rule Deprecation] Azure Virtual Network Device Modified or Deleted (#4889)
* deprecating 'Azure Virtual Network Device Modified or Deleted'

* changed maturity
2025-07-14 15:58:11 -04:00
Sergey Polzunov c0631d2df2 fix: Better aligning prompt behaviour with jsonschema types (#4894)
* Check for `["array"]` in addition to `"array"`

* version bump

* Exclude non-ecs-schema.json from CI check
2025-07-11 07:10:47 -05:00
Marc-Antoine Leclercq 1b12ecff87 Clarify authentication settings to Kibana related to #4495 (#4819)
* Update CLI.md

Removing mentions of kibana_user and kibana_password since #4495 removed them entirely.

* Bump patch version

* Bump patch version

---------

Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
Co-authored-by: eric-forte-elastic <eric.forte@elastic.co>
2025-07-10 15:21:01 -04:00
Eric Forte 03f977246f [FR] Updates to KQL Lib Parsing and Install (#3605)
* Bump Version

* updated

* Bump patch version

* Optimization should only occur on single values

* Wildcard semantically equivalent to query_string*

* Add unit test for optimization

* Move code-checks to yml

* Add tests path to code-checks

* Add lib path for code-checks

* Install deps from local

* Update DSL optimization unit test

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2025-07-10 15:03:08 -04:00
shashank-elastic b70792082a Fix pipe characters in rule descriptions (#4893) 2025-07-10 15:11:20 +05:30
dependabot[bot] 932163e9cd Bump setuptools from 75.2.0 to 78.1.1 and lock marshmallow-dataclass[union] to 8.6.1 (#4730)
* Bump setuptools from 75.2.0 to 78.1.1

Bumps [setuptools](https://github.com/pypa/setuptools) from 75.2.0 to 78.1.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v75.2.0...v78.1.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 78.1.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump Package Version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
Co-authored-by: shashank-elastic <91139415+shashank-elastic@users.noreply.github.com>
Co-authored-by: eric-forte-elastic <eric.forte@elastic.co>
2025-07-09 18:08:31 -04:00
Eric Forte 898be50e95 [Bug] Fix Filter Support for Import Rules (#4852)
* Fix Filter Support for Import Rules

* Patch Bump

* Update Remove CLI Test Script

* Ruff formatting
2025-07-09 10:07:42 -04:00
Terrance DeJesus 6e2936aa8c [New Rule] TeamFiltration User-Agents Detected (#4868)
* new rule TeamFiltration User-Agents Detected

* changed UUID

* tightened index scope

* fixing query optimization

* adjusted query
2025-07-08 09:56:06 -04:00
github-actions[bot] 52a3652965 Lock versions for releases: 8.18,8.19,9.0,9.1 (#4887) 2025-07-08 15:05:39 +05:30
shashank-elastic 7175b3ab06 Add investigation guides for detection rules (#4886) 2025-07-08 00:25:42 +05:30
Terrance DeJesus acfc106164 new rule Suspicious Entra ID OAuth User Impersonation Scope Detected (#4876)
Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2025-07-07 14:29:06 -04:00
shashank-elastic 9b292b97ea Prep 8.19/9.1 (#4869)
* Prep 8.19/9.1 Release

* Download Beats Schema

* Download API Schema

* Download 8.18.3 Beats Schema

* Download Latest Integrations manifest and schema

* Comment old schemas

* Update Patch version
2025-07-07 11:27:48 -04:00
Jonhnathan 782605ae07 [Rule Tuning] PowerShell Windows Defender ATP DataCollection Scripts (#4867)
* [Rule Tuning] PowerShell Windows Defender ATP DataCollection Scripts

* bum updated_date

* Fix DSL exception
2025-07-07 10:56:13 -03:00
Jonhnathan d42128cdbf [Rule Tuning] Windows Misc Tuning (#4870)
* [Rule Tuning] Windows Misc Tuning

* Update execution_command_shell_started_by_svchost.toml

* bump

* Update rules/windows/defense_evasion_adding_the_hidden_file_attribute_with_via_attribexe.toml

* Update defense_evasion_persistence_account_tokenfilterpolicy.toml
2025-07-07 10:32:12 -03:00
Terrance DeJesus 6a083ec984 [New Rule] Unusual ROPC Login Attempt by User Principal (#4871)
* new rule Unusual ROPC Login Attempt by User Principal

* linted
2025-07-03 14:43:19 -04:00
Jonhnathan 1e416b64da [Hunt] Remove Default Namespace from indexes (#4866)
* [Hunt] Remove Default Namespace from indexes

* markdown
2025-07-03 11:08:29 -03:00
Ruben Groenewoud 715e3f44f4 [New Rule] Kubectl Apply Pod from URL (#4855)
* [New Rule] Kubectl Apply Pod from URL

* Update execution_kubectl_apply_pod_from_url.toml
2025-07-03 10:47:07 +02:00
Ruben Groenewoud 8b3b1e516f [New Rule] Kubernetes Events Deleted (#4853)
* [New Rule] Kubernetes Events Deleted

* Update defense_evasion_events_deleted.toml
2025-07-03 10:22:03 +02:00
Ruben Groenewoud 26e35fd03b [Rule Tuning] Potential Linux Tunneling and/or Port Forwarding (#4858) 2025-07-03 09:50:30 +02:00
Ruben Groenewoud 3efcd70f8c [New Rule] Kubernetes Sensitive Configuration File Activity (#4849)
* [New Rule] Kubernetes Sensitive Configuration File Activity

* Update rules/linux/persistence_kubernetes_sensitive_file_activity.toml
2025-07-02 17:16:25 +02:00
Terrance DeJesus 016cdf2cbb [New Rule] Microsoft Entra ID Suspicious Cloud Device Registration (#4802)
* new rule Microsoft Entra ID Suspicious Cloud Device Registration

* adjusted backticks in non-ecs and rule

* linted

* adjusted uuid; bumped patch version
2025-07-02 10:03:08 -04:00
Sergey Polzunov cdb346cb77 fix: Skip invalid YAML files in Beats dist (#4865)
* Skip invalid YAML files but keep them in the branch

* Typo fix

* Patch version bump

* Adding a schema generation command to `test_cli.bash` flow
2025-07-02 13:39:35 +02:00
Sergey Polzunov 1fb60d6475 fix: type hinting fixes and additional code checks (#4790)
* first pass

* Adding a dedicated code checking workflow

* Type fixes

* linting config and python version bump

* Type hints

* Drop incorrect config option

* More fixes

* Style fixes

* CI adjustments

* Pyproject fixes

* CI & pyproject fixes

* Proper version bump

* Tests formatting

* Resolve cirtular dependency

* Test fixes

* Make sure the tests are formatted correctly

* Check tweaks

* Bumping python version in CI images

* Pin marshmallow do 3.x because 4.x is not supported

* License fix

* Convert path to str

* Making myself a codeowner

* Missing kwargs param

* Adding a missing kwargs to `set_score`

* Update .github/CODEOWNERS

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

* Dropping unnecessary raise

* Dropping skipped test

* Drop unnecessary var

* Drop unused commented-out func

* Disable typehinting for the whole func

* Update linting command

* Invalid type hist on the input param

* Incorrect field type

* Incorrect value used fix

* Stricter values check

* Simpler function call

* Type condition fix

* TOML formatter fix

* Simpligy output conditions

* Formatting

* Use proper types instead of aliases

* MITRE attack fixes

* Using pathlib.Path for an argument

* Use proper method to update a set from a dict

* First round of `ruff` fixes

* More fixes

* More fixes

* Hack against cyclic dependency

* Ignore `PLC0415`

* Remove unused markers

* Cleanup

* Fixing the incorrect condition

* Update .github/CODEOWNERS

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

* Set explicit default values for optional fields

* Update the guidelines

* Adding None Defaults

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
Co-authored-by: eric-forte-elastic <eric.forte@elastic.co>
2025-07-01 08:20:55 -05:00
Terrance DeJesus 10d95baa2b [Rule Tuning] Microsoft Entra ID Exccessive Account Lockouts Detected (#4851)
* adjusting Microsoft Entra ID Exccessive Account Lockouts Detected

* removing unit test

* added newline

* adjusted dates
2025-07-01 08:18:18 -04:00
Ruben Groenewoud 0847c32333 [New Rule] Potential Kubectl Masquerading (#4832)
* [New Rule] Potential Kubectl Masquerading

* Update defense_evasion_potential_kubectl_masquerading.toml

* ++

* ++

* Update defense_evasion_potential_kubectl_masquerading.toml

* Update rules/linux/defense_evasion_potential_kubectl_masquerading.toml
2025-06-30 13:47:58 +02:00
Ruben Groenewoud d0bff94158 [New BBR] Kubectl Configuration Discovery (#4835) 2025-06-30 11:11:10 +02:00
Ruben Groenewoud bc87ca1d5b [New Rule] Kubectl Network Configuration Modification (#4836)
* [New Rule] Kubectl Network Configuration Modification

* ++
2025-06-30 10:53:32 +02:00
Ruben Groenewoud 786542a9d4 [New Rule] Kubernetes Direct API Request via Curl or Wget (#4841) 2025-06-30 10:34:10 +02:00
Ruben Groenewoud 2c4157066f [New Rule] Kubernetes Forbidden Creation Request (#4843) 2025-06-30 10:20:33 +02:00
Isai bf1dc2547f [Rule Tunings] AWS SSM Command Document Created by Rare User (#4848)
* [Rule Tunings] AWS SSM Command Document Created by Rare User

## AWS SSM Command Document Created by Rare User
Rule executes as expected and has very few alerts in telemetry. However, it is one of the rules timing out occasionally.
- reduced execution window
- reduced new terms history window
- replaced wildcards with the flattened field in the query, which should improve performance
- replaced `aws.cloudtrail.user_identity.arn` with combination of `cloud.account.id` and `user.name` to account for Assumed Roles. This will only evaluate the role instead of each individual role session, which will improve performance.
- added investigation fields
- corrected tags
- added mitre technique

## AWS SSM `SendCommand` Execution by Rare User"
- added investigation fields
- added tag

* update pyproject.toml

update pyproject.toml version
2025-06-27 13:24:27 -04:00
Samirbous 09b928fb84 Update multiple_alerts_different_tactics_host.toml (#4854) 2025-06-27 09:53:42 -03:00
Ruben Groenewoud 7c07033354 [Deprecation] Suspicious File Creation in /etc for Persistence (#4850)
* [Deprecation] Suspicious File Creation in /etc for Persistence

* [Deprecation] Suspicious File Creation in /etc for Persistence

* Update persistence_etc_file_creation.toml

* Fix
2025-06-27 10:14:53 +02:00
Terrance DeJesus 3bd9ab8d1d [New Rule] Excessive Microsoft 365 Mailbox Items Accessed (#4825)
* new rule Excessive Microsoft 365 Mailbox Items Accessed

* bumping patch version
2025-06-26 12:51:11 -04:00
Terrance DeJesus b0ca02605f [New Hunt] Potential Spoofed microsoftonline.com via Fuzzy Match (#4770)
* new hunt for spoofed MSFT domains

* added lookback time to ESQL query
2025-06-26 12:38:48 -04:00
Terrance DeJesus fb03295bbf tuning Suspicious Microsoft 365 UserLoggedIn via OAuth Code (#4847) 2025-06-26 10:43:57 -04:00
Jan Calanog 7661557aec docs-builder: add pull-requests: write permission to docs-build workflow (#4840) 2025-06-26 18:01:42 +05:30
Ruben Groenewoud 0772923023 [New BBR] Kubectl Workload and Cluster Discovery (#4830)
* [New BBR] Kubectl Workload and Cluster Discovery

* Update discovery_kubectl_workload_and_cluster_discovery.toml

* Update rules_building_block/discovery_kubectl_workload_and_cluster_discovery.toml
2025-06-26 11:51:05 +02:00
Terrance DeJesus ba429070e3 [New Rule] Entra ID RT to PRT Transition from Same User and Device (#4845) 2025-06-25 14:52:50 -04:00
Samirbous 4fb31c7ea6 Update command_and_control_new_terms_commonly_abused_rat_execution.toml (#4842)
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2025-06-25 12:39:48 -03:00
Isai fe327a7560 [Rule Tunings] AWS Role Assumption By Service / User (#4827)
AWS Role Assumption By Service
The newest versions of this rule seem fine in telemetry and the rule executes as expected
- removed MD from description
- adjusted execution window for 1 m look back
- fixed inaccuracies in Investigation Guide
- added Lateral Movement tag
- adjusted highlighted fields
- reduced history window from 14 to 10 days

AWS Role Assumption By User
This rule seem fine in telemetry and the rule executes as expected
- removed MD from description
- fixed inaccuracies in Investigation Guide
- added Lateral Movement tag
- adjusted highlighted fields
- added `cloud.account.id` to new_terms field to account for duplicate user.names across cloud accounts
- replaced new terms flattened field for `aws.cloudtrail.resources.arn`, which gives the same result and remains consistent with the other rule.
2025-06-24 18:07:18 -04:00
Isai 1ed322f8d9 [Rule Tuning] AWS SSM SendCommand Execution by Rare User (#4828)
Rule is triggering as expected, very low instances of alerts in telemetry
- adjusted execution window
- slight edits to IG for accuracy
- removed exclusion `and not aws.cloudtrail.user_identity.arn: *AWSServiceRoleForAmazonSSM/StateManagerService*` from the query. This is a service-linked role meant to be used by AWS internal services. Therefore, the existing exclusion `and not source.address: "ssm.amazonaws.com"` already excludes the use of this role by the SSM service. I show this in the screenshot below. This will remove the use of wildcards in the query and improve performance.
- changed the new terms fields to use combination of `cloud.account.id` and `user.name` so that only roles (and not individual role sessions) are being evaluated. adding `cloud.account.id` accounts for duplicate user.names across multiple accounts.
2025-06-24 17:22:20 -04:00
Terrance DeJesus c986138333 [Rule Tuning] Suspicious Microsoft 365 Mail Access by Unusual ClientAppId (#4806)
* tuning rule Suspicious Microsoft 365 Mail Access by Unusual ClientAppId

* adjusted tactic tag

* updating patch version

* updating patch version

* bumping patch version
2025-06-24 14:20:33 -04:00
Jonhnathan 82708867e3 [Rule Tuning] First Time Seen NewCredentials Logon Process (#4844)
* [Rule Tuning] First Time Seen NewCredentials Logon Process

* Update rules/windows/privilege_escalation_newcreds_logon_rare_process.toml

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2025-06-24 12:25:56 -03:00
shashank-elastic 4d92da5d21 Archive Attack Coverage Update Workflow (#4821) 2025-06-24 18:41:29 +05:30
Ruben Groenewoud d59addb710 [Rule Tuning] Sharpening Kubernetes Rules Indices (#4822)
* [Rule Tuning] Sharpening Kubernetes Rules Indices

* ++
2025-06-24 14:11:31 +02:00
Ruben Groenewoud e666cabb3d [Rule Tuning] Added Kubernetes Data Source Tag (#4831) 2025-06-24 13:18:58 +02:00
Samirbous 4b20d69c03 [Tuning] Elevation via SCM rules (#4837)
* Update privilege_escalation_krbrelayup_service_creation.toml

* Update privilege_escalation_windows_service_via_unusual_client.toml

* Update non-ecs-schema.json

* Update non-ecs-schema.json

* Update pyproject.toml
2025-06-20 09:52:59 +01:00
Ruben Groenewoud b9c6517666 [New Rule] Forbidden Request from Unusual User Agent in Kubernetes (#4818)
* [New Rule] Forbidden Request from Unusual User Agent in Kubernetes

* Update rules/integrations/kubernetes/execution_forbidden_request_from_unsual_user_agent.toml
2025-06-19 09:43:28 +02:00
Terrance DeJesus 0aefedd6f1 [New Rule] Suspicious ADRS Token Request by Microsoft Auth Broker (#4801)
* new rule Suspicious ADRS Token Request by Microsoft Auth Broker

* bumping patch version

* updating patch version
2025-06-18 14:41:04 -04:00