Skip to content

Commit 83229ac

Browse files
tomassrnkaclaude
authored andcommitted
fix: add SHA256 verification to fetch-busybox Makefile target
Download SHA256SUMS from the fc-busybox release and verify the binary checksum, matching the Dockerfile verification pattern. All build paths now verify integrity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dbb8e2c commit 83229ac

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

packages/orchestrator/Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,23 @@ build:
3030
BUSYBOX_VERSION ?= 1.36.1
3131
BUSYBOX_EMBED := pkg/template/build/core/systeminit/busybox
3232
BUSYBOX_STAMP := $(BUSYBOX_EMBED).stamp
33+
BUSYBOX_RELEASE_URL := https://github.com/e2b-dev/fc-busybox/releases/download/v$(BUSYBOX_VERSION)
3334

34-
# Download busybox if missing or version/arch changed. For Docker builds,
35-
# the Dockerfile downloads and verifies the binary separately — this target
36-
# is only used by build-local and build-debug (local dev / CI).
35+
# Download busybox and verify SHA256 against published checksums.
36+
# Skips if binary exists and version/arch match the stamp file.
3737
.PHONY: fetch-busybox
3838
fetch-busybox:
3939
@if [ ! -f $(BUSYBOX_EMBED) ] || [ "$$(cat $(BUSYBOX_STAMP) 2>/dev/null)" != "$(BUSYBOX_VERSION)-$(BUILD_ARCH)" ]; then \
40+
BINARY="busybox_v$(BUSYBOX_VERSION)_$(BUILD_ARCH)"; \
4041
echo "Downloading busybox v$(BUSYBOX_VERSION) ($(BUILD_ARCH))..."; \
41-
curl -sfL -o $(BUSYBOX_EMBED).tmp "https://github.com/e2b-dev/fc-busybox/releases/download/v$(BUSYBOX_VERSION)/busybox_v$(BUSYBOX_VERSION)_$(BUILD_ARCH)" \
42-
&& mv $(BUSYBOX_EMBED).tmp $(BUSYBOX_EMBED) \
42+
curl -sfL -o /tmp/$$BINARY "$(BUSYBOX_RELEASE_URL)/$$BINARY" \
43+
&& curl -sfL -o /tmp/SHA256SUMS "$(BUSYBOX_RELEASE_URL)/SHA256SUMS" \
44+
&& (cd /tmp && grep "$$BINARY" SHA256SUMS | sha256sum -c -) \
45+
&& mv /tmp/$$BINARY $(BUSYBOX_EMBED) \
4346
&& chmod +x $(BUSYBOX_EMBED) \
4447
&& echo "$(BUSYBOX_VERSION)-$(BUILD_ARCH)" > $(BUSYBOX_STAMP) \
45-
|| { rm -f $(BUSYBOX_EMBED).tmp; echo "ERROR: failed to download busybox"; exit 1; }; \
48+
&& rm -f /tmp/SHA256SUMS \
49+
|| { rm -f /tmp/$$BINARY /tmp/SHA256SUMS; echo "ERROR: failed to download or verify busybox"; exit 1; }; \
4650
fi
4751

4852
.PHONY: build-local

0 commit comments

Comments
 (0)