Files
877f9ced23 ci(security): run cargo audit on every PR, re-enable PyPI attestations (#3858)
## Why

- **`cargo audit` did not run for three weeks.** The job lived in
`rust.yml` behind the `rust-changes` path filter, so pushes that touched
no Rust path reported it as skipped. `rust.yml`'s own weekday schedule
stopped firing after 2026-09-08. From then until 2026-09-29 no Rust
advisory scan ran.
- **PyPI attestations are off.** `release.yml` had `attestations:
false`, so nothing on PyPI carries PEP 740 provenance.

## What changes

- `security.yml` gets a `cargo-audit` job ("Rust advisories (cargo
audit)"). It runs on every PR, every push to `main`, the existing weekly
schedule and on demand, whatever paths changed.
- It is blocking. Accepted advisories stay in `.cargo/audit.toml` with a
written reason; the existing exception is kept.
- `cargo deny check licenses` moves with it and stays
`continue-on-error`.
  - No toolchain build: `cargo audit` reads only `Cargo.lock`.
- `rust.yml` drops its `audit` job and leaves a pointer comment. Nothing
`needs:` that job and it is not a required check.
- `.cargo/audit.toml`: the header comment points at the new job.
- `release.yml`: `attestations: true`. The publish job already uses
trusted publishing with `id-token: write`, which is all attestations
need. They were turned off in #2405 with no recorded root cause. If a
release fails on them, revert this one line.

## Behaviour change

- CI: the Rust advisory scan now gates every PR, including PRs that
touch no Rust. A newly disclosed advisory in a Rust dependency turns
unrelated PRs red until it is fixed or accepted in `.cargo/audit.toml`.
That is intended.
- Releases: wheels and sdists on PyPI carry PEP 740 attestations again.

## Tests

- `actionlint` passes on the three edited workflows.
- The new job runs on this PR and passes on the current `Cargo.lock`.
- Not tested: a real PyPI publish with attestations on. That only
happens on a release from `main`, so watch the first release after
merge.

## Not in this PR

- `SECURITY.md` changes are in #3727.
- Pinning every action to a digest is a separate, larger change.
- `security.yml` itself has not run on `main` since 2026-09-07, the same
"scheduled or push workflow not firing" pattern as `rust.yml`. That
needs a separate look; this PR makes the scan run on every PR
regardless.

Revised 2026-10-01 after self-review: attestations are now a plain
`attestations: true` instead of a repository-variable switch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/headroomlabs-ai/headroom/pull/3858"
target="_blank"><picture><source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img
src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4"
alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: JerrettDavis <mxjerrett@gmail.com>
2026-10-07 21:00:11 -05:00
..