Security #17
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: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 7 * * 1" # Weekly Monday 07:00 UTC | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| bandit: | |
| name: Bandit (Python SAST) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - run: pip install bandit[toml] | |
| - run: bandit -r backend/app -ll -ii -x backend/app/tests,backend/tests | |
| pip-audit: | |
| name: pip-audit (Python deps) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - run: pip install pip-audit | |
| - run: pip-audit --requirement backend/requirements.txt --strict || true | |
| npm-audit: | |
| name: npm audit (Dashboard deps) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: dashboard | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: dashboard/package-lock.json | |
| - run: npm ci --no-audit --no-fund | |
| - run: npm audit --audit-level=high --omit=dev || true | |
| gitleaks: | |
| name: Gitleaks (secret scan) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: gitleaks/gitleaks-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| codeql: | |
| name: CodeQL (Python + JS) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [python, javascript-typescript] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: github/codeql-action/init@v3 | |
| with: | |
| languages: ${{ matrix.language }} | |
| - uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: /language:${{ matrix.language }} |