From 4fbdcb886f1e6515906d77a9b15ad8a6de8ccf63 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Dec 2026 15:42:51 +0300 Subject: [PATCH] ci: audit pinned dependencies weekly and on lock-file changes Adds a security workflow with read-only token permissions that runs pip-audit on apps/api/requirements.lock and npm audit (production, high and above) on the web lock file. Records the pip-audit pin in docs/VERSIONS.md. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01A2y4b87iFhsrE3GaZwLMbs --- .github/workflows/security.yml | 42 ++++++++++++++++++++++++++++++++++ docs/VERSIONS.md | 5 ++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..a7e4f09 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,42 @@ +name: Security audit + +# Checks the pinned dependencies against public advisory databases. +# Reads the lock files only; it never installs or runs project code. +on: + pull_request: + paths: + - "apps/api/requirements.lock" + - "apps/web/package-lock.json" + - ".github/workflows/security.yml" + push: + branches: [main] + schedule: + - cron: "17 5 * * 1" # weekly, Monday 05:17 UTC, so new advisories surface without a push + +permissions: + contents: read + +jobs: + api-audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + - run: pip install pip-audit==2.9.0 + # --no-deps --disable-pip: audit exactly what the lock file pins, without resolving or installing. + - run: pip-audit --no-deps --disable-pip -r apps/api/requirements.lock + + web-audit: + runs-on: ubuntu-latest + defaults: + run: + working-directory: apps/web + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + # Production dependencies only; fails on high or critical advisories. + - run: npm audit --omit=dev --audit-level=high diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 68f66c5..22e84e8 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -57,3 +57,8 @@ GitHub REST API version is pinned to `2022-11-28` (setting `GITHUB_API_VERSION`) GitHub released `2026-03-10` with breaking changes; upgrade deliberately, not by accident. GitHub syncs, indexing, pull request reviews and CI analyses run as Celery jobs (or inline with `JOB_BACKEND=inline`). Phase 8 (CI analysis) added no new dependencies. + +## CI tooling +| Tool | Version | +|---|---| +| pip-audit (`.github/workflows/security.yml`) | 2.9.0 |