From 701a1c92ba8eba9de5716221ed4028867e233757 Mon Sep 17 00:00:00 2001 From: Mattia Date: Mon, 16 Nov 2026 09:40:59 +0100 Subject: [PATCH] fix(docker): build bbot's gowitness and retirejs on arm64 On arm64 hosts such as Apple Silicon the image did not build. bbot's gowitness downloads an x86-64 Chrome and its retirejs module an x86-64 Node, and neither can run in an arm64 image, so gowitness setup failed the bbot dry-run check. retirejs failed too, but the check did not cover it. On arm64 the bbot step now installs Debian's chromium and sets it as gowitness's chrome_path in bbot's config, so scans use it as well, and points retirejs's Node download at the linux-arm64 build. The dry-run check now covers retirejs. amd64 builds skip the new block. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + Dockerfile | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35a9257..71b3041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ All notable changes to this project are documented in this file. The format is b ### Fixed +- **bbot on arm64**: the image now builds on arm64 hosts such as Apple Silicon. bbot's `gowitness` downloaded an x86-64 Chrome and `retirejs` an x86-64 Node, which can't run there, so the build failed. On arm64 the image uses Debian's `chromium` for gowitness and an arm64 Node for retirejs, and the build check now covers `retirejs` too. amd64 builds are unchanged. - **Auto-scope hygiene**: auto `task_scope` rows count for coverage and untested assets only under a declared root, and direct coverage counts anchored assets through fact anchors only; the scope is described as "coverage scope, not enforced" (#196). - **Enrich HTTP probe**: it now dials through `intercept.PinnedDialer`, so the target gate applies and a probe without a target scope is refused (#198). - **Agent hook data races**: the eight package-level hooks are synchronised, so a second wire-up no longer races tasks that already read them (#227). diff --git a/Dockerfile b/Dockerfile index a13227c..4e4a539 100644 --- a/Dockerfile +++ b/Dockerfile @@ -145,14 +145,25 @@ RUN set -eux; \ # preinstalled (--install-all-deps) so scans never need pip at runtime, which # would fail under a program's egress allowlist. ARG BBOT_VERSION=3.0.2 +# arm64: bbot's Chrome and retirejs's Node are x86-64; use native builds. RUN set -eux; \ python -m venv /opt/bbot; \ /opt/bbot/bin/pip install --no-cache-dir "bbot==${BBOT_VERSION}"; \ ln -s /opt/bbot/bin/bbot /usr/local/bin/bbot; \ + if [ "${TARGETARCH:-amd64}" = "arm64" ]; then \ + apt-get update; \ + apt-get install -y --no-install-recommends chromium; \ + rm -rf /var/lib/apt/lists/*; \ + bbot_dir="$(/opt/bbot/bin/python -c 'import bbot, os; print(os.path.dirname(bbot.__file__))')"; \ + sed -i 's/linux-x64/linux-arm64/g' "$bbot_dir/modules/retirejs.py"; \ + fi; \ bbot -y --install-all-deps; \ + if [ "${TARGETARCH:-amd64}" = "arm64" ]; then \ + printf '\nmodules:\n gowitness:\n chrome_path: /usr/bin/chromium\n' >> /root/.config/bbot/bbot.yml; \ + fi; \ bbot --version >/dev/null; \ - bbot --dry-run -t example.com -m wafw00f,paramminer_getparams,lightfuzz,sslcert,gowitness >/dev/null 2>&1 || true; \ - bbot --dry-run -t example.com -m wafw00f,paramminer_getparams,lightfuzz,sslcert,gowitness --no-color >/tmp/bbot-dry.log 2>&1 || true; \ + bbot --dry-run -t example.com -m wafw00f,paramminer_getparams,lightfuzz,sslcert,gowitness,retirejs >/dev/null 2>&1 || true; \ + bbot --dry-run -t example.com -m wafw00f,paramminer_getparams,lightfuzz,sslcert,gowitness,retirejs --no-color >/tmp/bbot-dry.log 2>&1 || true; \ ! grep -qE "Installing|ERRR|CRITICAL" /tmp/bbot-dry.log || { cat /tmp/bbot-dry.log; exit 1; }