Skip to content

[Security] Maven Repositories: Add Trusted Checksum Verification#7269

Open
chrisrueger wants to merge 1 commit into
bndtools:masterfrom
chrisrueger:7236-trusted-checksum-verification
Open

[Security] Maven Repositories: Add Trusted Checksum Verification#7269
chrisrueger wants to merge 1 commit into
bndtools:masterfrom
chrisrueger:7236-trusted-checksum-verification

Conversation

@chrisrueger

@chrisrueger chrisrueger commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Closes #7236

This pull request introduces optional support for trusted checksum verification in the Maven repository providers (MavenBndRepository and BndPomRepository). The main goal is to ensure that downloaded artifacts can validated against a trusted checksum file, improving the integrity and security of repository operations. The changes include new configuration options, core logic for managing and verifying trusted checksums, and integration into repository workflows and UI actions.

Trusted Checksum Support and Verification:

  • Added a new TrustedChecksums class to manage trusted checksum files, load and cache checksums, verify artifact integrity, and generate trusted checksum files. This includes logic for reading, writing, and validating checksums for Maven artifacts.
  • Implemented a DigestValidator helper class to centralize digest comparison logic, replacing duplicate code and improving maintainability.
  • Integrated trusted checksum verification into MavenRepository and MavenBackingRepository, so that artifact retrieval and local file access now check against trusted checksums when available. [1] [2] [3] [4] [5] [6]

Configuration and Initialization:

  • Extended the Configuration interface to allow specifying a trusted checksum file path, and updated repository initialization to load and use the trusted checksum file. [1] [2] [3] [4]
  • Added logic to generate a trusted checksum file from the current repository state, and exposed this as a repository action in the UI. [1] [2] [3] [4]

Reporting and Versioning:

  • Enhanced repository tooltips and reporting to display the status and location of the trusted checksums file when present.
  • Updated package versioning to reflect the new feature. [1] [2]

Screenshots

image image image

When a Checksum does not match it looks like this:

image

The file basically does not exist anymore (the failing check deletes it), so the jar cannot be used / resolved etc.

@chrisrueger chrisrueger force-pushed the 7236-trusted-checksum-verification branch from a7d9341 to d434f24 Compare June 9, 2026 21:28
@chrisrueger chrisrueger changed the title Add Trusted Checksum Verification [Security] MavenBndRepository: Add Trusted Checksum Verification Jun 14, 2026
@chrisrueger chrisrueger force-pushed the 7236-trusted-checksum-verification branch 3 times, most recently from 370a206 to 5e48f7f Compare June 24, 2026 12:32
@chrisrueger chrisrueger marked this pull request as ready for review June 24, 2026 14:13
@chrisrueger chrisrueger marked this pull request as draft June 25, 2026 05:11
@chrisrueger

chrisrueger commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

TODOS:

  • add configuration to bndtools UI (_plugins.xml <plugin class="aQute.bnd.repository.maven.provider.MavenBndRepository")
  • add same support for BndPomRepository

@chrisrueger chrisrueger force-pushed the 7236-trusted-checksum-verification branch from 55abfcc to 3198339 Compare June 25, 2026 08:02
@chrisrueger chrisrueger marked this pull request as ready for review June 25, 2026 08:58
@chrisrueger chrisrueger requested a review from Copilot June 25, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “trusted checksum” verification for Maven-backed repositories in bnd/bndtools, allowing locally-defined expected digests (via a .checksums sidecar file) to be enforced when artifacts are used. It integrates checksum enforcement into repository workflows, adds UI actions to generate checksum files, updates docs/configuration, and bumps package versions to reflect the new API surface.

Changes:

  • Introduces TrustedChecksums + DigestValidator and wires trusted checksum enforcement into MavenRepository access paths.
  • Adds checksumFile configuration to Maven index and POM repository providers and surfaces the feature via UI actions/tooltips.
  • Adds documentation plus test resources/tests for checksum parsing and pass/fail scenarios.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
