Skip to content

chore(deps): bundle Dependabot updates + harden dependency review workflows#78

Open
lelia wants to merge 5 commits into
mainfrom
lelia/dependabot-bundle-hardening
Open

chore(deps): bundle Dependabot updates + harden dependency review workflows#78
lelia wants to merge 5 commits into
mainfrom
lelia/dependabot-bundle-hardening

Conversation

@lelia

@lelia lelia commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Mirrors the Dependabot hardening from socket-sdk-python (#84) and socket-python-cli (#207 / #217 / #224), adapted to socket-basics — which ships both a uv.lock and two Dockerfiles — then adds a supply-chain watch for the four core OSS tools Dependabot can't track, and closes the SFW-bypass blindspot the CLI/SDK pattern introduced. Four threads:

  1. Bundle dependency updates — supersedes the 8 open Dependabot PRs in one verified change.
  2. Dependabot config — adds the missing uv ecosystem and groups every ecosystem into minor/patch + major bundles.
  3. Dependency review — Socket Firewall on every dependency PR (anonymous for forks/Dependabot, enterprise for trusted members), report artifacts, and a single always-on required gate.
  4. Core-tool supply-chain watch — discovers and Socket-scores the upstream versions of OpenGrep / TruffleHog / Trivy / Socket SCA.

1. Dependencies (supersedes 8 Dependabot PRs)

PR Package Bump Notes
#72 idna 3.10 → 3.18 CVE-2026-45409 fix (newer than Dependabot's 3.15)
#71 pygments 2.19.2 → 2.20.0
#70 urllib3 2.6.3 → 2.7.0
#67 pytest 8.4.2 → 9.0.3
#76 docker/metadata-action 5.10.0 → 6.1.0 major
#75 docker/login-action 3.7.0 → 4.2.0 major
#74 docker/build-push-action 6.19.2 → 7.2.0 major
#73 docker/setup-buildx-action 4.0.0 → 4.1.0 grouped

Python bumps are transitive/dev deps (runtime constraints in pyproject.toml unchanged; targeted uv lock --upgrade-package only). The four docker/* action SHAs live in _docker-pipeline.yml (majors pinned by SHA). The 8 Dependabot PRs were closed manually, each pointing here.

2. Dependabot config (.github/dependabot.yml)

  • Adds the uv ecosystem — the gap that let the Python PRs pile up ungrouped.
  • Every ecosystem (uv, docker ×2, github-actions) groups into a weekly minor/patch bundle + a separate major PR.
  • GitHub Actions also scans /.github/actions/* (the new composite action). 7-day cooldown retained.

3. Dependency review (.github/workflows/dependency-review.yml)

Renamed from dependabot-review.yml, runs on every PR. inspect classifies the PR; exactly one Socket Firewall job runs when Python deps change:

  • Enterprise (firewall-enterprise + token) — trusted in-repo non-Dependabot PRs (write-access holders). Only this job references the secret.
  • Free (firewall-free, anonymous) — Dependabot, forks, externals, or whenever the token is absent.

The enterprise path degrades to free when the token is missing, so secretless contexts never hard-error. Both jobs capture the structured SFW report ($SFW_JSON_REPORT_PATH) into a sfw-report-free / sfw-report-enterprise artifact.

Environment kept for secret scoping; approval rule forbidden (uniform with socket-python-cli#224). environment: socket-firewall scopes the token so only the enterprise job can read it. The trap is a required-reviewers rule on that environment: it's self-approvable (prevent_self_review defaults off; admins bypass) yet skippable, so the meaningful check silently never runs. Configure with no reviewers:

gh api -X PUT repos/SocketDev/socket-basics/environments/socket-firewall \
  --input - <<<'{"wait_timer":0,"prevent_self_review":false,"reviewers":null,"deployment_branch_policy":null}'

Coverage is enforced instead by the always-on dependency-review-gate aggregator (Pattern 2): it needs every conditional job, fails on any failure/cancelled (success/skipped pass), and additionally requires the trust-appropriate SFW edition to have succeeded when Python deps changed. It runs if: always() so the required context is always created (no Pattern-1 bypass twin needed). Mark only dependency-review-gate as the required check — and merge it to main first, then add it to branch protection (requiring a check before it exists on main strands every open PR).

Docker dep changes: the main image is already build-smoke-tested by smoke-test.yml, so only the app_tests image (uncovered elsewhere) is built here.

4. Core-tool supply-chain watch (core-tool-watch.yml + scripts/check_core_tools.py)

Three of the four core tools — OpenGrep, TruffleHog, Trivy — ship as binaries / images / GitHub releases Dependabot can't track; the fourth, Socket SCA (socketdev), is a PyPI package. The watcher:

  • Discovers the latest upstream version of each (GitHub Releases + PyPI) vs the repo pins (Dockerfile ARGs + uv.lock).
  • Scores the package coordinates through the Socket API — dogfooding the socketdev SDK's purl.post() that socket-basics already depends on (pkg:pypi/..., pkg:golang/..., pkg:github/...).
  • schedule / dispatchwatch: report drift, upsert a core-tool-drift issue. PR / push touching pinsbuild: analyze the versions a build would bake in and fail on a malware/critical alert.
  • Uploads a core-tools-report artifact (markdown + JSON); degrades to discovery-only without a token.

OpenGrep Socket coverage (new): Socket has no data for OpenGrep's pkg:github coordinate. Since OpenGrep is a hard fork of Semgrep, the watcher now falls back to scoring the upstream Semgrep lineage (pkg:pypi/semgrep) as a project-health proxy — clearly labeled (via semgrep upstream proxy) and report-only, never build-failing (it doesn't analyze OpenGrep's own release artifacts). The npm opengrep package is a single-version squat and is deliberately not used.

5. Workflow plumbing

  • .github/actions/setup-sfw composite action (Python 3.12 + uv + Socket Firewall, free/enterprise; resolves effective mode and falls back to free when enterprise is requested without a token, so it never hard-errors).
  • python-tests.yml gains a uv lock --locked drift guard.

Setup / follow-ups

  • The socket-firewall environment + SOCKET_SFW_API_TOKEN secret are in place (no reviewers rule) — the enterprise path and core-tool Socket scoring run authenticated.
  • After this PR merges, mark dependency-review-gate as the single required status check on main. Do not add a required-reviewers rule to the socket-firewall environment — that's the bypass blindspot this PR avoids.

Test plan (live CI, green)

  • python-testsuv lock --locked drift guard + 139 tests pass
  • smoke-test — full Docker build + smoke + integration
  • dependency-review — enterprise SFW (firewall-enterprise, authenticated) + dependency-review-gate enforcing; gate fail-closed when enterprise failed, passing once it succeeded
  • core-tool-watch build mode — TruffleHog / Trivy / socketdev scored clean; OpenGrep via Semgrep proxy; no spurious drift issue
  • SFW report artifacts uploaded; actionlint / zizmor --offline clean

Bundles 8 open Dependabot PRs into one verified change and hardens the
Dependabot config + dependency-review workflows, mirroring the work in
socket-sdk-python#84 and socket-python-cli#207/#217. Adds a supply-chain
watch for the four core OSS tools Dependabot cannot cleanly track.

- uv.lock: idna 3.10->3.18 (CVE-2026-45409), pygments 2.19.2->2.20.0,
  pytest 8.4.2->9.0.3, urllib3 2.6.3->2.7.0
- _docker-pipeline.yml: bump 4 docker/* actions (setup-buildx, login,
  metadata, build-push)
- dependabot.yml: add uv ecosystem, group every ecosystem into
  minor/patch + major bundles, scan composite actions
- dependency-review.yml (was dependabot-review.yml): runs on every PR;
  free/enterprise sfw split; report artifacts; app_tests docker smoke
- core-tool-watch.yml + scripts/check_core_tools.py: discover latest
  versions of opengrep/trufflehog/trivy/socketdev and score them through
  the Socket API (socketdev SDK purl.post); drift issue + report artifact
- python-tests.yml: uv.lock drift guard

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lelia lelia requested a review from a team as a code owner June 2, 2026 23:17
@socket-security

socket-security Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​pytest@​8.4.2 ⏵ 9.0.387 -3100 +2100100100

View full report

@socket-security-staging

socket-security-staging Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​pytest@​8.4.2 ⏵ 9.0.387 -3100 +2100100100

View full report

@lelia lelia changed the title chore(deps): bundle dependency updates + harden supply-chain review chore(deps): bundle Dependabot updates + harden dependency review Jun 3, 2026
@lelia lelia changed the title chore(deps): bundle Dependabot updates + harden dependency review chore(deps): bundle Dependabot updates + harden dependency review workflows Jun 3, 2026
@lelia lelia added dependencies Pull requests that update a dependency file github-actions labels Jun 3, 2026
lelia and others added 2 commits June 3, 2026 13:35
… gate

Mirroring the Python CLI/SDK used `environment: socket-firewall` to scope the
SFW token, but that environment can carry a required-reviewers approval gate.
Because the enterprise SFW check can't be a required status check (it would
block Dependabot/fork PRs that only run the free edition), maintainers could
merge without approving the deployment -- the meaningful check silently never
ran, and approvers could rubber-stamp their own PRs. On the scheduled
core-tool-watch job an approval gate would hang the cron run outright.

- Remove `environment:` from python-sfw-smoke-enterprise and core-tool-watch;
  use a plain repo/org SOCKET_SFW_API_TOKEN (zizmor secrets-outside-env is
  already disabled here, so no lint cost). Job split still isolates the token
  to the enterprise job only.
- Add always-on `dependency-review-gate` job: pass when no python deps changed,
  else require the free (Dependabot/fork) or enterprise (maintainer) smoke job
  to have succeeded. Mark THIS as the single required status check -- safe on
  every PR, no manual gate, no bypass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adopt the socket-python-cli#224 pattern uniformly. The environment was never
the problem -- the required-reviewers approval RULE on it was. Keep the
environment for secret scoping; forbid the rule.

- Restore `environment: socket-firewall` on python-sfw-smoke-enterprise and the
  core-tool-watch analyze job so SOCKET_SFW_API_TOKEN is scoped to those jobs.
  Header documents that the environment must have NO reviewers rule, with the
  gh api command to enforce it (reviewers: null).
- dependency-review-gate (Pattern 2 aggregator): now also needs
  docker-smoke-app-tests; fails on any failure/cancelled result (success and
  skipped pass) AND requires the trust-appropriate SFW edition to have
  succeeded when Python deps changed. Runs if: always() so the required context
  is always created -- no Pattern 1 bypass twin needed. Must land on main before
  being added to branch protection.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
…N report

Live CI exposed two things on the now-enabled Actions:
- socketdev/action firewall-enterprise HARD-ERRORS on an empty token (no
  silent fallback), so a trusted dep PR opened before the SOCKET_SFW_API_TOKEN
  secret exists fails and the required gate blocks merge. setup-sfw now resolves
  the effective mode and falls back to firewall-free when enterprise is
  requested without a token -- still a real supply-chain check, ships green
  today, auto-upgrades to enterprise the moment the secret is added. Token is
  read via env, never interpolated into the script.
- socketdev/action writes a structured report to $SFW_JSON_REPORT_PATH; both
  smoke jobs now capture it and upload it alongside the tee'd log.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia lelia temporarily deployed to socket-firewall June 26, 2026 20:58 — with GitHub Actions Inactive
@lelia lelia temporarily deployed to socket-firewall June 26, 2026 20:58 — with GitHub Actions Inactive
@lelia lelia temporarily deployed to socket-firewall June 26, 2026 21:06 — with GitHub Actions Inactive
@lelia lelia temporarily deployed to socket-firewall June 26, 2026 21:08 — with GitHub Actions Inactive
… scoring

OpenGrep ships as a GitHub-release binary that Socket has no data for under
its pkg:github coordinate, so the watcher reported 'no data' for it. OpenGrep
is a hard fork of Semgrep, so fall back to scoring the upstream Semgrep
lineage (pkg:pypi/semgrep) as a project-health proxy.

The proxy is report-only and never build-failing: it does not analyze
OpenGrep's own release artifacts, so a Semgrep alert must not block an
OpenGrep build. The pinned/latest verdicts show the proxy result labeled
'(via semgrep upstream proxy)' when the primary coordinate has no data, and
the JSON report records it under a separate 'proxy' key.

The npm 'opengrep' package is a single-version squat (not the official
distribution) and is deliberately not used as a coordinate.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia lelia temporarily deployed to socket-firewall June 26, 2026 21:54 — with GitHub Actions Inactive
@lelia lelia deployed to socket-firewall June 26, 2026 21:55 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file github-actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant