Repository navigation
feat(ci): audit every dependency tree for known vulnerabilities - #1593
Merged
Merged
Conversation
govulncheck over both Go modules, npm audit over every lockfile, pip-audit over the Python packages, cargo audit over the Rust client and osv-scanner over the Java client each fail their ecosystem's job in the pull-request workflow (both tiers, gated by Changed areas like the job), in the CircleCI jobs that gate develop, main and release tags, and nightly over develop. The tools are pinned and SHA-256 verified by scripts/download-sca-tools.sh; make audit runs all five. Dependabot opens weekly grouped updates against develop, and the release procedure requires a clean audit before the release branch and before the tag, with a CISA KEV check for findings that cannot be fixed. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…pins make audit-java now scans a CycloneDX SBOM of each Maven tree (client/java, editors/syson, editors/mdk) with osv-scanner, since osv-scanner's own pom resolver cannot follow reactor modules; the SysON and MDK jobs and the nightly audit run it, and Dependabot watches the two editor trees. make audit-python also audits docs-requirements.txt. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Every lockfile is clean at moderate once the vulnerable pins moved, so the stricter level costs nothing. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ly packaging changes The nightly publish job needs the audit job, so a night whose audit fails ships nothing. packaging/npm/ is a service path and packaging/pypi-pysysml/ turns the Python area on, so a pull request changing only one of those manifests still runs its audit. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # Makefile
Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # CONTRIBUTING.md
Merged
5 of 6 tasks
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.
What and why
Nothing in CI scanned dependencies, so
developcarried 12 reachable Go vulnerabilities, 4 npm advisories, 6 RustSec advisories and 11 OSV findings against the Java client, and v0.11.0 shipped them. This adds a failing dependency audit to every ecosystem's job, a weekly Dependabot schedule, and a pre-branch and pre-tag audit step to the release procedure. #1589 (merged) moved the vulnerable Go, npm and cargo pins; this PR only adds the gates.Makefilegainsvulncheck(govulncheckv1.9.0viago run, both Go modules, fails on reachable vulnerabilities),audit-npm(npm audit --omit=dev --audit-level=moderatein all sixpackage-lock.jsondirectories;NPM_LOCK_DIRS=narrows),audit-python(pip-audit --strictoverclient/python,client/jupyter-kernel,packaging/pypi-pysysml),audit-rust(cargo auditoverclient/rust/Cargo.lock),audit-java(a CycloneDX SBOM of each Maven tree —client/java,editors/syson,editors/mdk— scanned by osv-scanner, test scope excluded;JAVA_PROJECT_DIRS=narrows), andauditfor all five.audit-pythonalso auditsdocs-requirements.txt.scripts/download-sca-tools.shprovisions cargo-audit 0.22.2, osv-scanner 2.7.0 and pip-audit 2.10.1 underbuild/sca/, pinned and SHA-256 verified like the other downloads (Linux/macOS, x86_64/arm64).make vulncheckin Go static and integrity checks (runs in the quick tier too, so a draft shows it);make audit-npmin Node client tests (client/node), VS Code extension, JupyterLab extension, SysON plugin (its frontend) and the Go static job (packaging/npm/sysml-mcp,scripts/asciidoc, where Node is already set up for the npm runner);make audit-pythonin Python client tests;make audit-rustin Rust client tests;make audit-javain Java client tests (client/java), SysON plugin (editors/syson) and OpenSysML MDK for Cameo plugin (editors/mdk). Each step is gated by theChanged areasoutput its job already uses.go-static,python-test,rust-test,java-testandnode-test, which run ondevelop,mainand everyv*tag, so the release pipeline audits before it publishes (the editors are not released by it;syson-testandmdk-testaudit their trees ondevelop/main).node-testaudits all six lockfiles becauseeditors-node-testdoes not run on tags.auditjob innightly.ymlchecks outdevelopand runs the five audits unconditionally (each step runs even after an earlier failure), so an advisory published against an unchangeddevelopfails the next night's run, andpublishneeds it, so a night whose audit fails publishes no snapshot. It installs the Java client locally first, since the editors depend on it at the tree's version.cyclonedx-maven-plugin:2.9.1:makeAggregateBom, 4–15 s per tree with a warm cache) against OSV with no credential, so Java is audited in the Java, SysON and MDK jobs and nightly, not nightly only. The SBOM rather than osv-scanner's ownpom.xmlresolver because the latter cannot follow reactor modules (editors/mdk/plugin→opensysml-mdk-openapi-stubs: "not found", exit 127 even with no finding) and scans every manifest under a directory, dev dependencies included.moderate: with fix(deps): remove every known-vulnerable dependency (Go 1.27.3, x/net, x/text, grpc, npm, cargo) #1589 merged every lockfile is clean atmoderate, with and without development dependencies (editors/jupyterlab's 9 moderate findings on develop are gone), so the stricter level costs nothing.lowis not used because npm reports it for advisories without a fix..github/dependabot.yml:gomod(/,/tools),npm(the six lockfile directories),pip(the three packages),cargo,maven(client/java,editors/syson,editors/mdk),github-actions; weekly on Monday, targetdevelop, one group per ecosystem for minor+patch,chore(deps): …titles. Labels are Dependabot's defaults (dependenciesplus the ecosystem), which it creates itself. Its PRs open ready for review, so the full tier runs withChanged areasscoping it to the lockfile touched; Inscripts/ci-changed-areas.sh,.github/dependabot.ymlandpackaging/npm/are now service paths (the npm runner's lockfile is audited in the Go static job) andpackaging/pypi-pysysml/turns the Python area on, so a pull request touching only one of those manifests still runs its audit; cases added toscripts/ci-changed-areas-test.sh.docs/project/releasing.mdrequiresmake sca-tools auditclean before cuttingrelease/x.y.zand again before the tag, with every unfixable finding checked against the CISA Known Exploited Vulnerabilities catalogue and the decision recorded in the release PR;docs/project/nightly.mddocuments the nightly job. Changelog fragmentchanges/unreleased/dependency-audits.added.md.How it was verified
Each gate fails on a vulnerable tree (develop
82cd1c2in a scratch worktree, or a pin injected into it):On this branch (develop with #1589 and #1587 merged in, plus this change):
Config and tree gates:
circleci config validate .circleci/config.ymlvalid;actionlintonpr.ymlandnightly.yml(the two pre-existing shellcheck notes only);.github/dependabot.ymlvalid against schemastore'sdependabot-2.0.json(jsonschema);bash scripts/ci-changed-areas-test.shall cases pass;go test ./tests/hygieneok (nightly, node-install, release-config suites parse the changed configs);go build ./...,go vet ./...,gofmt -l .empty;python3 scripts/changelog.py check;python3 scripts/check-doc-links.py0 broken.scripts/download-sca-tools.shprovisions all three tools in 8 s and is idempotent.Maintainer follow-ups
client/java:io.grpc:grpc-netty-shaded1.70.0 → ≥1.75.0,org.bouncycastle:bcprov-jdk18on1.80.2 → ≥1.85 andbcpkix-jdk18on1.80 → ≥1.84 (transitive via sigstore-java),com.google.guava:guava33.3.1-android → ≥33.7.2.editors/sysonaddstools.jackson.core:jackson-core/jackson-databind3.1.4 → ≥3.1.7 and guava 33.5.0-android.editors/mdkadds guava 32.0.1-jre. The Java, SysON and MDK jobs on this PR fail on them by design.client/julia/OpenSysML/Project.tomlhas no audit tool or Dependabot ecosystem; it is the one manifest left unscanned.Checklist
make testandmake lintpass locally (no Go code changed:go build,go vet,gofmt -l, the hygiene suite and the changed-areas tests run; the full suite runs before un-drafting)scripts/ci-changed-areas-test.shcase)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (none moved)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/8f1dd5882ec9462c9f3e7e7ab5183df3
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/8f1dd5882ec9462c9f3e7e7ab5183df3?variant=devin
Requested by: @HuiJun