Repository navigation
chore(ci): submit the full Maven dependency tree to the dependency graph - #427
Draft
dmihalcik-virtru wants to merge 1 commit into
Draft
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
GitHub builds the Maven dependency graph by reading the pom.xml files statically, so Dependabot alerts don't cover transitive dependencies. Run advanced-security/maven-dependency-submission-action on pom changes to main to submit the resolved tree, transitive dependencies included. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Contributor
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.



Summary
Adds a workflow that runs advanced-security/maven-dependency-submission-action (v6.0.1, pinned by SHA) to submit the resolved Maven dependency tree to the GitHub dependency graph.
Rationale
GitHub builds the Maven dependency graph by reading the
pom.xmlfiles statically. It sees declared dependencies only, so Dependabot never alerts on vulnerable transitive dependencies, such as anything pulled in by grpc, okhttp, or connect-kotlin. This repo has no dependency-submission workflow today, so that part of the tree isn't covered.How it works
mainthat change apom.xmlor this workflow, and onworkflow_dispatch. It also runs on PRs that edit the workflow file, so this PR tests itself; it is skipped for fork PRs, whose token is read-only.depgraph-maven-plugin:graphover the reactor. That only resolves dependencies, so the job needs neitherbufnor generated sources, and needs no repository secrets.developprofile builds every module, so one snapshot coverssdk-fips-bc(bc-fips) as well assdk-pqc-bcandcmdline(bcprov). Thefipsprofile only changes which of those two modulescmdlineuses at runtime, so it needs no second snapshot.contents: read; the job raises this tocontents: write, which the dependency submission API requires.Test plan
actionlintpasses on the new workflow.mvn -B com.github.ferstl:depgraph-maven-plugin:4.0.3:graph -DgraphFormat=json) against an empty local repository and with nosettings.xml. Every module succeeded without codegen ormvn install. The graphs contain transitive artifacts (97 forsdk;cmdlineincludessdk's grpc/okhttp/protobuf tree), andsdk-fips-bc's graph includesbc-fips.Submit Maven dependency snapshotjob on this PR succeeds and submits a snapshot (run: all six modules resolved, "Snapshot successfully created").After merge: new alerts need manual fixes
The first snapshot on
mainwill likely raise new Dependabot alerts for transitive packages GitHub couldn't see before, such asjson-smart2.5.0 andnimbus-jose-jwt9.37.3 (viaoauth2-oidc-sdk).Dependabot will not open PRs for most of these. Dependabot fixes Maven alerts by editing version strings in
pom.xml; it doesn't run Maven. For a dependency that is only in the submitted graph, GitHub's docs say "Dependabot isn't able to find the vulnerable dependency in the repository, and therefore won't create a security update for that alert" (supported ecosystems, troubleshooting). Transitive security updates are npm-only (about security updates).<dependencyManagement>: guava, protobuf-java, error_prone_annotations, commons-codec, gson, byte-buddy, slf4j-api, kotlin-stdlib, grpc-netty-shaded, jspecify, and the Bouncy Castle artifacts.json-smartandnimbus-jose-jwt.grpc-coreto agrpc-bombump..github/dependabot.ymlsetsopen-pull-requests-limit: 0, which disables them.To fix such an alert, bump the direct dependency that pulls it in (e.g.
oauth2-oidc-sdk), or pin the patched version in the root<dependencyManagement>. Once pinned, Dependabot keeps that pin current for future alerts. Dependabot's Maven transitive-update mode is still experimental (dependabot-core#13012).Public API
None. CI only.