Skip to content

test: raise coverage 79% → 93% for OpenSSF Gold targets #623

test: raise coverage 79% → 93% for OpenSSF Gold targets

test: raise coverage 79% → 93% for OpenSSF Gold targets #623

Workflow file for this run

name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run weekly on Mondays at 08:00 UTC
- cron: "0 8 * * 1"
permissions:
contents: read
jobs:
bandit:
name: SAST (Bandit)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Run Bandit
run: uvx --from "bandit[toml]" bandit -r src/dns_aid -c pyproject.toml -f json -o bandit-report.json
- name: Display results
if: always()
run: uvx --from "bandit[toml]" bandit -r src/dns_aid -c pyproject.toml
- name: Upload Bandit report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: bandit-report
path: bandit-report.json
sbom:
name: SBOM Generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install dependencies
run: uv sync --frozen --extra dev --extra cli --extra mcp --extra route53
- name: Generate SBOM
run: uv run --with cyclonedx-bom cyclonedx-py environment -o sbom.json --output-format json
- name: Upload SBOM
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sbom
path: sbom.json
dependency-audit:
name: Dependency Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install dependencies
run: uv sync --frozen --extra dev --extra cli --extra mcp --extra route53
- name: Run pip-audit
# --ignore-vuln: transitive dep CVEs — no user input, all static flags.
# Each CVE is documented. Re-evaluate when fix versions are released.
run: |
uv run --with pip-audit pip-audit \
--ignore-vuln CVE-2026-4539 \
--ignore-vuln CVE-2025-8869 \
--ignore-vuln CVE-2026-1703 \
--ignore-vuln CVE-2026-34073 \
--ignore-vuln CVE-2026-25645 \
--ignore-vuln CVE-2026-3219
# CVE-2026-4539 pygments 2.19.2 — ReDoS in AdlLexer, local-only, no fix released
# CVE-2025-8869 pip 25.2 — tar symlink traversal, mitigated by Python >=3.12 PEP 706
# CVE-2026-1703 pip 25.2 — wheel path traversal, limited to install dir prefixes
# CVE-2026-34073 cryptography 46.0.5 — name constraint bypass, uncommon topology, fix: 46.0.6
# CVE-2026-25645 requests 2.32.5 — predictable temp path, only extract_zipped_paths(), fix: 2.33.0
# CVE-2026-3219 pip 26.0.1 — runner-image pip; affects the package manager only,
# not the dns-aid runtime; no user-supplied input flows
# through pip in CI; awaiting upstream pip fix
# (CVE-2025-45768 pyjwt suppression removed 2026-07-14: OSV bounded the
# affected range to <=2.10.1 on 2026-05-21; we ship 2.13.0, so pip-audit
# no longer reports it. History: SECURITY.md + closed issue #141.)