Commit Graph

3314 Commits

Author SHA1 Message Date
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 c2880afa06 [New Rule] OIDC Discovery URL Changed in Entra ID (#4908)
* new rule OIDC Discovery URL Changed in Entra ID

* added references

* removed indexes

* Update rules/integrations/azure/persistence_entra_id_oidc_discovery_url_change.toml

* adjusted for ESQL standardization
2025-07-18 10:26:02 -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
Terrance DeJesus 8e99bace44 [New Rule] External Authentication Method Addition or Modification in Entra ID (#4906)
* new rule External Authentication Method Addition or Modification in Entra ID

* added references

* adjusted to new terms
2025-07-18 09:45:33 -04:00
Terrance DeJesus 72afee06ca [New Rule] Excessive Secret or Key Retrieval from Azure Key Vault (#4898)
* new rule Excessive Secret or Key Retrieval from Azure Key Vault

* adjusted query for ESQL standardization

* adjusted from ESQL to Esql
2025-07-18 09:30:10 -04:00
Ruben Groenewoud 9f46d5b496 [New Rule] Kubernetes Unusual Decision by User Agent (#4829)
* [New Rule] Kubernetes Unusual Request Response by User Agent

* ++

* Update execution_unusual_request_response_by_user_agent.toml

* Update rules/integrations/kubernetes/execution_unusual_request_response_by_user_agent.toml

* Update execution_unusual_request_response_by_user_agent.toml

* Update rules/integrations/kubernetes/execution_unusual_request_response_by_user_agent.toml
2025-07-18 09:44:02 +02:00
Terrance DeJesus 0f8c53e4d2 [Rule Tuning] Azure Key Vault Modified (#4896)
* tuning rule Azure Key Vault Modified

* Update rules/integrations/azure/impact_azure_key_vault_modified.toml

* adjusted description

* Update rules/integrations/azure/impact_azure_key_vault_modified.toml

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

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2025-07-17 09:31:58 -04:00
Ruben Groenewoud d510a965e9 [New Rule] Unusual Kill Signal (#4911)
* [New Rule] Unusual Kill Signal

* Update defense_evasion_unsual_kill_signal.toml

* Update defense_evasion_unsual_kill_signal.toml
2025-07-17 15:05:28 +02:00
Ruben Groenewoud 0d04f98c24 [Rule Tuning] Sudoers File Modification (#4904)
* [Rule Tuning] Sudoers File Modification

* [Rule Tuning] Sudoers File Modification
2025-07-16 10:17:51 +02:00
Isai 494a9e0d25 [Rule Tuning] AWS IAM API Calls via Temporary Session Tokens (#4901)
- rule triggers as expected, however its triggering for failed requests
- added `event.outcome: success` to query
- added highlighted fields
- adjusted rule execution window
2025-07-15 19:13:16 -04:00
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