Skip to content

ci: fail on locked dependencies with security advisories - #87

Merged
darwin67 merged 2 commits into
mainfrom
ci/dependency-audit
Oct 12, 2026
Merged

darwin67 merged 2 commits into
mainfrom
ci/dependency-audit

Conversation

@darwin67

Copy link
Copy Markdown
Member

Every advisory fixed in #81–#84 was found by chance, in mix deps.get output that warns but never fails. This PR adds an audit workflow that fails CI instead.

Job Command Source
Hex advisories mix hex.audit Hex's advisory feed (EEF/GHSA), plus retired packages
RustSec advisories cargo audit (0.22.2) RustSec advisory database, for Cargo.lock
  • When it runs: on every pull request, on pushes to main, and daily at 06:17 UTC on main. A lock file can become vulnerable without any change here, so PR runs alone would miss new advisories.
  • Hex version: Hex 2.5 is the first release whose hex.audit checks security advisories, not just retirements. The job runs mix local.hex --force to get the latest.
  • Run time: cargo-audit takes about three minutes to build, so its binary is cached per version. deps is cached by mix.lock.
  • Acknowledging an advisory that doesn't affect Textbin: add it to hex: [ignore_advisories: [...]] in mix.exs or to .cargo/audit.toml, with a reason. The workflow header and AGENTS.md both say this.

Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_019fnjMN7WpEjQJD2zveakV6


Generated by Claude Code

Every advisory fixed in #81 to #84 was found by chance, in mix deps.get
output that warns but never fails. This workflow makes CI fail instead:

- `mix hex.audit` checks mix.lock against Hex's advisory feed (and
  retired packages). Hex 2.5 is the first release that checks
  advisories, so the job installs the latest Hex.
- `cargo audit` checks Cargo.lock against the RustSec database.
  cargo-audit takes about three minutes to build, so its binary is
  cached per version.

A lock file can become vulnerable without any change in this
repository, so the workflow also runs daily on main.

Against the lock files from before those fixes, hex.audit reports six
advisories in decimal 3.1.1 and mint 1.9.3, and cargo audit reports
RUSTSEC-2026-0285 in rustls 0.23.41. Both exit 1. On current main both
pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fnjMN7WpEjQJD2zveakV6
Contributors and agents should know that an advisory fails CI, that the
fix is an upgrade, and where an advisory that does not affect Textbin
can be acknowledged, with a reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fnjMN7WpEjQJD2zveakV6
@github-actions github-actions Bot added the ci label Oct 11, 2026
@darwin67
darwin67 marked this pull request as ready for review October 12, 2026 01:53
@darwin67
darwin67 merged commit a8a1988 into main Oct 12, 2026
19 checks passed
@darwin67
darwin67 deleted the ci/dependency-audit branch October 12, 2026 01:53
@chaba2-bot chaba2-bot Bot mentioned this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants