↓ Skip to main content
Security

Learning OSV, part 4: where it fits, and my recommendation

·4 mins
Learning OSV - This article is part of a series.
Part 4: This Article
Three parts of trying things. This one is the verdict: what I would actually switch on, in what order, and what I would still look elsewhere for.
Diagram: a loop of pull request scan, scheduled rescan, in-place fix as a bot pull request, and human review, fed by OSV.dev in the centre; beside it a five-point recommendation checklist
The loop I would run, and the verdict as a checklist.

Quick recap of the proof of concept: part 1 read the database, part 2 scanned a project (5 dependencies, 68 packages, 49 vulnerabilities), and part 3 fixed it (7 of 50 safely, 50 of 50 with a major upgrade).

Where each piece fits
#

flowchart LR
  PR["Pull request
scan the diff"] --> M["Merge to main
full scan + SARIF"] M --> N["Weekly / nightly
rescan main"] N --> F["Findings
osv-scanner fix
in-place → bot PR"] F --> R["Human review
tests + merge"] R --> PR DB[("OSV.dev
updated continuously")] -.-> PR DB -.-> N
StageOSV pieceWhy
Pull requestScanner, PR modeShows only what this change adds, while the author still has context
Main branch, on a scheduleScanner, full modeNew advisories arrive for code nobody touched
Remediationfix --strategy=in-placeSafe, lockfile-only changes a bot can propose
Bigger upgradesfix --strategy=relaxRun by a person, with the test suite
Investigationosv.dev and its APIAliases, ranges and fixed versions for one finding

Start with two workflows
#

The OSV-Scanner GitHub Action provides two reusable workflows. The PR workflow reports only vulnerabilities the pull request introduces; the scheduled one reports everything and uploads SARIF to the Security tab.

# .github/workflows/osv-scanner-pr.yml
name: OSV-Scanner PR Scan
on:
  pull_request:
    branches: [main]
permissions:
  actions: read
  security-events: write
  contents: read
jobs:
  scan-pr:
    uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@v2.7.0"
# .github/workflows/osv-scanner-scheduled.yml
name: OSV-Scanner Scheduled Scan
on:
  schedule:
    - cron: "30 12 * * 1"
  push:
    branches: [main]
permissions:
  actions: read
  security-events: write
  contents: read
jobs:
  scan-scheduled:
    uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.7.0"

By default the PR workflow only warns. I would keep it that way for a few weeks, fix the backlog, then make it blocking.

What it does well
#

  • Precise matching. Ecosystem-native version ranges mean few “maybe affected” findings.
  • Breadth. Language packages, OS packages, GitHub Actions, and MAL- records for known malware.
  • Free and open. Open-source code, a public database, an API, and a downloadable dataset for offline use (offline mode).
  • Built for pipelines. Clear exit codes, JSON and SARIF, and an ignore file with reasons and expiry dates.
  • A fix proposal, not just a list. Even the small in-place win is work a person no longer has to do.

What it does not do (yet)
#

  • It does not prioritise by risk. CVSS is there; whether a CVE is being exploited (CISA KEV) or likely to be (EPSS) is not. Join those yourself.
  • Remediation is narrow and experimental. npm and Maven only; no Python, Go or containers in fix today.
  • It finds known issues in dependencies. Not your own code (that is SAST), not secrets, not misconfiguration.
  • Reachability is partial. Call analysis exists, on by default for Go only; for the rest, “affected” means “present”, not “exploitable”.

My recommendation
#

  1. Adopt the scanner now. Add the two workflows; it costs nothing and the signal is precise.
  2. Make the scheduled scan the priority, not the PR scan. New advisories land on old code; that is where the surprises are.
  3. Automate only in-place fixes as bot pull requests, with tests required and a human approving the merge.
  4. Treat relax as a planned upgrade, run by a developer, never by a bot.
  5. Keep accepted risks in osv-scanner.toml, each with a reason and an ignoreUntil date, reviewed like code.
  6. Add a risk layer on top (exploitation and exposure) before you let findings set deadlines.

Conclusion
#

OSV is the most precise free answer I have found to “which of my dependencies are vulnerable, and to what version do I move?”. The database is the real asset; the scanner makes it usable in a pipeline; the fix command is a promising, honest helper that shows its trade-offs instead of hiding them. It does not replace judgement about what matters first, and it does not cover your own code. As one layer of a secure development life cycle, it earns its place on day one.

References
#

Previous: part 3. Start: part 1.

Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.
Learning OSV - This article is part of a series.
Part 4: This Article

Related

Learning OSV, part 3: guided remediation with osv-scanner fix

·3 mins
Finding 49 vulnerabilities is easy. Deciding which three lines to change so that most of them go away is the hard part. That is what osv-scanner fix tries to do. in-place is the safe small win; relax fixes everything but chose a major upgrade. In part 2 the scanner found 49 known vulnerabilities in a small Node project. This part tries the guided remediation command on it.

Learning OSV, part 2: scanning a project with OSV-Scanner

·4 mins
I picked four dependencies. The scanner found problems in eleven packages. That gap is the whole reason to scan lockfiles and not just package.json. Five dependencies I chose became 68 packages; 11 are affected, six of them only because Express pins them. Part 1 was about the OSV database. This part runs the scanner against a small project and reads the result.

Learning OSV, part 1: what osv.dev is and how to read a record

·4 mins
A CVE tells you that something is broken. It rarely tells you, in a way a machine can use, which package and which versions. OSV exists to answer exactly that. One record, read as data: the affected range runs from introduced 1.0.0 to fixed 1.2.6, so 1.2.5 is vulnerable and the upgrade target is 1.2.6. I am learning which free tools can carry real weight in a secure development life cycle. This short series is my proof of concept with OSV: the database, the scanner and its fix command. I run everything for real and keep the output. This part is about the concept and the website.