Skip to content

Commit 02f0f0d

Browse files
Create an Issue in Kibana for MITRE Updates (#3796)
(cherry picked from commit 30ffe00)
1 parent 3be1c38 commit 02f0f0d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check MITRE ATT&CK Version Updates Are Synced
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
paths:
8+
- 'detection_rules/etc/attack-v*.json.gz'
9+
10+
jobs:
11+
create_issue:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Get MITRE Attack changed files
18+
id: changed-attack-files
19+
uses: tj-actions/changed-files@v44
20+
with:
21+
files: detection_rules/etc/attack-v*.json.gz
22+
23+
- name: Extract version from file name
24+
id: extract_version
25+
if: steps.changed-attack-files.outputs.any_changed == 'true'
26+
env:
27+
ADDED_FILE: ${{ steps.changed-attack-files.outputs.added_files }}
28+
run: |
29+
VERSION=$(echo $ADDED_FILE[0] | grep -o 'v[^json]*')
30+
echo "::set-output name=version::$VERSION"
31+
32+
- name: Create issue in elastic/kibana repository
33+
run: |
34+
ISSUE_TITLE="[Security Solution] Update MITRE ATT&CK to ${{ steps.extract_version.outputs.version }}"
35+
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."
36+
37+
curl -X POST \
38+
-H "Authorization: token ${{ secrets.READ_WRITE_KIBANA_TOKEN }}" \
39+
-H "Accept: application/vnd.github.v3+json" \
40+
https://api.github.com/repos/elastic/kibana/issues \
41+
-d '{
42+
"title": "'"$ISSUE_TITLE"'",
43+
"body": "'"$ISSUE_BODY"'"
44+
}'
45+
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.READ_WRITE_KIBANA_TOKEN }}

0 commit comments

Comments
 (0)