Add bundler-audit to the local gate and CI (herb-embedded-fa6) - #53
Merged
Conversation
guides.rubygems.org/security recommends running bundler-audit against ruby-advisory-db in CI: it catches "the exact versions currently pinned in Gemfile.lock have a known CVE" the moment they land, a different signal from Dependabot's weekly "a newer version exists" check. Wires Bundler::Audit::Task (the gem's own Rake::TaskLib, matching how RSpec::Core::RakeTask/RuboCop::RakeTask are already used) into the default rake task. Local runs use bundle:audit (check only, auto-clones the advisory db if missing but doesn't force-refresh an existing clone, to avoid requiring network access on every bundle exec rake). CI explicitly runs bundle:audit:update before bundle:audit:check, so it never checks against a stale snapshot regardless of what a prior run left behind. Verified against the current Gemfile.lock: no vulnerabilities found, both via a fresh database pull (1233 advisories) and the cached local check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bundler-auditagainstruby-advisory-dbin CI: it catches "the exact versions currently pinned inGemfile.lockhave a known CVE" immediately, a different signal from Dependabot's weekly "a newer version exists" check.Bundler::Audit::Task(the gem's ownRake::TaskLib, matching howRSpec::Core::RakeTask/RuboCop::RakeTaskare already used in this Rakefile) into the defaultraketask.bundle:audit(check-only — auto-clones the advisory db if missing, but doesn't force-refresh an existing clone, to avoid requiring network access on everybundle exec rake).bundle:audit:updatebeforebundle:audit:check, so it never checks against a stale snapshot regardless of what a prior run left behind.Note: CI doesn't currently invoke the full
rakedefault task (it callsbundle:buildandrspecas separate explicit steps, meaning rubocop has never run in CI either) — this PR deliberately doesn't change that, adding bundler-audit as its own explicit step instead. Flagging the pre-existing "CI never runs rubocop" gap for awareness; it's out of this bead's scope.Acceptance criteria
bundler-auditruns as part ofbundle exec rakeand as part of CI.Gemfile.lockpasses cleanly — verified locally: "No vulnerabilities found", both via a fresh database pull (1233 advisories) and the cached check.bundle:audit:updateruns beforebundle:audit:checkin the CI step; the Rakefile comments explain the local/CI asymmetry.bundle exec rakepasses locally: 206 examples, 0 failures, 0 RuboCop offenses, no vulnerabilities found.Test plan
bundle exec rake bundle:audit:checkstandalone: clean.bundle exec rake bundle:audit:update bundle:audit:check(matching the exact CI invocation): database refreshed, then clean.bundle exec rake: all green.🤖 Generated with Claude Code