Security and reliability improvements
- Add SHA256 checksum verification for yq and oc downloads to prevent supply chain attacks - Pin busybox init container to version 1.36 for consistency - Fix gitconfig symlink to work unconditionally (survives file creation after boot) - Document kubeconfig secret prerequisite with correct breakglass config path Security: Protects against compromised mirrors and MITM attacks during image build Reliability: Ensures reproducible builds and proper git config persistence Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -39,16 +39,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
&& apt-get install -y nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install yq (v4.x)
|
||||
# Install yq (v4.x) with checksum verification
|
||||
RUN YQ_VERSION="v4.40.5" && \
|
||||
YQ_SHA256="47d0032f1f769c2e91b52bfde058d4956e5a959988a8460ed0a55d6ce703795c" && \
|
||||
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/bin/yq && \
|
||||
echo "${YQ_SHA256} /usr/bin/yq" | sha256sum -c - && \
|
||||
chmod +x /usr/bin/yq
|
||||
|
||||
# Install OpenShift CLI (oc)
|
||||
# Install OpenShift CLI (oc) with checksum verification
|
||||
RUN OC_VERSION="stable" && \
|
||||
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OC_VERSION}/openshift-client-linux.tar.gz -O /tmp/oc.tar.gz && \
|
||||
tar -xvf /tmp/oc.tar.gz -C /usr/bin/ oc && \
|
||||
rm /tmp/oc.tar.gz && chmod +x /usr/bin/oc
|
||||
OC_BASE_URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OC_VERSION}" && \
|
||||
wget ${OC_BASE_URL}/openshift-client-linux.tar.gz -O /tmp/openshift-client-linux.tar.gz && \
|
||||
wget ${OC_BASE_URL}/sha256sum.txt -O /tmp/sha256sum.txt && \
|
||||
cd /tmp && grep "openshift-client-linux.tar.gz$" sha256sum.txt | sha256sum -c - && \
|
||||
tar -xvf openshift-client-linux.tar.gz -C /usr/bin/ oc && \
|
||||
rm openshift-client-linux.tar.gz sha256sum.txt && chmod +x /usr/bin/oc
|
||||
|
||||
# Install Python tools for LLM work
|
||||
RUN pip3 install --no-cache-dir --break-system-packages \
|
||||
@@ -125,5 +130,5 @@ for keytype in rsa ecdsa ed25519; do \
|
||||
fi; \
|
||||
done && \
|
||||
chmod 600 /data/ssh/ssh_host_*_key && \
|
||||
if [ -f /data/.gitconfig ]; then ln -sf /data/.gitconfig ~/.gitconfig; fi && \
|
||||
ln -sf /data/.gitconfig ~/.gitconfig && \
|
||||
/usr/sbin/sshd -D -e -f /etc/ssh/sshd_config"]
|
||||
|
||||
Reference in New Issue
Block a user