Skip to content

Commit 81d78b3

Browse files
Merge branch 'main' into 2700-bug-missing-spaces-between-logic-operators-does-not-raise-error
2 parents d3ddef7 + c0631d2 commit 81d78b3

File tree

1,192 files changed

+62910
-32698
lines changed

Some content is hidden

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

1,192 files changed

+62910
-32698
lines changed

.github/CODEOWNERS

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

4-
tests/**/*.py @mikaayenson @eric-forte-elastic @terrancedejesus
5-
detection_rules/ @mikaayenson @eric-forte-elastic @terrancedejesus
6-
tests/ @mikaayenson @eric-forte-elastic @terrancedejesus
7-
lib/ @mikaayenson @eric-forte-elastic @terrancedejesus
8-
hunting/ @mikaayenson @eric-forte-elastic @terrancedejesus
4+
tests/**/*.py @mikaayenson @eric-forte-elastic @traut
5+
detection_rules/ @mikaayenson @eric-forte-elastic @traut
6+
tests/ @mikaayenson @eric-forte-elastic @traut
7+
lib/ @mikaayenson @eric-forte-elastic @traut
8+
hunting/**/*.py @mikaayenson @eric-forte-elastic @traut
99

1010
# skip rta-mapping to avoid the spam
11-
detection_rules/etc/packages.yaml @mikaayenson @eric-forte-elastic @terrancedejesus
12-
detection_rules/etc/*.json @mikaayenson @eric-forte-elastic @terrancedejesus
13-
detection_rules/etc/*.json @mikaayenson @eric-forte-elastic @terrancedejesus
14-
detection_rules/etc/*/* @mikaayenson @eric-forte-elastic @terrancedejesus
11+
detection_rules/etc/packages.yaml @mikaayenson @eric-forte-elastic @traut
12+
detection_rules/etc/*.json @mikaayenson @eric-forte-elastic @traut
13+
detection_rules/etc/*/* @mikaayenson @eric-forte-elastic @traut
14+
15+
# exclude files from code owners
16+
detection_rules/etc/non-ecs-schema.json

.github/ISSUE_TEMPLATE/new_meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ body:
3737
- type: textarea
3838
attributes:
3939
label: Tasking
40-
value: "```[tasklist]\n### Meta Tasks\n- [ ] Provide Week 1 Update Comment\n- [ ] Provide Week 2 Update or Closeout Comment\n```"
40+
value: "\n### Meta Tasks\n- [ ] Provide Week 1 Update Comment\n- [ ] Provide Week 2 Update or Closeout Comment\n"
4141
render:
4242

4343
- type: textarea

.github/PULL_REQUEST_GUIDELINES/bug_guidelines.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ These guidelines serve as a reminder set of considerations when addressing a bug
1111
### Code Standards and Practices
1212

1313
- [ ] Code follows established design patterns within the repo and avoids duplication.
14-
- [ ] Code changes do not introduce new warnings or errors.
15-
- [ ] Variables and functions are well-named and descriptive.
16-
- [ ] Any unnecessary / commented-out code is removed.
1714
- [ ] Ensure that the code is modular and reusable where applicable.
18-
- [ ] Check for proper exception handling and messaging.
1915

2016
### Testing
2117

@@ -25,11 +21,9 @@ These guidelines serve as a reminder set of considerations when addressing a bug
2521
- [ ] Validate that any rules affected by the bug are correctly updated.
2622
- [ ] Ensure that performance is not negatively impacted by the changes.
2723
- [ ] Verify that any release artifacts are properly generated and tested.
24+
- [ ] Conducted system testing, including fleet, import, and create APIs (e.g., run `make test-cli`, `make test-remote-cli`, `make test-hunting-cli`)
2825

2926
### Additional Checks
3027

31-
- [ ] Ensure that the bug fix does not break existing functionality.
32-
- [ ] Review the bug fix with a peer or team member for additional insights.
3328
- [ ] Verify that the bug fix works across all relevant environments (e.g., different OS versions).
34-
- [ ] Confirm that all dependencies are up-to-date and compatible with the changes.
3529
- [ ] Confirm that the proper version label is applied to the PR `patch`, `minor`, `major`.

.github/PULL_REQUEST_GUIDELINES/enhancement_guidelines.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ These guidelines serve as a reminder set of considerations when addressing addin
1111
### Code Standards and Practices
1212

