Skip to content

Transform "HijackLibs File Writes" Sigma rules to S1PQ #281

Transform "HijackLibs File Writes" Sigma rules to S1PQ

Transform "HijackLibs File Writes" Sigma rules to S1PQ #281

name: Transform "HijackLibs File Writes" Sigma rules to S1PQ
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Run once per day at midnight
jobs:
run-python-script:
runs-on: ubuntu-latest
permissions:
contents: write
env:
SIGMACATEGORY: "HijackLibs"
PLATFORM: "windows"
SIGMARULE: "file_writes"
SOURCEURL: "https://hijacklibs.net/api/sigma_feed_file.yml"
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.12'
- name: get sigma-cli
run: |
python -m pip install sigma-cli
- name: Install sigma-cli pipelines
run: |
sigma plugin install sentinelone-pq
- name: Download Sigma rules from HijackLibs
run: |
mkdir -p "${{ github.workspace }}/datasources/${{ env.SIGMACATEGORY }}"
wget -O "${{ github.workspace }}/datasources/${{ env.SIGMACATEGORY }}/${{ env.PLATFORM }}-${{ env.SIGMARULE }}.yml" ${{ env.SOURCEURL }}
- name: Create one file per Sigma rule
run: python "${{ github.workspace }}/transformers/sigma-splitter.py" --input_file "${{ github.workspace }}/datasources/${{ env.SIGMACATEGORY }}/${{ env.PLATFORM }}-${{ env.SIGMARULE }}.yml" --output_folder "${{ github.workspace }}/datasources/${{ env.SIGMACATEGORY }}/${{ env.PLATFORM }}-${{ env.SIGMARULE }}"
- name: Create destination folder "${{ github.workspace }}/results/${{ env.SIGMACATEGORY }}-${{ env.PLATFORM }}-${{ env.SIGMARULE }}"
run: |
mkdir -p "${{ github.workspace }}/results/S1PQ-${{ env.SIGMACATEGORY }}-${{ env.PLATFORM }}-${{ env.SIGMARULE }}"
- name: Run 'sigma-to-s1pq-converter.py' script
run: python "${{ github.workspace }}/transformers/sigma-to-s1pq-converter.py" "${{ github.workspace }}/datasources/${{ env.SIGMACATEGORY }}/${{ env.PLATFORM }}-${{ env.SIGMARULE }}" "${{ github.workspace }}/results/${{ env.SIGMACATEGORY }}/${{ env.PLATFORM }}-${{ env.SIGMARULE }}"
- name: Pull latest changes
run: git pull origin main
- name: Push changes
run: git push origin main
- name: Commit and push translated process creation rules
uses: stefanzweifel/git-auto-commit-action@v5