Skip to content

Commit 6219fc0

Browse files
Move etc under detection_rules (elastic#1885)
* Move etc directory under detection_rules * Prepend original `etc` path with `detection_rules` * Update docstrings in util and CODEOWNERS * Add resiliency to tags to account for the old directory structure * Bug fix: remove unused param caused by commit 6ed1a39 Co-authored-by: Justin Ibarra <[email protected]>
1 parent 3f047b9 commit 6219fc0

File tree

144 files changed

+84
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+84
-68
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# detection-rules code owners
22
# POC: Elastic Security Intelligence and Analytics Team
33

4-
tests/**/*.py @brokensound77 @rw-access
5-
detection_rules/ @brokensound77 @rw-access
6-
tests/ @brokensound77 @rw-access
4+
tests/**/*.py @brokensound77 @mikaayenson @terrancedejesus
5+
detection_rules/ @brokensound77 @mikaayenson @terrancedejesus
6+
tests/ @brokensound77 @mikaayenson @terrancedejesus
77

88
# skip rta-mapping to avoid the spam
9-
etc/packages.yml @brokensound77 @rw-access
10-
etc/*.json @brokensound77 @rw-access
11-
etc/*.json @brokensound77 @rw-access
12-
etc/*/* @brokensound77 @rw-access
9+
detection_rules/etc/packages.yml @brokensound77 @mikaayenson @terrancedejesus
10+
detection_rules/etc/*.json @brokensound77 @mikaayenson @terrancedejesus
11+
detection_rules/etc/*.json @brokensound77 @mikaayenson @terrancedejesus
12+
detection_rules/etc/*/* @brokensound77 @mikaayenson @terrancedejesus
1313

.github/paths-labeller.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
- "./**/*.md"
44
- "schema":
55
- "detection_rules/beats.py"
6-
- "etc/beats_schemas/**/*"
6+
- "detection_rules/etc/beats_schemas/**/*"
77
- "detection_rules/ecs.py"
8-
- "etc/ecs_schemas/**/*"
9-
- "etc/api_schemas/**/*"
8+
- "detection_rules/etc/ecs_schemas/**/*"
9+
- "detection_rules/etc/api_schemas/**/*"
1010
- "detection_rules/schemas/**/*"
1111
- "python":
1212
- "detection_rules/**/*.py"

.github/workflows/lock-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
env:
5050
BRANCHES: "${{github.event.inputs.branches}}"
5151
run: |
52-
./etc/lock-multiple.sh $BRANCHES
53-
git add etc/version.lock.json
52+
./detection_rules/etc/lock-multiple.sh $BRANCHES
53+
git add detection_rules/etc/version.lock.json
5454
5555
- name: Create Pull Request
5656
uses: peter-evans/create-pull-request@v3

CONTRIBUTING.md

Lines changed: 24 additions & 22 deletions

README.md

Lines changed: 11 additions & 10 deletions

detection_rules/beats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _decompress_and_save_schema(url, release_name):
5656

5757
# remove all non-beat directories
5858
fs = {k: v for k, v in fs.get("folders", {}).items() if k.endswith("beat")}
59-
print(f"Saving etc/beats_schema/{release_name}.json")
59+
print(f"Saving detection_rules/etc/beats_schema/{release_name}.json")
6060

6161
compressed = gzip_compress(json.dumps(fs, sort_keys=True, cls=DateTimeEncoder))
6262
path = get_etc_path("beats_schemas", release_name + ".json.gz")

detection_rules/devtools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def read(self, git_tree="HEAD") -> bytes:
189189
def prune_staging_area(target_stack_version: str, dry_run: bool):
190190
"""Prune the git staging area to remove changes to incompatible rules."""
191191
exceptions = {
192-
"etc/packages.yml",
192+
"detection_rules/etc/packages.yml",
193193
}
194194

195195
target_stack_version = Version(target_stack_version)[:2]

0 commit comments

Comments
 (0)