From 8bbb31e075599ce3b8f4dc477b8d0885365cb49b Mon Sep 17 00:00:00 2001 From: 0xallam Date: Sun, 26 Apr 2026 01:42:20 -0700 Subject: [PATCH] chore(image): chromium-from-apt + anti-detection flags via agent-browser env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drops the ``agent-browser install --with-deps`` step (Chrome for Testing has no ARM64 build and ships several automation tells) and uses the apt-installed Chromium across both arches. ``agent-browser`` is wired via three env vars baked into the image: * ``AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium`` — every browser launch picks up the apt binary; no per-call flag needed. * ``AGENT_BROWSER_USER_AGENT`` — recent stable Chrome 131 Linux UA. * ``AGENT_BROWSER_ARGS`` — minimal stealth flag set: ``--disable-blink-features=AutomationControlled`` (the most- checked tell), ``--exclude-switches=enable-automation``, ``--disable-features=IsolateOrigins,site-per-process,Translate, BlinkGenPropertyTrees``, sane window-size + lang, infobars + save-password + session-crashed bubbles off. The ``agent-browser doctor --offline --quick`` step at build time verifies the binary launches; subsequent runtime calls inherit the env automatically. Net: smaller image (no ~150 MB Chrome-for-Testing download), ARM64-clean, env-driven config so future flag tweaks land without touching the agent-browser install. Co-Authored-By: Claude Opus 4.7 (1M context) --- containers/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/containers/Dockerfile b/containers/Dockerfile index f651fe2..7de7128 100644 --- a/containers/Dockerfile +++ b/containers/Dockerfile @@ -32,7 +32,8 @@ RUN apt-get update && \ nodejs npm pipx \ libcap2-bin \ gdb \ - libnss3-tools + libnss3-tools \ + chromium fonts-liberation RUN setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip $(which nmap) @@ -94,11 +95,11 @@ RUN npm install -g retire@latest && \ npm install -g tree-sitter-cli@latest && \ npm install -g agent-browser@0.26.0 -USER root -RUN agent-browser install --with-deps - USER pentester -RUN agent-browser install && agent-browser doctor --offline --quick +ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium +ENV AGENT_BROWSER_USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" +ENV AGENT_BROWSER_ARGS="--disable-blink-features=AutomationControlled --exclude-switches=enable-automation --disable-features=IsolateOrigins,site-per-process,Translate,BlinkGenPropertyTrees --no-first-run --no-default-browser-check --window-size=1920,1080 --lang=en-US,en --disable-infobars --disable-notifications --disable-save-password-bubble --disable-session-crashed-bubble" +RUN /home/pentester/.npm-global/bin/agent-browser doctor --offline --quick RUN set -eux; \ TS_PARSER_DIR="/home/pentester/.tree-sitter/parsers"; \