Skip to content

ci(#731): pin the third-party action and activate wrapper checksum verification - #736

Merged
jbonofre merged 1 commit into
apache:mainfrom
oscerd:fix/731-build-supply-chain
Aug 25, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
oscerd:fix/731-build-supply-chain

Conversation

@oscerd

@oscerd oscerd commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Addresses two of the three items in #731.

1. Pin the third-party action

EnricoMi/publish-unit-test-result-action@v2 -> @d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0

v2 is a mutable tag on a non-GitHub-authored action. It runs with
if: always() on push and pull_request under checks: write, after the
shared Maven cache is restored and before its post-step saves it. A force-moved
tag changes what executes with no change landing in this repository, and
Dependabot cannot detect a tag that moves under it. Dependabot can still bump
the pinned SHA, which is the usual Apache infra arrangement.

The SHA is the commit v2 currently resolves to, which is the v2.24.0
release.

2. Activate the checksum verification that already exists

mvnw:254-281 and the wrapper jar both implement SHA-256 verification, but
the code was dormant because neither wrapperSha256Sum nor
distributionSha256Sum was set. Setting them turns the project's own existing
mechanism on.

wrapperSha256Sum is worth having even though the jar is committed: mvnw
validates it against the local maven-wrapper.jar, so it covers tampering
with the 62 KB of opaque bytes in the repository, which no diff can show.

Values were verified before pinning, not just computed:

  • the committed .mvn/wrapper/maven-wrapper.jar is byte-identical to
    maven-wrapper-3.2.0.jar on Maven Central
    (e63a53cf…f52f066a) -- so this pins a known-good jar, not whatever happened
    to be in the tree
  • apache-maven-3.9.6-bin.zip fetched from Central has SHA-512 matching the
    value published at downloads.apache.org/maven/maven-3/3.9.6/binaries/
    exactly, so the SHA-256 recorded here (83aaf914…c031625f) is the ASF
    artifact

Both were then confirmed to actually enforce, by corrupting each sum in turn:

# corrupted wrapperSha256Sum
Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.

# corrupted distributionSha256Sum, with a clean MAVEN_USER_HOME to force re-download
Exception in thread "main" java.lang.RuntimeException: Failed to validate Maven
distribution SHA-256, your Maven distribution might be compromised.

and ./mvnw -v runs normally with the committed values, both from cache and
from a fresh download.

3. Not done: removing the root <repositories> block

#731 also proposed dropping the Atlassian repository from the root POM on the
grounds that components/camel-jira/pom.xml already declares it for the only
artifacts that need it. That is not correct and would break the build, so it
is left out of this PR:

  • features/src/main/feature/camel-features.xml:1996-2002 references
    com.atlassian.jira:jira-rest-java-client-{core,api},
    com.atlassian.sal:sal-api, com.atlassian.event:atlassian-event and
    com.atlassian.httpclient:* as feature bundles, and the features module
    runs karaf-maven-plugin:verify, so it has to resolve them.
  • features/pom.xml does not declare the Atlassian repository -- it
    inherits it from the root.
  • None of those artifacts are on Maven Central (all 404), so there is no
    fallback.

The narrower change that would achieve the original intent is to move the
declaration down to the two modules that actually need it (components/camel-jira,
which already has it, plus features) rather than delete it. I have not done
that here because it wants a full reactor build to confirm nothing else in the
tree resolves an Atlassian coordinate, and that is a separate change from the
two above. Details are in #731.

Notes

No functional change to the build; CI on this PR exercises the pinned action.


Claude Code on behalf of Andrea Cosentino

…sum verification

Two build-integrity gaps from apache#731. The third item in that issue, removing
the root <repositories> block, is deliberately not done here: see the
issue for why it would break the build.

Pin EnricoMi/publish-unit-test-result-action to the commit SHA that v2
currently resolves to (v2.24.0). It is a non-GitHub-authored action running
with checks:write, on push and pull_request, around the shared Maven cache.
A mutable tag can be force-moved without any change landing here, and
Dependabot cannot see that happen. Dependabot can still bump the pinned SHA.

Set distributionSha256Sum and wrapperSha256Sum. Both mvnw and the wrapper
jar already implement SHA-256 verification, but the code was dormant because
neither property was set. Note wrapperSha256Sum also covers the
maven-wrapper.jar committed to the repository, whose bytes cannot be
reviewed in a diff.

Values verified before pinning:
- the committed maven-wrapper.jar is byte identical to
  maven-wrapper-3.2.0.jar on Maven Central
- apache-maven-3.9.6-bin.zip on Central matches the SHA-512 published at
  downloads.apache.org

Both checks confirmed live by corrupting each sum in turn: the wrapper
refuses with "Failed to validate Maven wrapper SHA-256", and a forced
re-download refuses with "Failed to validate Maven distribution SHA-256".
@jbonofre
jbonofre merged commit 683e5f7 into apache:main Aug 25, 2026
3 checks passed
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.

2 participants