Skip to content

ci(security): commit Cargo.lock and add the osv-scanner job - #126

Merged
forkwright merged 2 commits into
mainfrom
ci/security-osv
Aug 24, 2026
Merged

ci(security): commit Cargo.lock and add the osv-scanner job#126
forkwright merged 2 commits into
mainfrom
ci/security-osv

Conversation

@forkwright

Copy link
Copy Markdown
Owner

logismos reported cargo audit and cargo deny but 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-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, 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

# Cargo
Cargo.lock

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:

  • logismos is a workspace (members = ["crates/*"]), and every other Rust workspace in the fleet — sphragis, koinon, epitelesis — commits its lockfile.
  • Current Cargo guidance recommends committing lockfiles for libraries too; the older "libraries don't" advice was reversed upstream.
  • --locked builds are not reproducible without it.

The .gitignore now 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:

We recommend using the reusable workflows instead of directly using the scanner action as the scanner action behavior might change in a minor patch update.

Using the action directly would have let me inject a cargo generate-lockfile step 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:

rand 0.8.7        (0.10.2 available)
safetensors 0.7.0 (0.8.0 available)
snafu 0.8.9       (0.9.2 available)
tokenizers 0.22.2 (0.23.1 available)

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 audit and 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.

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.
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

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.
@forkwright
forkwright merged commit 3bb3053 into main Aug 24, 2026
9 checks passed
@forkwright
forkwright deleted the ci/security-osv branch August 24, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants