name: security on: push: branches: [main] pull_request: schedule: - cron: "0 6 * * 1" # weekly Monday 06:00 UTC workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: # Supply-chain: RUSTSEC advisories (known CVEs), license policy, banned/duplicate crates. cargo-deny: runs-on: ubuntu-latest strategy: fail-fast: false matrix: checks: [advisories, licenses, bans, sources] steps: - uses: actions/checkout@v7 - uses: EmbarkStudios/cargo-deny-action@v2 with: command: check ${{ matrix.checks }} # cargo-deny "advisories" uses the same RUSTSEC database as cargo-audit and is the # single source of truth for the ignore policy (see deny.toml). A separate cargo-audit # job is intentionally omitted to avoid maintaining two divergent ignore lists. # Block PRs that introduce dependencies with known vulnerabilities or bad licenses. dependency-review: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/dependency-review-action@v5 with: fail-on-severity: high # OpenSSF Scorecard — supply-chain security posture of the repo itself. scorecard: if: github.event_name != 'pull_request' runs-on: ubuntu-latest permissions: security-events: write id-token: write steps: - uses: actions/checkout@v7 with: persist-credentials: false - uses: ossf/scorecard-action@v2.4.3 with: results_file: results.sarif results_format: sarif publish_results: true - uses: github/codeql-action/upload-sarif@v4 with: sarif_file: results.sarif