Compare commits

...

2 Commits

Author SHA1 Message Date
18f559c4e6 Fix yq SHA256 checksum to correct value 2026-03-08 00:24:12 +11:00
c909668246 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>
2026-03-08 00:18:39 +11:00
3 changed files with 24 additions and 7 deletions

View File

@@ -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="0d6aaf1cf44a8d18fbc7ed0ef14f735a8df8d2e314c4cc0f0242d35c0a440c95" && \
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"]

View File

@@ -19,6 +19,18 @@ This container provides a stable, tool-rich environment for the AI agent to:
- **Kubernetes:** OpenShift CLI (oc)
- **Search:** ripgrep (fast grep alternative)
## Prerequisites
Before deploying, create the kubeconfig secret to give the container kubectl/oc access:
```bash
kubectl create secret generic kube \
--from-file=config=$HOME/.kube/breakglass-system-admin.kubeconfig \
-n clawdbox
```
**Note:** This kubeconfig is mounted at `/home/claw/.kube/config` inside the container.
## Deployment (OpenShift / K8s)
1. **Build Image:**

View File

@@ -23,7 +23,7 @@ spec:
runAsNonRoot: true
initContainers:
- name: setup-ssh
image: busybox:latest
image: busybox:1.36
command:
- sh
- -c