1313
- [ ] Code follows established design patterns within the repo and avoids duplication.
14-
- [ ] Code changes do not introduce new warnings or errors.
15-
- [ ] Variables and functions are well-named and descriptive.
16-
- [ ] Any unnecessary / commented-out code is removed.
1714
- [ ] Ensure that the code is modular and reusable where applicable.
18-
- [ ] Check for proper exception handling and messaging.
1915

2016
### Testing
2117

@@ -25,11 +21,9 @@ These guidelines serve as a reminder set of considerations when addressing addin
2521
- [ ] Validate that any rules affected by the enhancement are correctly updated.
2622
- [ ] Ensure that performance is not negatively impacted by the changes.
2723
- [ ] Verify that any release artifacts are properly generated and tested.
24+
- [ ] Conducted system testing, including fleet, import, and create APIs (e.g., run `make test-cli`, `make test-remote-cli`, `make test-hunting-cli`)
2825

2926
### Additional Checks
3027

31-
- [ ] Ensure that the enhancement does not break existing functionality.
32-
- [ ] Review the enhancement with a peer or team member for additional insights.
3328
- [ ] Verify that the enhancement works across all relevant environments (e.g., different OS versions).
34-
- [ ] Confirm that all dependencies are up-to-date and compatible with the changes.
3529
- [ ] Confirm that the proper version label is applied to the PR `patch`, `minor`, `major`.

.github/PULL_REQUEST_GUIDELINES/schema_enhancement_guidelines.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ These guidelines serve as a reminder set of considerations when addressing addin
1111
### Code Standards and Practices
1212

1313
- [ ] Code follows established design patterns within the repo and avoids duplication.
14-
- [ ] Code changes do not introduce new warnings or errors.
15-
- [ ] Variables and functions are well-named and descriptive.
16-
- [ ] Any unnecessary / commented-out code is removed.
1714
- [ ] Ensure that the code is modular and reusable where applicable.
18-
- [ ] Check for proper exception handling and messaging.
1915

2016
### Testing
2117

@@ -25,23 +21,21 @@ These guidelines serve as a reminder set of considerations when addressing addin
2521
- [ ] Validate that any rules affected by the enhancement are correctly updated.
2622
- [ ] Ensure that performance is not negatively impacted by the changes.
2723
- [ ] Verify that any release artifacts are properly generated and tested.
24+
- [ ] Conducted system testing, including fleet, import, and create APIs (e.g., run `make test-cli`, `make test-remote-cli`, `make test-hunting-cli`)
2825

2926
### Additional Schema Related Checks
3027

31-
- [ ] Ensure that the enhancement does not break existing functionality. (e.g., run `make test-cli`)
32-
- [ ] Review the enhancement with a peer or team member for additional insights.
3328
- [ ] Verify that the enhancement works across all relevant environments (e.g., different OS versions).
34-
- [ ] Confirm that all dependencies are up-to-date and compatible with the changes.
3529
- [ ] Link to the relevant Kibana PR or issue provided
36-
- [ ] Exported detection rule(s) from Kibana to showcase the feature(s)
37-
- [ ] Converted the exported ndjson file(s) to toml in the detection-rules repo
38-
- [ ] Re-exported the toml rule(s) to ndjson and re-imported into Kibana
30+
- [ ] Test export/import flow:
31+
- [ ] Exported detection rule(s) from Kibana to showcase the feature(s)
32+
- [ ] Converted the exported ndjson file(s) to toml in the detection-rules repo
33+
- [ ] Re-exported the toml rule(s) to ndjson and re-imported into Kibana
3934
- [ ] Updated necessary unit tests to accommodate the feature
35+
- [ ] Incorporated a comprehensive test rule in unit tests for full schema coverage
4036
- [ ] Applied min_compat restrictions to limit the feature to a specified minimum stack version
4137
- [ ] Executed all unit tests locally with a test toml rule to confirm passing
4238
- [ ] Included Kibana PR implementer as an optional reviewer for insights on the feature
4339
- [ ] Implemented requisite downgrade functionality
4440
- [ ] Cross-referenced the feature with product documentation for consistency
45-
- [ ] Incorporated a comprehensive test rule in unit tests for full schema coverage
46-
- [ ] Conducted system testing, including fleet, import, and create APIs (e.g., run `make test-remote-cli`)
4741
- [ ] Confirm that the proper version label is applied to the PR `patch`, `minor`, `major`.

