chore(image): chromium-from-apt + anti-detection flags via agent-browser env

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) <noreply@anthropic.com>
This commit is contained in:
0xallam
2026-04-26 01:42:20 -07:00
parent c011c66889
commit 8bbb31e075
+6 -5
View File
@@ -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"; \