[backport camel-spring-boot-4.18.x] CAMEL-24502: Least privilege for the sync workflows and pin the Maven wrapper downloads - #1963
Merged
Croway merged 1 commit intoSep 9, 2026
Conversation
…apper downloads Adapts the main branch fix (apache#1930) for camel-spring-boot-4.18.x, whose copies of automatic-sync-main.yml and generate-sbom-main.yml had diverged from main's since the branch was cut (older actions/checkout, actions/setup-java and peter-evans/create-pull-request tags), so a straight cherry-pick conflicted and was aborted in favor of hand-applying the pattern. Both workflows still check out and target `main` (ref: main / base: main), exactly as before this change - that pre-existing quirk is a separate, non-security concern left untouched here. automatic-sync-main.yml is schedule-only, so it never actually runs from this non-default branch; generate-sbom-main.yml additionally declares workflow_dispatch, so it can be manually dispatched against this branch and is a real, reachable instance of the permission gap. Both are hardened for consistency and defense in depth: - permissions: {} declared at the workflow level. - The single job is split into `build` (contents: read; checks out and builds apache/camel then camel-spring-boot, so it must not hold any write grant) and `create-pull-request` (contents: write, pull-requests: write; applies the regenerated diff and opens the PR, running no third-party build code). - Every `uses:` reference is pinned to a full commit SHA with the existing version tag kept as a trailing comment (no version bumps). .mvn/wrapper/maven-wrapper.properties on this branch points at the exact same distributionUrl/wrapperUrl as main's pre-fix file, so it gained the same distributionSha256Sum and wrapperSha256Sum, independently recomputed with shasum -a 256 and cross-checked against the .sha1 files published alongside those artifacts on repo.maven.apache.org. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U1BUa8bjo4rWycCm2nQVzo
oscerd
approved these changes
Sep 9, 2026
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.
Adapts #1930 for
camel-spring-boot-4.18.x.Original PR: #1930 — Least privilege for the sync workflows and pin the Maven wrapper downloads
JIRA: CAMEL-24502
What applies on this branch
Both
automatic-sync-main.ymlandgenerate-sbom-main.ymlexist on this branch, as leftovercopies from before the branch was cut — they still check out and target
main(ref: main,base: main), notcamel-spring-boot-4.18.x. That pre-existing quirk is a separate,non-security concern and is left untouched here; this PR only addresses the permission gap.
Because the two files had diverged from
main's (olderactions/checkout,actions/setup-javaand
peter-evans/create-pull-requesttags), a straightgit cherry-pick -xof the originalcommit conflicted on both workflow files. I aborted the cherry-pick and hand-applied the same
pattern instead, keeping this branch's existing action version tags (no version bumps):
permissions: {}declared at the workflow level on both files.build(contents: read— checks out and buildsapache/camelthencamel-spring-boot, so it must not hold any write grant, and uploads theregenerated diff as a build artifact) and
create-pull-request(contents: write,pull-requests: write— downloads and applies the artifact, then callspeter-evans/create-pull-request; it runs no third-party build code).uses:reference in both files is pinned to a full commit SHA with the existing versiontag kept as a trailing comment.
Worth noting for reviewers:
automatic-sync-main.ymlonly has ascheduletrigger, and GitHubonly fires scheduled workflows from the copy on the repository's default branch, so this file is
currently unreachable from a non-default branch like this one.
generate-sbom-main.ymlalsodeclares
workflow_dispatch, so it can be manually dispatched against this branch and was areal, reachable instance of the permission gap this ticket fixes. Both are hardened here for
consistency and defense in depth, even though one of them is presently dead code.
Maven wrapper pinning
.mvn/wrapper/maven-wrapper.propertieson this branch points at the exact samedistributionUrl(apache-maven-3.9.11-bin.zip) andwrapperUrl(
maven-wrapper-3.3.4.jar) asmain's pre-fix file. I independently downloaded both artifacts,computed their SHA-256 sums with
shasum -a 256, and cross-checked them against the.sha1files published alongside them on repo.maven.apache.org — they match main's committed values.
Added
distributionSha256SumandwrapperSha256Sumin the same format asmain.Verification
ruby -ryaml -e 'YAML.load_file(...)', PyYAMLwasn't available in this environment).
mvnbuild/test run was needed for this ticket.Claude Code on behalf of Federico Mariani