.github/workflows/attack-coverage-update.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/code-checks.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Code checks
2+
3+
on:
4+
push:
5+
branches: [ "main", "7.*", "8.*", "9.*" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
paths:
9+
- 'detection_rules/**/*.py'
10+
- 'hunting/**/*.py'
11+
- 'tests/**/*.py'
12+
- 'lib/**/*.py'
13+
14+
jobs:
15+
code-checks:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 1
23+
24+
- name: Set up Python 3.13
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.13'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip cache purge
33+
pip install .[dev]
34+
35+
- name: Linting check
36+
run: |
37+
ruff check --exit-non-zero-on-fix
38+
39+
- name: Formatting check
40+
run: |
41+
ruff format --check
42+
43+
- name: Pyright check
44+
run: |
45+
pyright
46+
47+
- name: Python License Check
48+
run: |
49+
python -m detection_rules dev license-check

.github/workflows/docs-build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: docs-build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_target: ~
8+
9+
jobs:
10+
preview:
11+
uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
12+
with:
13+
continue-on-error: false
14+
strict: true
15+
path-pattern: |
16+
docs/**
17+
rules/**
18+
rules_building_block/**
19+
permissions:
20+
deployments: write
21+
id-token: write
22+
contents: read
23+
pull-requests: write

.github/workflows/docs-cleanup.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: docs-cleanup
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
8+
jobs:
9+
preview:
10+
uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
11+
permissions:
12+
contents: none
13+
id-token: write
14+
deployments: write

.github/workflows/kibana-mitre-update.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ on:
1010
jobs:
1111
create_issue:
1212
runs-on: ubuntu-latest
13+
env:
14+
KIBANA_ISSUE_NUMBER: 166152 # Define the Kibana issue number as a variable
1315
steps:
1416
- name: Checkout code
1517
uses: actions/checkout@v4
1618

1719
- name: Get MITRE Attack changed files
18-
if: false
1920
id: changed-attack-files
20-
uses: tj-actions/changed-files@v44
21+
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
2122
with:
2223
files: detection_rules/etc/attack-v*.json.gz
2324

@@ -29,20 +30,14 @@ jobs:
2930
run: |
3031
VERSION=$(echo $ADDED_FILE[0] | grep -o 'v[^json]*')
3132
echo "::set-output name=version::$VERSION"
32-
33-
- name: Create issue in elastic/kibana repository
33+
34+
- name: Add Kibana Issue Comment
3435
run: |
35-
ISSUE_TITLE="[Security Solution] Update MITRE ATT&CK to ${{ steps.extract_version.outputs.version }}"
36-
ISSUE_BODY="The detection rules MITRE ATT&CK version has been updated to ${{ steps.extract_version.outputs.version }} Please update the MITRE ATT&CK version in Kibana accordingly."
37-
38-
curl -X POST \
39-
-H "Authorization: token ${{ secrets.WRITE_KIBANA_DETECTION_RULES_TOKEN }}" \
36+
echo "Adding comment to Kibana issue #${KIBANA_ISSUE_NUMBER}"
37+
curl -L \
38+
-X POST \
4039
-H "Accept: application/vnd.github.v3+json" \
41-
https://api.github.com/repos/elastic/kibana/issues \
42-
-d '{
43-
"title": "'"$ISSUE_TITLE"'",
44-
"body": "'"$ISSUE_BODY"'"
45-
}'
46-
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.WRITE_KIBANA_DETECTION_RULES_TOKEN }}
40+
-H "Authorization: token ${{ secrets.WRITE_KIBANA_DETECTION_RULES_TOKEN }}" \
41+
https://api.github.com/repos/elastic/kibana/issues/${KIBANA_ISSUE_NUMBER}/comments \
42+
-d '{"body":"The detection rules MITRE ATT&CK version has been updated to ${{ steps.extract_version.outputs.version }} Please help in scheduling the MITRE ATT&CK version upgrade in Kibana accordingly @banderror @approksiu. cc @elastic/threat-research-and-detection-engineering"}'
43+
exit $?

0 commit comments

Comments
 (0)