name: Advanced Security (Malware & Secrets)
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
permissions: read-all
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
secret-scan:
name: High-Entropy Secret Sweeper
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden Runner (Endpoint Network Security)
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 with:
egress-policy: audit
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with:
fetch-depth: 0
- name: Gitleaks Scan
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
malware-scan:
name: Repository-Wide Malware Scan (ClamAV)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden Runner (Endpoint Network Security)
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 with:
egress-policy: audit
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Cache ClamAV Database
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 with:
path: /var/lib/clamav
key: ${{ runner.os }}-clamav-db-${{ github.sha }}
restore-keys: |
${{ runner.os }}-clamav-db-
- name: Install ClamAV
run: |
sudo apt-get update
sudo apt-get install -y clamav clamav-daemon
sudo systemctl stop clamav-freshclam
sudo chown -R clamav:clamav /var/lib/clamav || true
for i in {1..3}; do sudo freshclam && break || sleep 5; done
- name: Run ClamAV Scan
run: clamscan -r -i ./
license-firewall:
name: Dependency License Firewall (Copyleft Block)
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Harden Runner (Endpoint Network Security)
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Dependency Review & Legal Firewall
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 with:
comment-summary-in-pr: always
fail-on-severity: high
deny-licenses: AGPL-1.0, AGPL-3.0, GPL-1.0, GPL-2.0, GPL-3.0, LGPL-2.0, LGPL-2.1, LGPL-3.0