Skip to content

Commit 9f8142f

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 0569a81 commit 9f8142f

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
@@ -1717,10 +1717,21 @@ FROM --platform=linux/$ARCH setup_mig_configs AS start_mig
17171717
ARG DOMAIN
17181718

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

Dockerfile.rocky9

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

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

0 commit comments

Comments
 (0)