Skip to content

Use osv-linter instead of check-jsonschema to validate advisories - #47

Merged
bn-d merged 1 commit into
ocaml:mainfrom
bn-d:osv-linter
Nov 3, 2026
Merged

bn-d merged 1 commit into
ocaml:mainfrom
bn-d:osv-linter

Conversation

@bn-d

@bn-d bn-d commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #15.

Replaces the check-jsonschema step in both validate-pull.yml and
generate-osv.yml with the OSV linter from ossf/osv-schema
(tools/osv-linter), installed via go install ...@latest.

The linter's SCH:001 check covers the existing JSON schema validation, and
it additionally catches issues the schema alone accepts, e.g.:

  • RNG:002 overlapping range events
  • REC:001 missing/empty affected
  • PKG:003 invalid purl

--collection offline is used since the linter has no opam registry
checker (PKG:001/PKG:002 are no-ops for opam), and this keeps the job free
of network lookups driven by record contents.

All 35 records currently on generated-osv pass the linter.

The OSV linter checks schema conformance (SCH:001) as well as additional
data quality rules such as overlapping range events, missing affected
data and invalid purls. Use the offline collection, as there is no opam
package registry checker.

Fixes ocaml#15
@bn-d

bn-d commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Will add opam registry checker to osv linter

@hannesm

hannesm commented Nov 3, 2026

Copy link
Copy Markdown
Member

looks fine to me, thanks!

@hannesm

hannesm commented Nov 3, 2026

Copy link
Copy Markdown
Member

Will add opam registry checker to osv linter

should this PR wait for that, or what is the concrete plan (enhancing osv linter? adding things here?)?

@bn-d

bn-d commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Will add opam registry checker to osv linter

should this PR wait for that, or what is the concrete plan (enhancing osv linter? adding things here?)?

I already have a PR for it, but might take a while to get merge. Will create a separate PR for it. We will also need to change some of the CVEs due to inaccurate version number, i.e. OCaml 4

@bn-d
bn-d merged commit a3af04b into ocaml:main Nov 3, 2026
1 check passed
@bn-d
bn-d deleted the osv-linter branch November 3, 2026 17:15
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.

Use the linter from osv (in addition to json schema)

2 participants