Skip to content

Commit a50610a

Browse files
authored
ci: pin Security-workflow deps via uv (Scorecard Pinned-Dependencies) (#157)
* ci: install security-workflow deps via uv to pin by hash The Security workflow used unpinned `pip install` for the project and for bandit / cyclonedx-bom / pip-audit, which OpenSSF Scorecard flags under Pinned-Dependencies. Switch to the same pattern as ci.yml: SHA-pinned astral-sh/setup-uv plus `uv sync --frozen` (installs from the hash-pinned uv.lock) for the project, and `uvx` / `uv run --with` for the standalone tools. No `pip install` remains in this workflow. Behavior is preserved: bandit runs the same static scan, SBOM generation produces the same environment SBOM, and pip-audit runs with the identical documented --ignore-vuln set. release.yml still uses pip (it publishes to PyPI) and is intentionally left for a separate, test-released change. Signed-off-by: Igor Racic <iracic82@gmail.com> * fix: bump starlette 0.52.1 -> 1.1.0 for PYSEC-2026-161 The Dependency Audit (now auditing the pinned uv.lock rather than a fresh resolve) surfaced starlette 0.52.1 as vulnerable to PYSEC-2026-161, fixed in 1.0.1. The lockfile was stale; constraints already allow the patched line. Refresh to 1.1.0. Verified: full unit suite (1688) and MCP/SSE tests (147) pass; pip-audit reports no known vulnerabilities. Signed-off-by: Igor Racic <iracic82@gmail.com> --------- Signed-off-by: Igor Racic <iracic82@gmail.com>
1 parent 4511b41 commit a50610a

2 files changed

Lines changed: 17 additions & 22 deletions

File tree

.github/workflows/security.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,15 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2222

23-
- name: Set up Python
24-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
25-
with:
26-
python-version: "3.12"
27-
28-
- name: Install Bandit
29-
run: pip install bandit[toml]
23+
- name: Set up uv
24+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3025

3126
- name: Run Bandit
32-
run: bandit -r src/dns_aid -c pyproject.toml -f json -o bandit-report.json
27+
run: uvx --from "bandit[toml]" bandit -r src/dns_aid -c pyproject.toml -f json -o bandit-report.json
3328

3429
- name: Display results
3530
if: always()
36-
run: bandit -r src/dns_aid -c pyproject.toml
31+
run: uvx --from "bandit[toml]" bandit -r src/dns_aid -c pyproject.toml
3732

3833
- name: Upload Bandit report
3934
if: always()
@@ -54,14 +49,14 @@ jobs:
5449
with:
5550
python-version: "3.12"
5651

52+
- name: Set up uv
53+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
54+
5755
- name: Install dependencies
58-
run: |
59-
python -m pip install --upgrade pip
60-
pip install ".[dev,cli,mcp,route53]"
61-
pip install cyclonedx-bom
56+
run: uv sync --frozen --extra dev --extra cli --extra mcp --extra route53
6257

6358
- name: Generate SBOM
64-
run: cyclonedx-py environment -o sbom.json --output-format json
59+
run: uv run --with cyclonedx-bom cyclonedx-py environment -o sbom.json --output-format json
6560

6661
- name: Upload SBOM
6762
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
@@ -81,17 +76,17 @@ jobs:
8176
with:
8277
python-version: "3.12"
8378

79+
- name: Set up uv
80+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
81+
8482
- name: Install dependencies
85-
run: |
86-
python -m pip install --upgrade pip
87-
pip install ".[dev,cli,mcp,route53]"
88-
pip install pip-audit
83+
run: uv sync --frozen --extra dev --extra cli --extra mcp --extra route53
8984

9085
- name: Run pip-audit
9186
# --ignore-vuln: transitive dep CVEs — no user input, all static flags.
9287
# Each CVE is documented. Re-evaluate when fix versions are released.
9388
run: |
94-
pip-audit \
89+
uv run --with pip-audit pip-audit \
9590
--ignore-vuln CVE-2026-4539 \
9691
--ignore-vuln CVE-2025-8869 \
9792
--ignore-vuln CVE-2026-1703 \

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)