Skip to content

Commit c230aa6

Browse files
updated - debian-9, debian-10; redhat-8: to replace python MD5 check with GPG signature check; (#475)
Co-authored-by: Alisha Mayor <[email protected]>
1 parent fb15e4f commit c230aa6

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

base/debian-10/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARG SCLOUD_URL
1919
ENV SCLOUD_URL=${SCLOUD_URL} \
2020
DEBIAN_FRONTEND=noninteractive \
2121
PYTHON_VERSION=3.7.10 \
22-
PYTHON_MD5=0b19e34a6dabc4bf15fdcdf9e77e9856
22+
PYTHON_GPG_KEY_ID=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2323

2424
COPY install.sh /install.sh
2525
RUN /install.sh && rm -rf /install.sh

base/debian-10/install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ apt-get install -y --no-install-recommends curl sudo libgssapi-krb5-2 busybox pr
3838
# Install Python and necessary packages
3939
PY_SHORT=${PYTHON_VERSION%.*}
4040
wget -O /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
41-
echo "$PYTHON_MD5 /tmp/python.tgz" | md5sum --check
41+
wget -O /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz.asc
42+
gpg --recv-keys $PYTHON_GPG_KEY_ID
43+
gpg --verify /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc /tmp/python.tgz
44+
rm /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc
4245
mkdir -p /tmp/pyinstall
4346
tar -xzC /tmp/pyinstall/ --strip-components=1 -f /tmp/python.tgz
4447
rm /tmp/python.tgz

base/debian-9/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARG SCLOUD_URL
1919
ENV SCLOUD_URL=${SCLOUD_URL} \
2020
DEBIAN_FRONTEND=noninteractive \
2121
PYTHON_VERSION=3.7.10 \
22-
PYTHON_MD5=0b19e34a6dabc4bf15fdcdf9e77e9856
22+
PYTHON_GPG_KEY_ID=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2323

2424
COPY install.sh /install.sh
2525
RUN /install.sh && rm -rf /install.sh

base/debian-9/install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ apt-get install -y --no-install-recommends curl sudo libgssapi-krb5-2 busybox pr
3737
# Install Python and necessary packages
3838
PY_SHORT=${PYTHON_VERSION%.*}
3939
wget -O /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
40-
echo "$PYTHON_MD5 /tmp/python.tgz" | md5sum --check
40+
wget -O /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz.asc
41+
apt-get install dirmngr -y
42+
gpg --keyserver pool.sks-keyservers.net --recv-keys $PYTHON_GPG_KEY_ID
43+
gpg --verify /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc /tmp/python.tgz
44+
rm /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc
4145
mkdir -p /tmp/pyinstall
4246
tar -xzC /tmp/pyinstall/ --strip-components=1 -f /tmp/python.tgz
4347
rm /tmp/python.tgz

base/redhat-8/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LABEL name="splunk" \
2828
ARG SCLOUD_URL
2929
ENV SCLOUD_URL=${SCLOUD_URL} \
3030
PYTHON_VERSION=3.7.10 \
31-
PYTHON_MD5=0b19e34a6dabc4bf15fdcdf9e77e9856
31+
PYTHON_GPG_KEY_ID=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
3232

3333
COPY install.sh /install.sh
3434

base/redhat-8/install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ microdnf -y --nodocs update gnutls kernel-headers librepo libnghttp2 tzdata
3434
# Install Python and necessary packages
3535
PY_SHORT=${PYTHON_VERSION%.*}
3636
wget -O /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
37-
echo "$PYTHON_MD5 /tmp/python.tgz" | md5sum --check
37+
wget -O /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz.asc
38+
gpg --keyserver pool.sks-keyservers.net --recv-keys $PYTHON_GPG_KEY_ID
39+
gpg --verify /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc /tmp/python.tgz
40+
rm /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc
3841
mkdir -p /tmp/pyinstall
3942
tar -xzC /tmp/pyinstall/ --strip-components=1 -f /tmp/python.tgz
4043
rm /tmp/python.tgz

0 commit comments

Comments
 (0)