Weekly workflow to parse all Microsoft Sentinel and Microsoft Security Services Built-in Alerts to csv file #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Weekly workflow to parse all Microsoft Sentinel and Microsoft Security Services Built-in Alerts to csv file | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 1 * * */7" # Runs at 01:00 AM (UTC) every 7th day-of-week (Check https://crontab.tech/) | |
jobs: | |
download-mitreattackmap: | |
name: Weekly workflow to parse all Microsoft Sentinel and Microsoft Security Services Built-in Alerts to csv file | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: 🍽️ Checkout the repo | |
uses: actions/checkout@v2 | |
with: | |
path: master | |
fetch-depth: 0 | |
- name: 🐍 Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.8" | |
architecture: "x64" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pandas attackcti pyyaml requests_html lxml_html_clean | |
- name: 🚀 Run automation script | |
run: python master/.script/mitre-attackmap.py | |
- name: Check if there are changes to commit | |
id: check_diff | |
run: | | |
cd master | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
cd .. | |
- name: Commit files | |
if: steps.check_diff.outputs.changed == 'true' | |
run: | | |
cd master | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add * | |
git commit -m "Adding updated MITRE Attackmap files" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
if: steps.check_diff.outputs.changed == 'true' | |
with: | |
directory: "master" | |
github_token: ${{ secrets.GITHUB_TOKEN }} |