Repository navigation
fix(ci): Security hardening - #723
Merged
Merged
Conversation
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 8 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
rodrigojara-cko
approved these changes
Dec 1, 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.



Summary
Security hardening of the build tooling: the CI Gradle script and Gradle always use the same
Gradle user home, the Gradle wrapper files are regenerated by Gradle 8.14.8 and pinned, and a
distribution reused from an earlier run is checked against a committed checksum. The published
library does not change.
Changes
.github/scripts/gradle.sh: resolves the Gradle user home once (GRADLE_USER_HOME, else$HOME/.gradle, made absolute), exports it and passes it with--gradle-user-home; refuses torun when neither variable is set. Accepts the two settings the current wrapper task writes
(
networkTimeout,validateDistributionUrl=true). Checks the wrapper jar, both start scriptsand an unpacked distribution the wrapper would run against
gradle/wrapper/gradle-distribution.sha256, and the layout of a reused distribution folder,instead of hashing the zip next to it. Runs Gradle with
--no-daemonand removes the Gradle userhome's
nativefolder before running (only when it holds nothing but Gradle's own folders).Input validation of the Gradle user home path, its folders and settings, and the JVM option
variables.
.github/scripts/gradle-distribution.sh(new):pinwrites the checksum file from the officialdistribution after checking its sha256 against
distributionSha256Sumand checking that thedistribution's own wrapper task generates exactly the committed wrapper files;
hashandsumcompute the checksums
gradle.shcompares..github/scripts/gradle-sh-test.sh(new): tests forgradle.shwith a stand-in Java, offline(permission cases are skipped when run as root);
GRADLE_SH_TEST_REAL=1adds runs of the realwrapper in a fresh Gradle home, then in the same home again, and checks that
pinreproduces thecommitted checksum file and refuses a start script the release does not generate.
gradle/wrapper/gradle-distribution.sha256(new): checksums of the unpacked Gradle 8.14.8distribution, the wrapper jar,
gradlewandgradlew.bat.gradlew,gradlew.bat,gradle/wrapper/gradle-wrapper.jar,gradle/wrapper/gradle-wrapper.properties:regenerated with
./gradlew wrapper --gradle-version 8.14.8 --distribution-type all --gradle-distribution-sha256-sum 34b008b7b744e4d12468e97ba03c572d0cd786fd0334e61e0171ea3d1a566b73(run twice, so the second run is Gradle 8.14.8 writing its own files); same distribution and
sha256 as before.
Design notes: The Gradle user home is passed to the wrapper as an option so the script and Gradle
always use the same folder, and it is also exported so every process the build starts sees the
same value. The path must be absolute after resolution, without
.or..segments and inprintable ASCII, so the folder the script reads is the folder the JVM opens; an account whose home
path is not ASCII sets
GRADLE_USER_HOME. Folders the script cannot read are refused rather thanskipped, and a backslash anywhere in the Gradle user home's
gradle.propertiesis refused, so everykey is read as written (a value that needs a backslash goes in the project or the environment).
JVM option variables are compared as the JVM reads them.
The current wrapper deletes the distribution zip after unpacking, so a reused distribution is
checked against a committed checksum of the content of every file and directory of the unpacked
distribution; it works offline and is reviewed with the properties file. Only a distribution the
wrapper would run (its marker file present) is hashed: without the marker, the wrapper unpacks the
zip again after checking
distributionSha256Sum, and it checks the zip itself whenever it uses it,so the script no longer hashes the zip. The wrapper jar and start scripts are pinned in the same
file, so a change to any of them needs a new pin, and
pinonly writes one when the pinnedrelease generates exactly the committed files; the start scripts are pinned although
gradle.shstarts the jar directly, because they are what maintainers run. The check costs a few seconds per
run on a reused Gradle home (22,450 files); a fresh Gradle home, as in every CI job, has nothing to
check, and the wrapper verifies the download.
Every run starts a new Gradle process and Gradle unpacks its native libraries again, because a
running daemon and that folder outlive the run that created them; CI jobs start fresh, so they only
pay the JVM start. On a Gradle user home shared with other projects or an IDE, Gradle processes
starting at the same moment unpack their native libraries again; CI homes are not shared.
--no-daemonstays accepted as an argument for existing callers.A wrapper update, including Dependabot's
gradle-wrapperpull requests, must also runbash .github/scripts/gradle-distribution.sh pin; until thengradle.shrefuses to run, whichis intended.
gradlew.batnow has CRLF line endings, as Gradle generates it. The new test runslocally; it is not added to a workflow, since workflows change here only when CI is broken. Gradle
stays on 8.14.8 (the workflows use JDK 11).
API Reference
None.
Breaking changes
None. The published library does not change.
gradle.shnow refuses to run when neitherGRADLE_USER_HOMEnorHOMEis set (it failed before too, with a shell error), when thechecksum file does not match the wrapper settings or the wrapper files, when a reused
distribution folder holds anything the wrapper does not create there, and on a Gradle user home
path, folder or setting it cannot check (see Design notes). It no longer starts or reuses a
Gradle daemon, and it removes
$GRADLE_USER_HOME/native(Gradle recreates it), refusing insteadwhen that folder holds anything Gradle does not create.
Tests
.github/scripts/gradle.sh build, fresh Gradle home, then again in the same home)bash .github/scripts/gradle-sh-test.sh(bash 3.2 and 5.3, as a user and as root) andGRADLE_SH_TEST_REAL=1 bash .github/scripts/gradle-sh-test.shpublishMavenPublicationToStagingRepositoryand compared with a build frommasterRelated
None.