Project ons initialisation #26
Workflow file for this run
This file contains hidden or 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: Security | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| schedule: | |
| - cron: "0 6 * * 1" # every Monday 06:00 UTC — catches newly-disclosed CVEs | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| # ── Secret detection ──────────────────────────────────────────────────────── | |
| gitleaks: | |
| name: Secret scan (Gitleaks) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # full history — detect secrets in any commit | |
| - uses: gitleaks/gitleaks-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITLEAKS_SCAN_MODE: detect | |
| # ── SAST ──────────────────────────────────────────────────────────────────── | |
| codeql: | |
| name: SAST (CodeQL) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: github/codeql-action/init@v4 | |
| with: | |
| languages: javascript-typescript | |
| queries: security-extended | |
| - uses: github/codeql-action/analyze@v4 | |
| with: | |
| category: /language:javascript-typescript | |
| # ── Dependency vulnerability scan ─────────────────────────────────────────── | |
| trivy: | |
| name: Dependency scan (Trivy) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| security-events: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Scan for HIGH/CRITICAL CVEs | |
| uses: aquasecurity/trivy-action@v0.36.0 | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| severity: HIGH,CRITICAL | |
| format: sarif | |
| output: trivy.sarif | |
| exit-code: "1" | |
| ignore-unfixed: true | |
| - name: Upload results to Security tab | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: trivy.sarif | |
| category: trivy |