Commit Graph

592 Commits

Author SHA1 Message Date
Mika Ayenson, PhD f0f7d217c0 [FR] Refactor Schema Validation & Support Multi-Dataset Sequence Validation (#5059) 2025-09-10 13:11:04 -05:00
Mika Ayenson, PhD 35b000b7ab [FR] Add negate DOES NOT MATCH capability to IM rule type (>=9.2) (#5041) 2025-09-09 10:58:53 -05:00
Eric Forte cbb892b4bc [Bug] Incorrect Integrations Schema Parsing for Nested Fields (#5058)
* Add proper handling for nested fields

* Updated schemas

* bump patch

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2025-09-04 14:12:33 -04:00
Mika Ayenson, PhD 3c1de72f6b [FR] Add support for 5 group_by fields in threshold rules (>=9.2) (#5040) 2025-09-04 09:24:36 -05:00
github-actions[bot] f2291e0261 Lock versions for releases: 8.18,8.19,9.0,9.1 (#5049) 2025-09-01 23:19:12 +05:30
shashank-elastic 93ac471574 Monthly Schema Updates (#5046) 2025-09-01 20:42:42 +05:30
Terrance DeJesus d2791bf29a [New Rule] Toolshell Exploit Chain Detections (#4928)
* adding toolshell attack chain rules for exploit and RCE

* updated query

* added references

* fixed references; linted

* Update rules/network/execution_potential_rce_via_toolshell.toml

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

* Update rules/network/initial_access_potential_toolshell_exploit_attempt.toml

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

* changed to BBR; lowered severity; adjusted queries

* Update rules_building_block/execution_potential_rce_via_toolshell.toml

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

* Update rules_building_block/execution_potential_rce_via_toolshell.toml

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

* fixed from and interval failures

* changed file name

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2025-08-29 15:17:52 -04:00
shashank-elastic ee70674e2c Add all rule types DaC testing (#4969) 2025-08-20 19:04:57 +05:30
Eric Forte dde448ee6b [Bug] Rule Toml Write Formatting Wrongly Formats \\\\x (#4978)
* Fix rule and mitigate py toml

* Bump patch version

* Add reference to issue

* Add unit test for path issues

* Update comment

* Certain strings were not properly escaped

* Updated to use json instead of repr

* replace _old_dump_str with json.dumps

* Bump Version
2025-08-18 17:03:51 -04:00
github-actions[bot] fb76ec1b2d Lock versions for releases: 8.18,8.19,9.0,9.1 (#4991) 2025-08-18 22:36:37 +05:30
github-actions[bot] 154283f457 Lock versions for releases: 8.18,8.19,9.0,9.1 (#4963) 2025-08-06 08:58:16 +05:30
Eric Forte a726da5e83 [Bug] [DAC] Custom Rules Filter Discrepancy on Stacks Upgraded to 8.18 (#4945)
* Update Custom Rules KQL

* Bump Patch Version

* Update detection_rules/kbwrap.py

Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com>

* Use or instead of and

* Bump patch version

* Fix results len typo

---------

Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com>
2025-08-05 09:42:25 -04:00
github-actions[bot] c210a88b1f Lock versions for releases: 8.18,8.19,9.0,9.1 (#4960) 2025-08-04 22:37:59 +05:30
shashank-elastic 2c2b15368c Update latest integration manifests and schema and investigation guides (#4957) 2025-08-04 19:30:01 +05:30
Sergey Polzunov ff46a7ab4a fix: Allow different order of the metadata fields in ESQL queries (#4956)
* Initial commit

* Python project version bump
2025-08-02 02:26:39 +02:00
Eric Forte a9ad66935c [FR] [DAC] Add Arbitrary File location Support for Local Creation Date (#4915)
* Add support for local file contents

* Update Rule Params

* Update CLI docs

* Update to Pathlib

* Format updating

* Delete duplicate

* Update logic to handle just local_contents path

* Update to Glob Based Approach

* Updated to use RawRuleCollection

* Fix Logging Typo

* New utils functions no longer needed

* Update naming for convention
2025-07-31 14:35:00 -04:00
Mika Ayenson, PhD 1dc3926203 [New Rules] External Promotion Alerts (#4903) 2025-07-31 11:00:50 -05:00
Mika Ayenson, PhD f2fac1bc48 [FR] [DAC] Add existing mitre threat information on import (#4948) 2025-07-31 09:44:09 -05:00
github-actions[bot] f348e92f06 Lock versions for releases: 8.18,8.19,9.0,9.1 (#4926) 2025-07-22 21:19:44 +05:30
Eric Forte 0cb1e596b3 [Bug] [DAC] Kibana Export Rules Rule Name Filter Exports All Rules (#4917)
* Add check for not rule_id
2025-07-22 11:32:17 -04:00
github-actions[bot] 3bec392e66 Lock versions for releases: 8.18,8.19,9.0,9.1 (#4924) 2025-07-22 18:10:32 +05:30
github-actions[bot] b3c681e475 Lock versions for releases: 8.18,8.19,9.0,9.1 (#4922) 2025-07-22 12:50:27 +05:30
Isai b141ebcfa6 [Rule Tunings] Reduce Usage of Flattened Fields in AWS Rules (#4892)
* [Rule Tunings] Reduce Usage of Flattened Fields in AWS Rules

This PR is in part a response to the following issues regarding the future of flattened fields in AWS, which we use as an essential part of our ruleset. However, this is also in response to the ongoing ruleset audit. Some of the flattened fields used are not truly necessary for the alert to trigger or can be replaced by a different field. Those changes have been made here and our non_ecs file has been edited to remove the unnecessary fields. Additionally, flattened fields have been removed from highlighted fields, and from investigation guides.

* Update discovery_ec2_userdata_request_for_ec2_instance.toml

updated_date

* Update execution_ssm_sendcommand_by_rare_user.toml

updated_date

* Update non-ecs-schema.json

add necessary field for ModifyInstanceAttribute action

* Update persistence_ec2_security_group_configuration_change_detection.toml

added missing event.action AuthorizeSecurityGroupIngress, narrowed scope for ModifyInstanceAttribute action by adding a necessary flattened_field

* Update privilege_escalation_iam_customer_managed_policy_attached_to_role.toml

updated min_stack_version for new field target.entity.id

* Update privilege_escalation_iam_customer_managed_policy_attached_to_role.toml

* Update privilege_escalation_iam_update_assume_role_policy.toml

updating min_stack to account of target.entity.id field

* Update impact_s3_excessive_object_encryption_with_sse_c.toml

adding highlighted fields

* Update rules/integrations/aws/exfiltration_dynamodb_table_exported_to_s3.toml

* Apply suggestions from code review

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
2025-07-18 19:15:36 -04:00
Terrance DeJesus a3a2fcdff5 [New Rule] Azure Key Vault Secret Key Usage by Unusual Identity (#4900)
* new rule Azure Key Vault Secret Key Usage by Unusual Identity

* added index

* added non-ecs field

* added azure.resource.name to new terms

* Update rules/integrations/azure/credential_access_azure_key_vault_retrieval_from_rare_identity.toml

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

* Update rules/integrations/azure/credential_access_azure_key_vault_retrieval_from_rare_identity.toml

* adjusted new terms

* Update rules/integrations/azure/credential_access_azure_key_vault_retrieval_from_rare_identity.toml

---------

Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>
2025-07-18 10:01:45 -04:00
shashank-elastic bbdde20f7b Fix variable usage impacting schema build performance (#4910) 2025-07-15 21:20:30 +05:30
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
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
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 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
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
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
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 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
Ruben Groenewoud d59addb710 [Rule Tuning] Sharpening Kubernetes Rules Indices (#4822)
* [Rule Tuning] Sharpening Kubernetes Rules Indices

* ++
2025-06-24 14:11:31 +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
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
Terrance DeJesus 0c68fcb7d9 [New Rule] Entra ID User Signed In from Unusual Device (#4804)
* new rule Entra ID User Signed In from Unusual Device

* adjusted patch version

* adjusted patch version

* updating patch version
2025-06-18 14:13:42 -04:00
github-actions[bot] fcad19fa18 Lock versions for releases: 8.14,8.15,8.16,8.17,8.18,9.0 (#4820) 2025-06-18 18:11:09 +05:30
Jonhnathan 1f71191c85 [New Rules] SPN Spoofing / Coercion Rules (#4815)
* [New Rules] SPN Spoofing / Coercion Rules

* Apply suggestions from code review

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

* Update rules/windows/credential_access_kerberos_coerce.toml

* Update rules/windows/credential_access_kerberos_coerce_dns.toml

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

* Update rules/windows/credential_access_kerberos_coerce.toml

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

* .

* Update rules/windows/credential_access_kerberos_coerce_dns.toml

* Update rules/windows/credential_access_kerberos_coerce_dns.toml

* Update pyproject.toml

* missing tag

---------

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2025-06-17 18:50:28 -03:00
Isai 74d1715f6e [Rule Tuning] AWS EC2 User Data Retrieval for EC2 Instance (#4808)
* [Rule Tuning] AWS EC2 User Data Retrieval for EC2 Instance

- changed execution window
- explicitly added flattened fields to query, to reduce wildcard usage
- added investigation fields
- changed new terms field to evaluate `user.name` over `aws.cloudtrail.user_identity.arn` so that only the role name for Assumed Role identitites is being evaluated instead of each individual session. This should greatly impact performance as most instances of this rule in telemetry is triggered by Assumed Roles.

* Apply suggestions from code review

* remove instanceId parameter

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

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
2025-06-17 14:51:18 -04:00
Isai cd003fc9a7 [New Rule] AWS CloudTrail Log Evasion (#4788)
* [New Rule] AWS CloudTrail Log Evasion

Identifies the evasion of cloudtrail logging for IAM actions involving policy creation, modification or attachment. When making certain policy-related API calls, an adversary may pad the associated policy document with whitespaces to trigger CloudTrail’s logging size constraints, resulting in incomplete logging where critical details about the policy are omitted. By exploiting this gap, threat actors can bypass monitoring performed through CloudTrail and can effectively obscure unauthorized changes. This rule looks for IAM API calls with the requestParameters property containing reason:”requestParameters too large” and omitted:true.

This is a known gap in AWS with no immediate remediation steps. While the size constraint issue affects additional services, IAM policy-related API calls are the only that pose a security risk which is why this rule is scoped specifically to `event.provider: iam.amazonaws.com`.  For additional background on the evasion technique refer to Permisso's [research](https://permiso.io/blog/cloudtrail-logging-evasion-where-policy-size-matters).

* aligning IG and rule name

* added investigation fields

added investigation fields

* change severity

* updating pyproject version
2025-06-17 13:58:26 -04:00
Isai e84892a115 [Rule Tuning] AWS EC2 Deprecated AMI Discovery (#4784)
* [Rule Tuning] AWS EC2 Deprecated AMI Discovery

Rule triggers as expected
Telemetry shows only known FP risks from tools that are intentionally including deprecated AMIs in their searches (these should be excluded by customers)
- changed the query to reduce use of multiple wildcards
- changed the execution window
- removed unnecessary parts of IG
- added to the highlighted fields

* update non-ecs-schema.json

update non-ecs-schema.json with field "aws.cloudtrail.flattened.request_parameters.ownersSet.items.owner"

* update version in pyproject.toml

update version in pyproject.toml

* Update pyproject.toml
2025-06-17 13:19:22 -04:00
Eric Forte 9f2d4d9247 [Bug] Makefile test-remote-cli Defined Twice (#4751)
* Minor Bug Fixes for Paths
2025-06-13 11:45:54 -04:00
Eric Forte 5b3dac0a14 [FR] Add Ability to Filter Rule Exports from Kibana (#4783)
* Add ability to filter on custom rules and filter exports
2025-06-09 12:21:15 -04:00
github-actions[bot] 4cf3d28367 Lock versions for releases: 8.14,8.15,8.16,8.17,8.18,9.0 (#4758) 2025-06-02 21:53:59 +05:30
shashank-elastic 89fe4c977c Refresh Integration Manifest & Schema (#4755) 2025-06-02 20:14:43 +05:30
github-actions[bot] 72ec8199ae Lock versions for releases: 8.14,8.15,8.16,8.17,8.18,9.0 (#4732) 2025-05-20 08:26:21 +05:30
shashank-elastic 43cdc7ff51 Refresh MITRE version (#4729) 2025-05-19 22:49:33 +05:30