mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-11-02 19:28:19 +01:00
Updates GitHub Actions to their latest releases and switches .github/workflows/docs.yml from floating major tags to commit-SHA pins, so every actions/* reference is pinned by SHA with a version comment (matching the convention used in the other workflows). - actions/checkout v6.0.2 -> v7.0.1 (docs.yml was already @v7) - actions/setup-python v6 / v6.3.0 -> v7.1.0 - actions/setup-node v6.4.0 -> v7.1.0 - actions/upload-artifact v7.0.1 -> v7.0.2 - actions/configure-pages -> v6.0.0 (SHA-pinned) - actions/upload-pages-artifact -> v5.0.0 (SHA-pinned) - actions/deploy-pages -> v5.0.1 (SHA-pinned) peter-evans/create-pull-request (v8.1.1) and peter-evans/enable-pull-request-automerge (v3.0.0) are already on their latest releases and left unchanged. Safe for our usage: checkout v7 only changes pull_request_target / workflow_run behavior (unused here); setup-python v7 drops the unused pip-install input (both usages pass only python-version / cache). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
68 lines
2.3 KiB
YAML
68 lines
2.3 KiB
YAML
name: update MITRE ATT&CK remap table
|
|
|
|
on:
|
|
schedule:
|
|
# ATT&CK ships twice a year plus occasional Agile releases, so check monthly.
|
|
- cron: '0 21 2 * *'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout self repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Regenerate the remap block in WELA.ps1
|
|
run: python3 tools/update_attack_remap.py WELA.ps1
|
|
|
|
- name: Verify WELA.ps1 still parses
|
|
shell: pwsh
|
|
run: |
|
|
$errors = $null
|
|
$tokens = $null
|
|
[void][System.Management.Automation.Language.Parser]::ParseFile(
|
|
(Resolve-Path ./WELA.ps1), [ref]$tokens, [ref]$errors)
|
|
if ($errors) {
|
|
$errors | ForEach-Object { Write-Host $_.Message }
|
|
exit 1
|
|
}
|
|
Write-Host 'WELA.ps1 parsed successfully'
|
|
|
|
- name: Check for changes
|
|
id: check
|
|
run: |
|
|
if [ -n "$(git status --porcelain WELA.ps1)" ]; then
|
|
echo "change_exist=true" >> $GITHUB_ENV
|
|
echo "action_date=$(date '+%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
|
|
else
|
|
echo "change_exist=false" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Create Pull Request
|
|
if: env.change_exist == 'true'
|
|
id: cpr
|
|
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: Update MITRE ATT&CK remap table (${{ env.action_date }})
|
|
branch: attack/auto-remap-update
|
|
delete-branch: true
|
|
title: '[Auto] MITRE ATT&CK remap table update (${{ env.action_date }})'
|
|
branch-suffix: timestamp
|
|
body: |
|
|
Regenerated `$script:AttackTechniqueRemap` / `$script:AttackVersion` in `WELA.ps1`
|
|
from the latest Enterprise ATT&CK release.
|
|
|
|
If `$script:AttackVersion` changed, the ATT&CK major version has moved. Re-check the
|
|
heatmap in ATT&CK Navigator and refresh `screenshots/mitre.png` before merging.
|