Commit Graph

2175 Commits

Author SHA1 Message Date
shashank-elastic eca7185901 Remove Rule:Promotion labels and add other relavent labels (#3902) 2024-07-17 17:41:05 +05:30
Ruben Groenewoud 56e8e059b6 [New Rules] Docker Entrypoint Netcon / Nsenter Escape (#3883)
* [New Rules] Docker entrypoint netcon / nsenter escape

* ++

* Update privilege_escalation_docker_escape_via_nsenter.toml

* Update privilege_escalation_docker_escape_via_nsenter.toml

* Better description formatting

* Update execution_egress_connection_from_entrypoint_in_container.toml

* Update privilege_escalation_docker_escape_via_nsenter.toml
2024-07-15 13:07:36 +02:00
Ruben Groenewoud 82a0cc80a7 [New Rules] DPKG Execution/Installation (#3879)
* [New Rules] DPKG Execution/Installation

* Update rules/linux/persistence_dpkg_package_installation_from_unusual_parent.toml

* Update persistence_dpkg_package_installation_from_unusual_parent.toml

* Update persistence_dpkg_unusual_execution.toml

* Update persistence_dpkg_unusual_execution.toml
2024-07-15 12:59:03 +02:00
Jonhnathan ffb68174f9 [Rule Tuning] Suspicious DLL Loaded for Persistence or Privilege Escalation (#3887) 2024-07-15 06:41:45 -03:00
Mika Ayenson 2110ad53f0 [FR] Support new_terms schema import/export w/custom format (#3890)
* [FR] Support new_terms schema import/export w/custom format

* fix formatter for filters

* handle both rule formats when parsing data view
2024-07-12 17:17:09 -05:00
Terrance DeJesus bd345d4c19 [Bug] Hunting - Add UTF-8 Encoding for all Read and Write Operations (#3886)
* adding utf-8 flags

* reverted open() to read_text with encoding flag

* changed ticks

* changed ticks
2024-07-11 18:07:14 -04:00
Justin Ibarra 361e97a256 [FR] Add API auth to Kibana module (#3815)
* [FR] Add API auth to Kibana module

* update make file to properly install all deps

* Bump Kibana Version

---------

Co-authored-by: brokensound77 <brokensound77@users.noreply.github.com>
Co-authored-by: eric-forte-elastic <eric.forte@elastic.co>
Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
2024-07-11 17:19:41 -04:00
Isai 44658ea5f6 [Rule Tunings] Change from to prevent double alerts (#3868) 2024-07-11 13:02:10 -04:00
Isai f0ab897f99 [Rule Tunings] AWS Administrator Access Policy Attached Rules (#3867)
* [Tuning] AWS Administrator Access Policy Attached Rules

* change lookback to prevent overlap

* changed from to now-6m
2024-07-11 12:49:03 -04:00
George Papakyriakopoulos 80ac2794f2 [Rule BugFix] Google Workspace Oauth2 new app (#3436)
* [Rule BugFix] Google Workspace Oauth2 new app

In our extended testing the changed rule with latest Google Workspace
integration generates the following errors which make the rule fail everytime:

```
unsupported_operation_exception: [wildcard] queries are not currently supported on keyed [flattened] fields.
```

After careful investigation this happens since the field google_workspace.token.scope.data is a flattened
JSON filed that contains one or more key/value pairs and ES does not support wildcard matches withing flattened
fields as the error suggests.

We instead query the whole field (that contains the flattened fields) with the wildcard characters and achieve
the same outcome without the error.

* [Rule BugFix] Google Workspace Oauth2 new app update (#3436)

In our extended testing the changed rule with latest Google Workspace
integration generates the following errors which make the rule fail everytime:

```
unsupported_operation_exception: [wildcard] queries are not currently supported on keyed [flattened] fields.
```

After careful investigation this happens since the field google_workspace.token.scope.data is a flattened
JSON filed that contains one or more key/value pairs and ES does not support wildcard matches withing flattened
fields as the error suggests.

We instead query the whole field (that contains the flattened fields) with the wildcard characters and achieve
the same outcome without the error.

---------

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2024-07-11 10:45:17 -04:00
Ruben Groenewoud 21485b16fa [Tuning & Changes] Misc rule/hunt tuning (#3875)
* [Tuning & Changes] Misc rule/hunt tuning

* Bump update_date

* ++

* Updated docs
2024-07-11 14:55:33 +02:00
Mika Ayenson c62321f810 [FR] Detection Rule PR Guidelines and Issue Forms (#3850) 2024-07-10 17:18:45 -05:00
shashank-elastic 59a10be7c8 Unit Test to validate from field in toml file (#3866) 2024-07-10 22:41:53 +05:30
Terrance DeJesus 70411664cf [Bug] Normalize Hunting Index Link Generation (#3872)
* normalizing hunting link generation

* replacing header

* adjusting quotes in f-strings

* added source file to metadata

* removed os dependency

* address bug in source file links

* reverting TOML loading

* change all List type hinting to list

* change all List type hinting to list

* fixed accented characters in queries

* reverted accent character removal; moved macos query and MD to macos folder
2024-07-10 11:01:59 -04:00
Jonhnathan 6e7ece4384 [Rule Tuning] Fix event.action conditions - AD Rules (#3874) 2024-07-10 10:33:14 -03:00
ar3diu b303b8296b [Rule Tuning] LSASS Memory Dump Creation (#3810)
* Update rule exclusion with process executable path for Windows Fault Reporting binary, WerFaultSecure.exe.

---------

Co-authored-by: Andrei Rediu <andrei.rediu@bit-sentinel.com>
2024-07-10 06:12:38 -05:00
Eric Forte ec6038b9d9 Added Schema Check for Data View ID and Index (#3830) 2024-07-09 15:05:12 -04:00
github-actions[bot] 6a28881b5f Lock versions for releases: 8.9,8.10,8.11,8.12,8.13,8.14 (#3880) 2024-07-09 19:13:24 +05:30
shashank-elastic b66d6e06aa Fix Double Bump For Rule Microsoft Management Console File from Unusual Path (#3878) 2024-07-09 17:59:51 +05:30
Terrance DeJesus 7f3c977192 [Rule Tuning] Tune Attempts to Brute Force a Microsoft 365 User Account (#3860)
* tuning 'Attempts to Brute Force a Microsoft 365 User Account'

* added reference

---------

Co-authored-by: shashank-elastic <91139415+shashank-elastic@users.noreply.github.com>
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-08 13:07:44 -04:00
Ruben Groenewoud b230f8372a [New Hunt] Persistence through System V Init (#3871)
* [New Hunt] Persistence through System V Init

* regenerating docs

---------

Co-authored-by: terrancedejesus <terrance.dejesus@elastic.co>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2024-07-08 16:35:54 +02:00
Joe Desimone 6a2f5e7138 [Bug] Persistence ssh key generation index pattern (#3873)
* fix persistence_ssh_key_generation.toml

* Update persistence_ssh_key_generation.toml

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
2024-07-08 10:27:52 -03:00
Jesse Sant c32e17c0e7 Use command masquerading in linux_compress rta script (#3782) 2024-07-08 12:29:00 +05:30
Terrance DeJesus f0b2cb7c87 [New Hunt] Add Initial Linux Hunting Files (#3847)
* added 'Uncommon Process Execution from Suspicious Directory' hunt

* adds all linux hunting files

* moves linux hunting files to queries folder

* adds generated docs

* fixing windows hunts

* fixing windows hunts

* updated README

* Removed 2, updated a few, changed some names/descriptions and added list of str

* updated windows for language schema changes, regenerated docs; updated README and index

* changed UUIDs to hex only with standard hyphen format

* removing unecessary docs

* Fixed queries based on Samir feedback

* ++

* regenerating linux docs

* Update hunting/linux/queries/command_and_control_via_network_connections_with_low_occurrence_frequency_for_unique_agents.toml

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

* Update hunting/linux/queries/defense_evasion_via_hidden_process_execution.toml

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

* Update hunting/linux/queries/command_and_control_via_unusual_file_downloads_from_source_addresses.toml

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

* Update hunting/linux/queries/defense_evasion_via_capitalized_process_execution.toml

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

* Update hunting/linux/queries/defense_evasion_via_hidden_process_execution.toml

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

* Updates

* Update

* Update hunting/linux/queries/command_and_control_via_network_connections_with_low_occurrence_frequency_for_unique_agents.toml

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

* Updates

* regenerating linux docs

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
2024-07-05 20:01:12 +02:00
Isai 215d5a0861 [New Rule] AWS S3 Object Encryption Using External KMS Key (#3861)
* [New Rule] AWS S3 Object Encryption Using External KMS Key

Identifies encryption events for S3 bucket objects using an AWS KMS key from an external account. Adversaries with access to a misconfigured S3 bucket and the proper permissions may encrypt objects with an external KMS key to deny their victims access to their own data.

* Update impact_s3_object_encryption_with_external_key.toml

* Update impact_s3_object_encryption_with_external_key.toml

* missing coma after tag

* missing backslash on technique reference
2024-07-05 12:25:55 -04:00
Samirbous 1d57e0c779 Update defense_evasion_deletion_of_bash_command_line_history.toml (#3614)
* Update defense_evasion_deletion_of_bash_command_line_history.toml

* Update defense_evasion_deletion_of_bash_command_line_history.toml

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-05 12:58:07 +01:00
Ruben Groenewoud 64f0e258cb [New Rule] Linux Shadow File Modification (#3737)
* [New Rule] Linux User Account Password Change

* Update rules/linux/persistence_user_password_change.toml

* Update persistence_user_password_change.toml

* Update persistence_user_password_change.toml

* Update persistence_user_password_change.toml

---------

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-05 10:03:24 +02:00
Samirbous 801aab82cc [New] Sensitive Registry Hive Access via RegBack (#3855)
* Create credential_access_regback_sam_security_hives.toml

* Update credential_access_regback_sam_security_hives.toml

* Update rules/windows/credential_access_regback_sam_security_hives.toml

* Apply suggestions from code review

* Update rules/windows/credential_access_regback_sam_security_hives.toml

* Update credential_access_regback_sam_security_hives.toml

---------

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2024-07-05 07:50:23 +01:00
Samirbous 15e9c9aa5e [Tuning] Ransomware over SMB (#3808)
* [Tuning] Ransomware over SMB

* Update impact_ransomware_file_rename_smb.toml

---------

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-05 07:26:57 +01:00
Samirbous cd716e5248 [Tuning] Suspicious Microsoft 365 Mail Access by ClientAppId (#3685)
* Update initial_access_microsoft_365_abnormal_clientappid.toml

* Update initial_access_microsoft_365_abnormal_clientappid.toml

* Update initial_access_microsoft_365_abnormal_clientappid.toml

---------

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-05 05:46:40 +01:00
Joe Desimone 8dc0963ae6 [Rule Tuning] LSASS Process Access via Windows API (#3824)
* Update credential_access_lsass_openprocess_api.toml

* Update credential_access_lsass_openprocess_api.toml

* Update credential_access_lsass_openprocess_api.toml

* fix merge

* newline

* Update credential_access_lsass_openprocess_api.toml

* Update credential_access_lsass_openprocess_api.toml

---------

Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-04 21:45:46 +01:00
Jonhnathan 208e330b44 [New Rule] Potential PowerShell Obfuscated Script (#3864)
* [New Rule[ Potential PowerShell Obfuscated Script

* Update defense_evasion_posh_obfuscation.toml

* Update rules/windows/defense_evasion_posh_obfuscation.toml

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

---------

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-07-04 09:26:32 -03:00
ar3diu 5048bc26bd [Rule Tuning] Suspicious Inter-Process Communication via Outlook #3803 (#3806)
* Add "by host.id" argument to the sequence command in the rule query.

* Update collection_email_outlook_mailbox_via_com.toml

* Update non-ecs-schema.json

---------

Co-authored-by: Andrei Rediu <andrei.rediu@bit-sentinel.com>
Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2024-07-03 10:39:15 -04:00
shashank-elastic 50f0fb3518 Test case to check updated_date (#3818) 2024-07-03 19:17:27 +05:30
Isai 83be212632 [New Rule] AWS RDS DB Instance Made Public (#3836)
* [New Rule] AWS RDS DB Instance Made Public

...

* Apply suggestions from code review

* added coverage for instances created with public access

* rule review edits

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

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2024-07-03 01:01:52 -04:00
Isai 3a5c5c20a8 [New Rule] AWS RDS DB Instance or Cluster Deletion Protection Disabled (#3851)
* [New Rule] AWS RDS DB Instance or Cluster Deletion Protection Removed

...

* insert rule_id

* rule name change
2024-07-02 17:22:03 -04:00
Isai 9f4956f542 [New Rule] AWS RDS DB Instance or Cluster Password Modified (#3844)
* [New Rule] AWS RDS DB Instance or Cluster Password Modified

..

* Update rules/integrations/aws/persistence_rds_db_instance_password_modified.toml

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2024-07-02 16:14:51 -04:00
Isai 43fbf94d8a [New Rule] AWS RDS Snapshot Shared with Another Account (#3831)
* [New Rule] AWS RDS DB Snapshot Shared with Another Account

...

* Update exfiltration_rds_snapshot_shared_with_another_account.toml

* edit threat matrix format

* Apply suggestions from code review

* Update rules/integrations/aws/exfiltration_rds_snapshot_shared_with_another_account.toml

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
2024-07-02 15:36:44 -04:00
Isai aaf014390b [New Rule] AWS RDS Snapshot Deleted (#3852)
* [New Rule] AWS RDS Snapshot Deleted

* added coverage for backupRetentionPeriod set to 0
2024-07-02 14:01:15 -04:00
Terrance DeJesus d59d462956 [Rule Tuning] Potential AWS S3 Bucket Ransomware Note Uploaded (#3854)
* tuning 'Potential AWS S3 Bucket Ransomware Note Uploaded'

* adding filter to ignore common AWS object path strings
2024-07-02 13:02:52 -04:00
shashank-elastic 30ffe00012 Create an Issue in Kibana for MITRE Updates (#3796) 2024-07-02 18:57:41 +05:30
Terrance DeJesus 5fe7833312 [Rule Tuning] Tuning Google Workspace Rules and File Name Length Reduction (#3849)
* tuning google workspace rules

* removed verbiage about runtime
2024-07-01 15:50:12 -04:00
Jonhnathan d5c34b5750 [Rule Tuning] Unusual File Creation - Alternate Data Stream (#3848) 2024-07-01 13:45:19 -03:00
Terrance DeJesus 99a4d629c9 [New Rule] Entra ID Device Code Auth with Broker Client (#3819)
* new rule 'Entra ID Device Code Auth with Broker Client'

* updated azure integration, non-ecs updated, rule date updated

* updates tags

* updated query to add Azure activity logs

* merging in main

* updated azure manifest and schemas

* updated azure manifest and schemas

* updated index map for summary and changelog

* removed string imports

* reverting packaging.py updates

* adjusted query

* adjusted query to be more optimized

---------

Co-authored-by: shashank-elastic <91139415+shashank-elastic@users.noreply.github.com>
2024-07-01 10:31:26 -04:00
Jonhnathan 125084ceec [Rule Tuning] Improve Compatibility in WIndows BBR Detection Rules (#3841)
* [Rule Tuning] Improve Windows BBR Compatibility

* Update defense_evasion_services_exe_path.toml
2024-07-01 10:41:00 -03:00
Isai f62644887e [Rule Tuning] AWS RDS Snapshot Restored (#3809)
* [Tuning] AWS RDS Instance Restored

-name and description change to better describe behavior
- rule file name changed to match tactic
- query change to add coverage for restore from S3
- rule type changed to eql
- subtechnique added for creaing instance
- tag added for RDS datasource
- Investigation Guide added

* Update defense_evasion_rds_instance_restored.toml

* Update defense_evasion_rds_instance_restored.toml

* removed investigation guide place holder

* deprecated old rule because of name change

* change rule_id

* Revert "change rule_id"

This reverts commit 0764c932f412439319e2d15a6bd80c360cf3fdc2.

* Revert "deprecated old rule because of name change"

This reverts commit fd62673380b40ba9ee432a271da3a8c5374e7129.
2024-06-28 20:42:36 -04:00
shashank-elastic 949ceccc0f Generate Better Index Keys (#3826)
* Generate Better Index Keys

* More Robust index mapping

* Remove unused import

* Remove unused import

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2024-06-28 13:48:09 -04:00
Terrance DeJesus 2e3aca62f0 [Rule Tuning] Multiple Device Token Hashes for Single Okta Session (#3814)
* tuning 'Multiple Device Token Hashes for Single Okta Session'

* adjusted file name

* updated tags

* updated file name extension

* updated min-stack comments
2024-06-28 12:59:24 -04:00
github-actions[bot] aef9fe8ec4 Lock versions for releases: 8.9,8.10,8.11,8.12,8.13,8.14 (#3845) 2024-06-28 17:49:18 +05:30
Mika Ayenson 357204e1c5 [FR] Limit historical rules to the latest 2 (#3842) 2024-06-28 06:42:10 -05:00