chore: fix compliance gaps surfaced by automated-assessment #2
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: | |
| branches: [main] | |
| schedule: | |
| - cron: '0 6 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| audit: | |
| name: Python security audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Sync project dependencies | |
| run: uv sync --all-extras --dev --frozen | |
| - name: pip-audit (via uv export) | |
| run: | | |
| uv export --format requirements-txt --no-hashes --no-emit-project > /tmp/requirements.txt | |
| uv run --frozen pip-audit --requirement /tmp/requirements.txt | |
| - name: bandit (medium+ severity) | |
| # Low-severity findings are mostly subprocess reminders on array-style | |
| # calls we've already reviewed; fail only on medium or high. | |
| run: uv run --frozen bandit -r cli_audit -ll -c pyproject.toml | |
| sbom: | |
| name: Generate SBOM (CycloneDX) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Sync project dependencies (so cyclonedx-py sees the real set) | |
| run: uv sync --all-extras --dev --frozen | |
| - name: Install cyclonedx-bom | |
| run: uv run --frozen pip install cyclonedx-bom | |
| - name: Generate CycloneDX SBOM | |
| run: uv run --frozen cyclonedx-py environment --of JSON -o sbom.cdx.json | |
| - name: Upload SBOM artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: sbom-cyclonedx | |
| path: sbom.cdx.json | |
| retention-days: 90 |