feat(ci): add supply chain security defences#2644
Conversation
Add three defensive layers against dependency supply chain attacks: - Dependabot cooldowns: 7-day default for version update PRs, with per-semver granularity (major: 14d, minor: 7d, patch: 3d). Security updates bypass automatically. - Bundler checksum verification: enable lockfile_checksums and add CHECKSUMS section to Gemfile.lock. Verifies downloaded gems match expected hashes on every install. - bundler-audit: add to Gemfile and run in CI. Checks against the ruby-advisory-db for known vulnerable gem versions. Also updates oauth2 (2.0.20 -> 2.0.22) to fix GHSA-pp92-crg2-gfv9, a high-severity bearer token leakage vulnerability flagged by the new bundler-audit check. Refs NextLink Labs article on dependency cooldowns (Apr 2026).
Detailed analysis: why these three defences, and what we evaluatedBackgroundThe Ruby gem ecosystem has the same supply chain attack surface as npm and PyPI: a single compromised maintainer account can push malicious code that reaches thousands of production applications before anyone notices. Recent incidents:
The common thread is time. Most malicious packages are detected and removed within hours or days. A deliberate delay — a cooldown — between publication and installation blocks the most dangerous window. What we evaluated1. Dependabot cooldowns (chosen — implemented)GitHub shipped this feature in early 2026. It delays the creation of automated version-update PRs until a gem has been published for a minimum number of days. Why we chose it:
Why it's not enough on its own:
2. Bundler checksum verification (chosen — implemented)Bundler 2.6+ introduced checksum verification. It calculates SHA-256 hashes for each gem and stores them in Why we chose it:
What it does NOT protect against:
What we also fixed: The new 3. bundler-audit (chosen — implemented)
Why we chose it:
Limitations:
What we evaluated and deferredgem.coop registry-level cooldowns (deferred)
Why we deferred it:
What we will do instead:
Sources:
What these defences do NOT protect against
We recommend pairing these defences with:
Summary
Together they cover the three most common attack vectors with minimal risk and no runtime impact. |
What
Adds three defensive layers against supply chain attacks targeting Ruby dependencies.
Changes
Dependabot cooldowns (
.github/dependabot.yml)Bundler checksum verification (
Gemfile.lock)CHECKSUMSsection with SHA-256 hashes for every gemoauth22.0.20 -> 2.0.22 (GHSA-pp92-crg2-gfv9)bundler-audit in CI (
Gemfile+.github/workflows/ruby.yml)security-auditjob runs on every push/PRoauth2vulnerability aboveWhy
Recent incidents (Axios, LiteLLM, March 2026) show that malicious packages are typically detected and removed within hours. A simple delay between publication and installation blocks the most dangerous window.
These three layers complement each other:
This is a low-risk, high-value change. No runtime code is affected. All three mechanisms are well-established patterns in the Ruby ecosystem.