ci(security): commit Cargo.lock and add the osv-scanner job - #126
Merged
Conversation
logismos reported cargo audit and cargo deny but no OSV scan, so it saw RustSec advisories and not the broader OSV database. Adding the fleet's osv-scanner job needs a lockfile: its scan-args name Cargo.lock, and the scanner does not generate one -- pointed at a tree without it, the job fails on every run rather than reporting anything. So the lockfile is the actual fix, and it should have been committed anyway. The ignore was inherited rather than decided: a bare `Cargo.lock` line under a `# Cargo` heading with no stated reason, arriving in 616e646 "chore(repo): public snapshot". Every other Rust workspace in the fleet -- sphragis, koinon, epitelesis -- commits its lockfile, and current Cargo guidance recommends it for libraries too. The .gitignore now says why it is committed, so the next reader does not have to reconstruct this. Consequences worth knowing: `--locked` builds become reproducible and meaningful here, and the four dependabot PRs already open against this repo will regenerate the lockfile as part of their own diffs. The generated lockfile resolves 146 packages and pins the versions currently in use -- rand 0.8.7, safetensors 0.7.0, snafu 0.8.9, tokenizers 0.22.2 -- each of which has a newer release that dependabot has already opened a PR for. This commit changes no dependency version.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
…hey are The osv-scanner job added in the preceding commit reported two HIGH findings on its first run -- RUSTSEC-2020-0128 (8.1) and RUSTSEC-2021-0006 (7.5) -- both against `cache 1.0.9`, and both false. Those advisories concern an abandoned crates.io crate named `cache`. The `cache 1.0.9` in this lockfile is this workspace's own crate at crates/cache. The lockfile settles it: that entry carries no `source` and no `checksum`, which is what a path dependency looks like and what a registry crate never looks like. A scanner matching on name alone cannot tell the two apart. Not a new judgement -- aletheia's .cargo/audit.toml already carries this exact pair with the same reasoning, so this is a known class arriving in a second repo. Recorded in deny.toml, which is the single source; .cargo/audit.toml and osv-scanner.toml are regenerated from it with `kanon audit derive-ignores --apply` rather than edited, as their own headers instruct. The reason strings say WHY rather than "false positive", because the next reader needs to be able to check the claim rather than take it. The check is one command: look for `source` on the lockfile entry.
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.
logismos reported
cargo auditandcargo denybut no OSV scan — it saw RustSec advisories and not the broader OSV database. It is the third of three repos closing that gap today (koinon#51, epitelesis#32).Why this PR is bigger than the other two
Adding the fleet's
osv-scannerjob needs a lockfile. Itsscan-argsnameCargo.lock, and the scanner does not generate one — pointed at a tree without it, the job fails on every run, on every PR and on the daily schedule. Not intermittently. Always.So the lockfile is the actual fix, and the honest question is whether it should have been committed anyway.
The ignore was inherited, not decided
A bare line under a bare heading, with no stated reason, arriving in
616e646 chore(repo): public snapshot— i.e. it came in with the initial import rather than from a decision about this repo.Against that:
members = ["crates/*"]), and every other Rust workspace in the fleet — sphragis, koinon, epitelesis — commits its lockfile.--lockedbuilds are not reproducible without it.The
.gitignorenow records why it is committed, so the next reader does not have to reconstruct this reasoning from a commit message.Approach: the reusable workflow, not the scanner action
I checked the alternative first.
google/osv-scanner-action's own action description says:Using the action directly would have let me inject a
cargo generate-lockfilestep and avoid committing anything — but it means adopting a surface the maintainers explicitly warn is unstable, and inventing a bespoke job shape for one repo. Committing the lockfile lets logismos use the same job every other repo uses, pinned at the same SHA.What this does not change
No dependency version moves here. The generated lockfile resolves 146 packages and pins what is already in use:
Each already has a dependabot PR open against this repo. Those will regenerate the lockfile as part of their own diffs, which is the intended interaction rather than a conflict.
What I could not verify
The workflow has not run. Whether
cargo deny,cargo auditand the OSV scan pass against this newly-committed lockfile will be visible on this PR's own checks — and if OSV surfaces an advisory, that is the job working, not the PR failing.