Commit Graph

256 Commits

Author SHA1 Message Date
Terrance DeJesus 76500f0d46 [New Rule] Google Workspace Drive - Encryption Key(s) Accessed from Anonymous User (#2654)
* new rule 'Google Workspace Drive Encryption Key(s) Accessed from Anonymous User'

* updated MITRE ATT&CK mappings
2023-03-24 12:21:56 -04:00
Terrance DeJesus 7be5788945 [New Rule] Google Workspace Resource Copied from External Drive (#2627)
* added new rule 'Google Workspace Resource Copied from External Drive'

* adjusted mitre att&ck subtechnique ID
2023-03-20 14:37:58 -04:00
Mika Ayenson 87c66f923e Update commit-and-push.sh (#2640) 2023-03-09 17:31:19 -05:00
Justin Ibarra 2605a341a9 Include base rule fields in enriched indexes (#2547) 2023-03-02 08:30:55 -07:00
Terrance DeJesus 66a0cbb5de [Bug] Fix release-* Github Workflows and Review integrations-pr command (#2605)
* testing order of operations in workflow

* reverted testing order; adjusting secrets token

* adjusting secrets token

* changing checkout to v3

* removed token for testing workflow

* changed repo reference

* changing secret token

* reverting token changes

* removing master reference

* adjusted elastic-package installation

* changed path of integrations during install

* added integrations fetch run commands

* changed target branch to main, setup latest go

* changed token back to protections machine

* trying different secret for integrations PR creation

* created testing token for permission errors

* adjusted 'bump-pkg-versions' so minors are bumped if no previous pkg

* added bumping package versions as a step

* updated actions/upload-artifact to v3

* removed inaccurate comments; removed release-kibana workflow

* adjusted sequence of steps to bump packge version before build

* added a bump to major if it does not match packages.yml
2023-03-01 10:43:16 -05:00
Terrance DeJesus 73d581500c [Bug] Change YAML Dump Parameters for Integrations Changelog (#2545)
* changed yamp.dump parameters to have correct order for changelog

* adjusted note in changelog
2023-02-14 12:10:41 -05:00
github-actions[bot] c07ced2ce4 Lock versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7 (#2542)
* Locked versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7

* newline in version lock file to start CI

* removed newline in version lock file

---------

Co-authored-by: terrancedejesus <terrancedejesus@users.noreply.github.com>
Co-authored-by: terrancedejesus <terrance.dejesus@elastic.co>
2023-02-10 14:11:33 -05:00
Terrance DeJesus f8d26f4ce0 [Bug] Removed Strip Calls in Favor of F-Strings with Major and Minor Versions (#2541)
* removed strip calls in favor of f-strings with major and minor versions

* changed variable reference in minor_release of bump-pkg-versions
2023-02-10 13:18:53 -05:00
Terrance DeJesus 8a7ad13611 [FR] 8.7 Release Preparation and Update Main Branch to 8.8 (#2533)
* adding preparations for 8.8 release

* addressed flake single new line error

* froze and updated API schemas

* updated get_intregration_manifests

* adjusted boolean in find_latest_integration_version
2023-02-08 17:27:21 -05:00
Mika Ayenson 60115443a4 Validate against beats and integrations schemas (#2524) 2023-02-08 12:01:31 -05:00
Terrance DeJesus 58ba72d5bf patch fix for 2503 update addressing separate bugs (#2528) 2023-02-07 16:09:17 -05:00
Terrance DeJesus 4054eb43d1 patch fix for 2503 (#2527) 2023-02-07 15:40:51 -05:00
Terrance DeJesus fb2b4529c5 [FR] Adapt PyPi semver Library and Remove Custom (#2503)
* removed custom semver and replaced with pypi

* updated beats.py version references

* updated bump-versions CLI command to use semver and change logic

* updated schemas __init__, test_version_lock and unstage incompatible rules CLI

* updated test_stack_schema_map in TestVersions unittest

* updated test_all_rules unit testing Version() references

* updated stack_compat.py for get_restricted_field references)

* updated version_lock.py Version() references

* updated docs.py Version() reference for parse_registry

* updated devtools.py Version() reference for trim-version-lock

* updated mixins.py Version() reference in validate_field_compatibility

* adjusted schemas.__init__ Version() reference in get_stack_schemas

* adjusted ecs.py Version() references

* adjusted integrations.py Version() references

* adjusted rule.py Version() references

* sorted imports

* replaced custom semver with pypi semver in unit test files

* addressed unit test and flake errors

* changed semver strings casted to version_lock.py

* fixed sorting in integrations.py

* updated bump-pkgs-versions CLI command

* adjusted semantic version in unstage-incompatible-rules command

* adjusted semver import to VersionInfo

* added semver 3 and adjusted import names

* added option_minor_and_patch parameter where version is major.minor

* updated bump-pkg-versions to always save to packages.yml

* removed leftover split call & updated find latest compatible version command

* updated integrations.py, version_lock.py and schemas.__init__.py

* changed fstring reference in downgrade function

* reverted formatting changes for detection_rules __init__.py

* added newline to detection_rules __init__.py

* adjusted finding latest_release for attack package logic

* adjusted unstage-incompatible-rules command logic comparing versions

* removing changes from misc.py related to auto-formatting

* adding newline to misc.py

* fixed bug in downgrade function calling decorators

* added semantic version validation on migrate decorator function

* added expected type returned from find_latest_integration_version in integrations.py

* add comment about stripped versions for version lock file

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

---------

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2023-02-07 14:26:29 -05:00
eric-forte-elastic 9ce8faebea Updated ECS mappings from keyword to wildcard (#2518)
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2023-02-07 09:43:19 -05:00
Mika Ayenson 51b7df8613 Check integrations cross major versions for older release support (#2520) 2023-02-02 18:17:02 -05:00
Mika Ayenson e6ba0055fb Resolve backport checks on 2470 by checking Version min_stack (#2519) 2023-02-02 17:29:30 -05:00
Mika Ayenson 1784429aa7 [FR] Add Integration Schema Query Validation (#2470) 2023-02-02 16:22:44 -05:00
Samirbous b8dcc6ab4b [New Rules] C2 via BITS and CertReq (#2466)
* Create command_and_control_certreq_postdata.toml

* Update command_and_control_certreq_postdata.toml

* Update command_and_control_certreq_postdata.toml

* Create command_and_control_ingress_transfer_bits.toml

* Update non-ecs-schema.json

* Update command_and_control_certreq_postdata.toml

* Update command_and_control_ingress_transfer_bits.toml

* Update rules/windows/command_and_control_certreq_postdata.toml

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

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2023-01-27 20:17:36 +00:00
Samirbous 1c6e5a3448 [New Rule] Suspicious Inter-Process Communication via Outlook (#2458)
* Create collection_email_outlook_mailbox_via_com.toml

* Update non-ecs-schema.json

* Update rules/windows/collection_email_outlook_mailbox_via_com.toml

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

* Update rules/windows/collection_email_outlook_mailbox_via_com.toml

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

* Update rules/windows/collection_email_outlook_mailbox_via_com.toml

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

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2023-01-25 17:44:32 +00:00
Samirbous 1a5e64ce13 [New Rule] T1543.003 - Unsigned DLL Loaded by Svchost (#2477)
* Create persistence_service_dll_unsigned.toml

* Update non-ecs-schema.json

* Update persistence_service_dll_unsigned.toml

* Update rules/windows/persistence_service_dll_unsigned.toml

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

* Update detection_rules/etc/non-ecs-schema.json

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

* Update persistence_service_dll_unsigned.toml

* Update persistence_service_dll_unsigned.toml

* Update non-ecs-schema.json

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2023-01-25 17:11:38 +00:00
Samirbous bcd8ef15ba [New Rule] Unsigned DLL Side-Loading from a Suspicious Folder (#2409)
* Create defense_evasion_unsigned_dll_loaded_from_suspdir.toml

* Update non-ecs-schema.json

* Update defense_evasion_unsigned_dll_loaded_from_suspdir.toml

* Update rules/windows/defense_evasion_unsigned_dll_loaded_from_suspdir.toml

Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2023-01-25 13:23:20 +00:00
github-actions[bot] d81bc25d09 Lock versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6 (#2468)
* Locked versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6

* added newline in version lock file to trigger checks

* removed trailing newline from version lock file

Co-authored-by: terrancedejesus <terrancedejesus@users.noreply.github.com>
Co-authored-by: terrancedejesus <terrance.dejesus@elastic.co>
2023-01-13 15:20:23 -05:00
github-actions[bot] 6acc0f9b11 Lock versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6 (#2455)
* Locked versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6

* added newline in version lock file to trigger checks

* removed trailing newline from version lock file

Co-authored-by: terrancedejesus <terrancedejesus@users.noreply.github.com>
Co-authored-by: terrancedejesus <terrance.dejesus@elastic.co>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2023-01-10 09:50:41 -05:00
Terrance DeJesus bdffab5722 adding initial solution (#2448) 2023-01-04 12:28:34 -05:00
Terrance DeJesus 4312d8c958 [FR] Add Endpoint, APM and Windows Integration Tags to Rules and Supportability (#2429)
* initial commit

* addressing flake errors

* added apm to _get_packagted_integrations logic

* addressed flake errors

* adjusted integration schema and updated rules to be a list

* updated several rules and removed a unit test

* updated rules with logs-* only index patterns

* Update tests/test_all_rules.py

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

* addressed flake errors

* integration is none is windows, endpoint or apm

* adding rules with accepted incoming changes from main

* fixed tag and tactic alignment errors from unit testing

* adjusted unit testing logic for integration tags; added more exclusion rules

* adjusted test_integration logic to be rule resistent and skip if -8.3

* adjusted comments for unit test skip

* fixed merge conflicts from main

* changing test_integration_tag to remove logic for rule version comparisons

* added integration tag to new rule

* adjusted rules updated_date value

* ignore guided onboarding rule in unit tests

* added integration tag to new rule

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2023-01-04 09:30:07 -05:00
Terrance DeJesus 953e8d98ae [Bug] Adjust Kibana Path for File System Rules (#2397)
* adjusted kibana rules path

* addressed flake errors for long string

* added missing / to directory path
2023-01-03 14:54:24 -05:00
Jonhnathan 0acbe1d832 [New Rule] Multiple Alerts Involving a User (#2401)
* [New Rule] Multiple Alerts Involving a User

* Update definitions.py

* update query

* Update multiple_alerts_involving_user.toml

Co-authored-by: Colson Wilhoit <48036388+DefSecSentinel@users.noreply.github.com>
2023-01-03 12:25:40 -03:00
Terrance DeJesus baa6b77040 [Rule Tuning] Change Guided Onboarding Rule to Experimental (#2439)
* initial commit with rule changes

* removed rule from version lock file to pass unit testing; adjusted rule file name

* adjusted maturity to development
2022-12-21 13:36:24 -05:00
Terrance DeJesus e9169b4cfa [Bug] Add Non-ECS Checks to New Terms Rule Validation (#2435)
* initial commit with changes to new terms validation

* adjusted validation to call KQLValidator for flattened ECS variable

* changed call to KQLValidator instead of super; validate from same variable

* removed testing rules

* removed commented line

* Version() called on all string versions prior to comparison logic

* adjusted assert error punctuation
2022-12-19 12:44:42 -05:00
Jonhnathan 9f6a54e645 [Rule Tuning] Multiple Alerts in Different ATT&CK Tactics on a Single Host (#2423)
* [Rule Tuning] Multiple Alerts in Different ATT&CK Tactics on a Single Host

* Update non-ecs-schema.json

* Remove duplicated value on non-ecs-schema.json

Co-authored-by: Colson Wilhoit <48036388+DefSecSentinel@users.noreply.github.com>
2022-12-16 16:05:18 -03:00
Terrance DeJesus ae4e59ec7d [FR] Update ATT&CK Package to v12.1 (#2422)
* initial update to v12.1 attack package

* added additional click echo output

* addressed flake errors

* updated rules with refreshed att&ck data

* Update detection_rules/devtools.py

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

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2022-12-16 12:04:20 -05:00
Terrance DeJesus 06053fa0c6 initial commit and updates (#2424) 2022-12-13 10:52:45 -05:00
Mika Ayenson 5bf69b7967 Update package and install process (#1948) 2022-12-08 15:49:49 -05:00
Terrance DeJesus 7e459dd585 [FR] Add support for New Terms Fields and Window Start History (#2360)
* adding support new_terms_fields and window_start_history

* adjusted rule.py to address flake errors

* added assertion error if history_window_start does not exist

* removed sample rule

* removed self.rule_id from DataValidator

* added new_terms to RuleType

* changed new terms to its own class in rule.py

* removed nonexisting function call in DataValidator class

* adjusted new_terms field value in dataclass

* changed literal type for history_window_start; view-rule working

* removing test TOML rule

* addressed flake errors for missing newlines

* added validation option and adjusted object referencing

* adjusted validation method call in post_validation

* addressed flake errors for multiple spaces

* added transform method to NewTermsRuleData class

* added validation for min stack version and new terms array length restraints

* added validation for unique new terms array

* Update detection_rules/rule.py

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

* removed historywindowstart definition and adjusted subclass

* removed test rule from commit

* adjusted if/else for data transform method check

* adjusted stack-schema-map; validation method name

* Update detection_rules/rule.py

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

* added assertion for history_window_start field value

* added variables for feature min stack and extended field min stack

* Update detection_rules/rule.py

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

* Update detection_rules/rule.py

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

* addressed flake errors for continuation line with same indent

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2022-12-05 14:07:33 -05:00
github-actions[bot] f8bcfe6800 Locked versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5,8.6 (#2407)
Co-authored-by: terrancedejesus <terrancedejesus@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2022-11-28 09:15:53 -05:00
Terrance DeJesus 57b8f630de initial commit with changes for 8.7 branch creation (#2406) 2022-11-21 12:55:01 -05:00
Jonhnathan a7caa4baf3 [New Rule] Multiple Alerts in Different ATT&CK Tactics on a Single Host (#2399)
* [New Rule] Multiple Alerts in Different ATT&CK Tactics on a Single Host

* Update definitions.py

* Update rules/cross-platform/multiple_alerts_different_tactics_host.toml

Co-authored-by: Justin Ibarra <brokensound77@users.noreply.github.com>

Co-authored-by: Justin Ibarra <brokensound77@users.noreply.github.com>
2022-11-18 17:38:27 -03:00
Samirbous b1ddfb11d4 [New Rule] Windows Services - winlog (#2280)
* [New Rule] Windows Services - winlog

https://github.com/elastic/detection-rules/issues/2164 (T1543.003 - Windows Service)

- remote windows service (4624,4697)
- suspicious windows service imagepath (7045, 4697) : cmd, powershell etc.

* added winlog.logon.type (keyword)

* Update non-ecs-schema.json

* Update persistence_service_windows_service_winlog.toml

* Update non-ecs-schema.json

Co-authored-by: Colson Wilhoit <48036388+DefSecSentinel@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2022-11-16 10:08:02 +00:00
Samirbous b0156181e7 [New Rules] T1134 Access Token Manipulation (#2373)
* New Rules] T1134 Access Token Manipulation

3 rules (2 compatible only with Elastic endpoint) and 1 generic one using winlogs.

* Update privilege_escalation_tokenmanip_sedebugpriv_enabled.toml

* fix ruleid

* Update privilege_escalation_via_token_theft.toml

* timestamp_override = "event.ingested"

* Update non-ecs-schema.json

* linted

* Update privilege_escalation_tokenmanip_sedebugpriv_enabled.toml

* Update non-ecs-schema.json

Co-authored-by: Colson Wilhoit <48036388+DefSecSentinel@users.noreply.github.com>
2022-11-15 19:50:47 +00:00
Samirbous 0bf7dd15a5 [New Rules] CredAccess via LDAP Attributes (#2391)
* Create credential_access_ldap_attributes.toml

* Create privilege_escalation_credroaming_ldap.toml

* Update non-ecs-schema.json

* Update privilege_escalation_credroaming_ldap.toml

just deleted the extra 'to'

Co-authored-by: Isai <59296946+imays11@users.noreply.github.com>
2022-11-15 15:55:01 +00:00
Mika Ayenson 4cfe24835a update endgame validation to the latest schema available (8.4.0) (#2375) 2022-11-01 17:27:47 -04:00
Justin Ibarra c1dd3c57ad Adds commands to manage ATT&CK mappings (#2343)
* add att&ck commands; fix 2 rule mappings

* update message to stdout

* updated date for rule changes

* unrelated click bug fix

* add type hinting
2022-11-01 13:14:40 -06:00
Mika Ayenson 24b5e8a8b0 [Bug] Convert config to pathlib.Path (#2377) 2022-11-01 10:43:32 -04:00
Mika Ayenson dcedacd583 add support for additional endgame field types (#2372) 2022-10-19 11:11:09 -04:00
Mika Ayenson aa8239652d [FR] Add endgame schema validation to detection-rule query (#2257) 2022-10-19 09:54:47 -04:00
Mika Ayenson 7b596c7729 [FR] Support forked rules with 100 version buffer space (#1946) 2022-10-14 14:45:28 -04:00
Isai 78d6093176 [New Rule] Kubernetes Container Created with Excessive Linux Capabilites (#2313)
* [New Rule] Kubernetes Container Created with Excessive Linux Capabilites

This rule detects a container deployed with one or more dangerously permissive Linux capabilities. Using the Linux capabilities feature you can grant certain privileges to a process without granting all the privileges of the root user. Added capabilities entitle containers in a pod with additional privileges that can be used to change core processes and networking settings of a cluster. An attacker with the ability to deploy a container with added capabilities could use this for further execution, lateral movement, or privilege escalation within a cluster or the host machine. This rule detects the following capabilities and leaves space for the exception of trusted permissive containers specific to your environment:

BPF - Allow creating BPF maps, loading BPF Type Format (BTF) data, retrieve JITed code of BPF programs, and more.

DAC_READ_SEARCH - Bypass file read permission checks and directory read and execute permission checks.

NET_ADMIN - Perform various network-related operations.

SYS_ADMIN - Perform a range of system administration operations.

SYS_BOOT - Use reboot(2) and kexec_load(2), reboot and load a new kernel for later execution.

SYS_MODULE - Load and unload kernel modules.

SYS_PTRACE - Trace arbitrary processes using ptrace(2).

SYS_RAWIO - Perform I/O port operations (iopl(2) and ioperm(2)).

SYSLOG - Perform privileged syslog(2) operations.

* Update privilege_escalation_container_created_with_excessive_linux_capabilities.toml

Edited description, false positives, and elaborated with a partial investigation guide.

* Update privilege_escalation_container_created_with_excessive_linux_capabilities.toml

added exception to rule query

* Update privilege_escalation_container_created_with_excessive_linux_capabilities.toml

add Execution.Deploy Container Tactic.Technique
2022-10-04 17:28:03 -04:00
Isai 701c8a0e22 Rule Changes (#2337)
K8s Rule Changes
2022-10-04 16:56:45 -04:00
github-actions[bot] 05b715f116 Lock versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5 (#2332)
* Locked versions for releases: 7.16,8.0,8.1,8.2,8.3,8.4,8.5

* Update detection_rules/etc/version.lock.json

* Update detection_rules/etc/version.lock.json

Co-authored-by: terrancedejesus <terrancedejesus@users.noreply.github.com>
Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2022-09-29 11:19:46 -04:00
Terrance DeJesus 4abd3b8354 [Bug] Version Comparison Bug in Related Integrations Field at Build Time (#2331)
* addresses version comparison bug for related_integrations field during build

* Update detection_rules/misc.py

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

* Update detection_rules/misc.py

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

* Update detection_rules/integrations.py

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

* addressed package version loading bug

* addressed flake errors

* adjusted find_least_compatible_version function to address sorting and semantic version comparison

* adjusted major version comparison in compare_versions sub function

* removed compare_versions sub function and included logic in iteration

* Update detection_rules/integrations.py

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

* Update detection_rules/integrations.py

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

* added OrderedDict to version and manifest iteration to enforce sorted dict object

Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
2022-09-29 09:58:08 -04:00