Skip to content

Commit

Permalink
[Maintenance] Repository Config Update (#4359)
Browse files Browse the repository at this point in the history
* updating tokens

* bumped patch

* updated navigator gist ID

* updated naming

* Update .github/workflows/manual-backport.yml

* updated navigator url

* updated noreply email

* updated naming

* Update .github/workflows/manual-backport.yml

Co-authored-by: Eric Forte <[email protected]>

* updating README

* updated gist token

* replaced guidelines token with GITHUB_TOKEN

---------

Co-authored-by: Eric Forte <[email protected]>
  • Loading branch information
terrancedejesus and eric-forte-elastic authored Jan 9, 2025
1 parent 6b0b988 commit ad18077
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-guidelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ jobs:
uses: mshick/add-pr-comment@v2
with:
message-path: ${{ env.GUIDELINES_FILE }}
repo-token: ${{ secrets.PROTECTIONS_MACHINE_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: "guidelines-comment"
2 changes: 1 addition & 1 deletion .github/workflows/attack-coverage-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Update navigator gist files and docs/ATT&CK-coverage.md file.
env:
GITHUB_TOKEN: "${{ secrets.NAVIGATOR_GIST_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.WRITE_TRADEBOT_GIST_TOKEN }}"
run: |
python -m detection_rules dev update-navigator-gists "${{ github.event.inputs.update-coverage }}"
git add docs/"ATT\&CK-coverage.md"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PROTECTIONS_MACHINE_TOKEN }}
token: ${{ secrets.WRITE_DETECTION_RULES_PROTECTIONS_TOKEN }}
ref: main
fetch-depth: 100

Expand Down Expand Up @@ -161,6 +161,6 @@ jobs:
- name: "Notify slack on failure"
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
slack_webhook_url: ${{ secrets.EXTERNAL_SLACK_DETECTION_RULES_URL }}
status: failure
if: failure()
2 changes: 1 addition & 1 deletion .github/workflows/branch-status-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
url: "https://api.github.com/repos/elastic/detection-rules/actions/workflows/pythonpackage.yml/runs?per_page=1&branch=${{matrix.target_branch}}"
method: 'GET'
bearerToken: ${{ secrets.READ_ORG_TOKEN }}
bearerToken: ${{ secrets.READ_ELASTIC_DETECTION_RULES_ORG_TOKEN }}

- name: Check Backport Status
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/github-script@v6
id: membership
with:
github-token: ${{ secrets.READ_ORG_TOKEN }}
github-token: ${{ secrets.READ_ELASTIC_DETECTION_RULES_ORG_TOKEN }}
result-encoding: string
script: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/kibana-mitre-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check MITRE ATT&CK Version Updates Are Synced

on:
pull_request:
types:
types:
- opened
paths:
- 'detection_rules/etc/attack-v*.json.gz'
Expand All @@ -18,8 +18,8 @@ jobs:
id: changed-attack-files
uses: tj-actions/changed-files@v44
with:
files: detection_rules/etc/attack-v*.json.gz
files: detection_rules/etc/attack-v*.json.gz

- name: Extract version from file name
id: extract_version
if: steps.changed-attack-files.outputs.any_changed == 'true'
Expand All @@ -33,9 +33,9 @@ jobs:
run: |
ISSUE_TITLE="[Security Solution] Update MITRE ATT&CK to ${{ steps.extract_version.outputs.version }}"
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."
curl -X POST \
-H "Authorization: token ${{ secrets.READ_WRITE_KIBANA_TOKEN }}" \
-H "Authorization: token ${{ secrets.WRITE_KIBANA_DETECTION_RULES_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/elastic/kibana/issues \
-d '{
Expand All @@ -44,4 +44,4 @@ jobs:
}'
env:
GITHUB_TOKEN: ${{ secrets.READ_WRITE_KIBANA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.WRITE_KIBANA_DETECTION_RULES_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/manual-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Checkout detection-rules
uses: actions/checkout@v3
with:
token: ${{ secrets.PROTECTIONS_MACHINE_TOKEN }}
token: ${{ secrets.WRITE_TRADEBOT_DETECTION_RULES_TOKEN }}
fetch-depth: 0

- name: Set github config
Expand Down Expand Up @@ -81,6 +81,6 @@ jobs:
- name: "Notify slack on failure"
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
slack_webhook_url: ${{ secrets.READ_DETECTION_RULES_SLACK_WEBHOOK_TOKEN }}
status: failure
if: failure()
6 changes: 3 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Fetch main branch
run: |
git fetch origin main:refs/remotes/origin/main
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -64,6 +64,6 @@ jobs:
- name: Update navigator gist files
env:
GITHUB_TOKEN: "${{ secrets.NAVIGATOR_GIST_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.WRITE_TRADEBOT_DETECTION_RULES_TOKEN }}"
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: python -m detection_rules dev update-navigator-gists
4 changes: 2 additions & 2 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Checkout elastic/security-docs
uses: actions/checkout@v3
with:
token: ${{ secrets.READ_WRITE_RELEASE_FLEET }}
token: ${{ secrets.WRITE_INTEGRATIONS_DETECTION_RULES_TOKEN }}
repository: "elastic/security-docs"
path: security-docs
fetch-depth: 0
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Create PR to elastic/security-docs
env:
GITHUB_TOKEN: ${{ secrets.PROTECTIONS_MACHINE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.WRITE_TRADEBOT_DETECTION_RULES_TOKEN }}
POST_VERSION: "v${{ github.event.inputs.post_version }}"
TARGET_BRANCH: "${{ github.event.inputs.target_branch }}"
UPDATE_BRANCH: "update-security-docs-prebuilt-rules-${{github.event.inputs.post_version}}"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-fleet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Checkout elastic/integrations
uses: actions/checkout@v3
with:
token: ${{ secrets.READ_WRITE_RELEASE_FLEET }}
token: ${{ secrets.WRITE_INTEGRATIONS_DETECTION_RULES_TOKEN }}
repository: ${{github.event.inputs.target_repo}}
path: integrations
fetch-depth: 0
Expand Down Expand Up @@ -119,8 +119,8 @@ jobs:
- name: Set github config
run: |
git config --global user.email "72879786+protectionsmachine@users.noreply.github.com"
git config --global user.name "protectionsmachine"
git config --global user.email "178941316+tradebot-elastic@users.noreply.github.com"
git config --global user.name "tradebot-elastic"
- name: Setup go
uses: actions/setup-go@v3
Expand All @@ -138,7 +138,7 @@ jobs:
TARGET_REPO: "${{github.event.inputs.target_repo}}"
TARGET_BRANCH: "${{github.event.inputs.target_branch}}"
LOCAL_REPO: "../integrations"
GITHUB_TOKEN: "${{ secrets.READ_WRITE_RELEASE_FLEET }}"
GITHUB_TOKEN: "${{ secrets.WRITE_INTEGRATIONS_DETECTION_RULES_TOKEN }}"
run: |
cd detection-rules
python -m detection_rules dev integrations-pr \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Supported Python versions](https://img.shields.io/badge/python-3.12+-yellow.svg)](https://www.python.org/downloads/)
[![Unit Tests](https://github.com/elastic/detection-rules/workflows/Unit%20Tests/badge.svg)](https://github.com/elastic/detection-rules/actions)
[![Chat](https://img.shields.io/badge/chat-%23security--detection--rules-blueviolet)](https://ela.st/slack)
[![ATT&CK navigator coverage](https://img.shields.io/badge/ATT&CK-Navigator-red.svg)](https://ela.st/detection-rules-navigator)
[![ATT&CK navigator coverage](https://img.shields.io/badge/ATT&CK-Navigator-red.svg)](https://ela.st/detection-rules-navigator-trade)

# Detection Rules

Expand Down
4 changes: 2 additions & 2 deletions detection_rules/devtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
from .version_lock import VersionLockFile, loaded_version_lock

GH_CONFIG = Path.home() / ".config" / "gh" / "hosts.yml"
NAVIGATOR_GIST_ID = '1a3f65224822a30a8228a8ed20289a89'
NAVIGATOR_URL = 'https://ela.st/detection-rules-navigator'
NAVIGATOR_GIST_ID = '0443cfb5016bed103f1940b2f336e45a'
NAVIGATOR_URL = 'https://ela.st/detection-rules-navigator-trade'
NAVIGATOR_BADGE = (
f'[![ATT&CK navigator coverage](https://img.shields.io/badge/ATT&CK-Navigator-red.svg)]({NAVIGATOR_URL})'
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "detection_rules"
version = "0.3.12"
version = "0.3.13"
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
readme = "README.md"
requires-python = ">=3.12"
Expand Down

0 comments on commit ad18077

Please sign in to comment.