Skip to content

Commit 6444508

Browse files
committed
Switch tiny download verification to use the published gpg signature of the
author for improved integrity assurance. We could in principle preserve the weaker checksum verification during ADD, but we disable it for the time being since gpg is sufficient and because `hadolint` does not yet support the `--checksum` argument to ADD.
1 parent 81d1356 commit 6444508

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

Dockerfile.rocky8

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,10 +1712,21 @@ FROM --platform=linux/$ARCH setup_mig_configs AS start_mig
17121712
ARG DOMAIN
17131713

17141714
# Reap defuncted/orphaned processes
1715-
# IMPORTANT: always verify tini gpg signature and use checksum in download here
1715+
# IMPORTANT: always verify gpg signature / use verified checksum in downloads!
17161716
ARG TINI_VERSION=v0.18.0
17171717
ARG TINI_CHECKSUM=sha256:12d20136605531b09a2c2dac02ccee85e1b874eb322ef6baf7561cd93f93c855
1718-
ADD --checksum=${TINI_CHECKSUM} https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1718+
ARG TINI_GPG_KEY=0527A9B7
1719+
# NOTE: hadolint awaits https://github.com/hadolint/language-docker/pull/92 in
1720+
# an actual release so it will currectly fail hard on the checksum arg.
1721+
# Rely solely on explicit gpg signature verification for the time being.
1722+
#ADD --checksum=${TINI_CHECKSUM} https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1723+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1724+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
1725+
RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys ${TINI_GPG_KEY} \
1726+
&& if ! gpg --verify /tini.asc /tini ; then \
1727+
echo "FATAL: failed to verify tini binary"; \
1728+
exit 1 ; \
1729+
fi
17191730
RUN chmod +x /tini
17201731
ENTRYPOINT ["/tini", "--"]
17211732

Dockerfile.rocky9

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,10 +1599,21 @@ FROM --platform=linux/$ARCH setup_mig_configs AS start_mig
15991599
ARG DOMAIN
16001600

16011601
# Reap defuncted/orphaned processes
1602-
# IMPORTANT: always verify tini gpg signature and use checksum in download here
1602+
# IMPORTANT: always verify gpg signature / use verified checksum in downloads!
16031603
ARG TINI_VERSION=v0.18.0
16041604
ARG TINI_CHECKSUM=sha256:12d20136605531b09a2c2dac02ccee85e1b874eb322ef6baf7561cd93f93c855
1605-
ADD --checksum=${TINI_CHECKSUM} https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1605+
ARG TINI_GPG_KEY=0527A9B7
1606+
# NOTE: hadolint awaits https://github.com/hadolint/language-docker/pull/92 in
1607+
# an actual release so it will currectly fail hard on the checksum arg.
1608+
# Rely solely on explicit gpg signature verification for the time being.
1609+
#ADD --checksum=${TINI_CHECKSUM} https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1610+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1611+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
1612+
RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys ${TINI_GPG_KEY} \
1613+
&& if ! gpg --verify /tini.asc /tini ; then \
1614+
echo "FATAL: failed to verify tini binary"; \
1615+
exit 1 ; \
1616+
fi
16061617
RUN chmod +x /tini
16071618
ENTRYPOINT ["/tini", "--"]
16081619

0 commit comments

Comments
 (0)