docs/_plugins/maven.md Documents checksumFile and trusted checksum verification behavior.
bndtools.core/_plugin.xml Adds checksumFile properties to the Eclipse plugin configuration metadata.
biz.aQute.repository/testresources/mavenrepo/index.maven.failing.checksums Adds failing checksum inputs for tests.
biz.aQute.repository/testresources/mavenrepo/index.maven.checksums Adds passing checksum inputs for tests.
biz.aQute.repository/test/aQute/maven/provider/TrustedChecksumsTest.java Adds unit tests for checksum line parsing.
biz.aQute.repository/test/aQute/bnd/repository/maven/provider/MavenBndRepoTest.java Adds integration tests for trusted checksum pass/fail behavior.
biz.aQute.repository/src/aQute/maven/provider/TrustedChecksums.java Implements trusted checksum file parsing, caching, validation, and generation.
biz.aQute.repository/src/aQute/maven/provider/packageinfo Bumps package version for the Maven provider package.
biz.aQute.repository/src/aQute/maven/provider/MavenRepository.java Enforces trusted checksum checks when returning/using local files and after fetch.
biz.aQute.repository/src/aQute/maven/provider/MavenBackingRepository.java Refactors digest validation to the shared helper.
biz.aQute.repository/src/aQute/maven/provider/DigestValidator.java New shared digest-comparison helper for checksum validation.
biz.aQute.repository/src/aQute/bnd/repository/maven/provider/RepoActions.java Adds a UI action to create trusted checksums files.
biz.aQute.repository/src/aQute/bnd/repository/maven/provider/package-info.java Bumps package version for MavenBndRepository provider package.
biz.aQute.repository/src/aQute/bnd/repository/maven/provider/MbrUpdater.java Exposes “create trusted checksums file” through updater API.
biz.aQute.repository/src/aQute/bnd/repository/maven/provider/MavenBndRepository.java Loads trusted checksum sidecar, wires it into storage, tooltip reporting, and adds generation hook.
biz.aQute.repository/src/aQute/bnd/repository/maven/provider/Configuration.java Adds checksumFile() configuration property.
biz.aQute.repository/src/aQute/bnd/repository/maven/pom/provider/PomConfiguration.java Adds checksumFile() configuration property for POM repositories.
biz.aQute.repository/src/aQute/bnd/repository/maven/pom/provider/package-info.java Bumps package version for POM repository provider package.
biz.aQute.repository/src/aQute/bnd/repository/maven/pom/provider/BndPomRepository.java Loads trusted checksums, wires into storage, tooltip, and adds “generate” action.

Comment thread biz.aQute.repository/src/aQute/maven/provider/DigestValidator.java
Comment thread biz.aQute.repository/src/aQute/maven/provider/TrustedChecksums.java
Comment thread biz.aQute.repository/src/aQute/maven/provider/TrustedChecksums.java
Comment thread bndtools.core/_plugin.xml Outdated
Comment thread bndtools.core/_plugin.xml Outdated
Comment thread docs/_plugins/maven.md Outdated
Comment thread docs/_plugins/maven.md Outdated
Comment thread docs/_plugins/maven.md
@chrisrueger chrisrueger force-pushed the 7236-trusted-checksum-verification branch 2 times, most recently from 1d26c0b to 463602d Compare June 25, 2026 10:44
Introduce trusted checksum support for Maven-backed repositories.

- Add TrustedChecksums to read a sidecar .checksums file and map Archive -> checksum entries.
- Add Configuration.checksumFile(...) to locate the checksum sidecar next to an index.
- MavenBndRepository and BndPomRepository load and open the trusted checksum file
- MavenRepository gains a trustedChecksums field, setTrustedChecksums(...), and checkTrustedChecksum(...) which computes MD5/SHA-1/SHA-256/SHA-512, deletes mismatched downloads and throws on mismatch (returns false if no trusted checksum applies).

This change ensures downloaded artifacts can be validated against operator-provided checksums to protect against tampered or corrupted artifacts.

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
@chrisrueger chrisrueger force-pushed the 7236-trusted-checksum-verification branch from 463602d to 1a688f1 Compare June 25, 2026 12:52
@chrisrueger chrisrueger changed the title [Security] MavenBndRepository: Add Trusted Checksum Verification [Security] Maven Repositories: Add Trusted Checksum Verification Jun 25, 2026
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.

[security] Support trusted checksum verification for Maven repositories/index

2 participants