chore: verify WAR signature when downloading it#2233
chore: verify WAR signature when downloading it#2233lemeurherve merged 2 commits intojenkinsci:masterfrom
Conversation
9e27a7a to
198d44f
Compare
198d44f to
535081e
Compare
d087aec to
49233f0
Compare
49233f0 to
ef010cc
Compare
| # Not using ADD as it does not check Last-Modified header | ||
| # see https://github.com/docker/docker/issues/8331 | ||
| RUN curl -fsSL "${WAR_URL}" -o /war/jenkins.war \ | ||
| && curl -fsSL "${WAR_URL}.asc" -o /war/jenkins.war.asc \ |
There was a problem hiding this comment.
(nit) As per https://docs.docker.com/reference/dockerfile/#adding-files-from-a-url
If the HTTP response contains a Last-Modified header, the timestamp from that header will be used to set the mtime on the destination file. However, like any other file processed during an ADD, mtime isn't included in the determination of whether or not the file has changed and the cache should be updated.
=> we can totally delegate the file download to the Docker Engine with something like
| # Not using ADD as it does not check Last-Modified header | |
| # see https://github.com/docker/docker/issues/8331 | |
| RUN curl -fsSL "${WAR_URL}" -o /war/jenkins.war \ | |
| && curl -fsSL "${WAR_URL}.asc" -o /war/jenkins.war.asc \ | |
| # Not using ADD as it does not check Last-Modified header | |
| # see https://github.com/docker/docker/issues/8331 | |
| ADD "${WAR_URL}" /war/jenkins.war | |
| ADD "${WAR_URL}.asc" /war/jenkins.war.asc |
There was a problem hiding this comment.
Nice!
I suggest doing this change for all downloads in all images in another pull request.
There was a problem hiding this comment.
Nice!
I suggest doing this change for all downloads in all images in another pull request.
Yup, totally agreed \o/
This change uses the GPG signature files now served from both pkg.jenkins.io and get.jenkins.io, and the new Jenkins PGP public key from 2026 (stored in this repository1) to verify Jenkins WAR signature on build.
Ref:
Testing done
Submitter checklist
Footnotes
As that GPG public key is valid for 3 years and as builds will fail if expired, manually updating it when it arrives could be enough. ↩