Skip to content

v0.4.1-beta — Fix scanner image HOME for cap_drop ALL

Pre-release
Pre-release

Choose a tag to compare

@Nikolasel Nikolasel released this 24 Aug 12:05
· 110 commits to main since this release
Immutable release. Only release title and notes can be modified.
b132f1a

Fixes the scanner startup failure under least-privilege hardening (cap_drop: ALL) reported in #272.

Fix

  • Scanner image (deploy/Dockerfile.scanner): hardened /root to 0550 but left ENV HOME=/root. With CAP_DAC_OVERRIDE dropped, nuclei’s mkdir $HOME/.config failed with EACCES (mkdir /root/.config: permission denied) and every scan failed closed. Now bakes a dedicated private HOME at /home/scanner (mkdir -p /home/scanner && chmod 0700, ENV HOME=/home/scanner) for nuclei/naabu/uncover config+cache ($HOME/.config, $HOME/.cache, $HOME/nuclei-templates). Avoids the world-writable /tmp (1777) symlink/pre-creation surface that HOME=/tmp would have kept. A future move to a non-root USER will need a matching chown (e.g. chown 1001:0 /home/scanner).

Operational notes

  • cap_drop: ALL is often paired with read_only: true. With a read-only root filesystem the scanner now needs writable scratch at both /home/scanner (image HOME) and /tmp (SCANNER_WORK_DIR defaults to a private 0700 dir under os.TempDir()//tmp). Mount writable emptyDir/tmpfs volumes at both paths (as with EXPORT_SPOOL_DIR/TEMPLATE_SYNC_DIR for the backend). Documented in docs/ADMIN_GUIDE.md:103 and SCANNER_WORK_DIR.

Verification

  • Before: docker run --cap-drop ALL ghcr.io/...:0.4.0-beta nuclei -tl → mkdir /root/.config: permission denied
  • After: docker run --cap-drop ALL ghcr.io/...:0.4.1-beta nuclei -tl → Successfully installed nuclei-templates at /home/scanner/nuclei-templates
  • ls -ld /home/scanner → drwx------ (0700, root-owned), /root stays dr-xr-x---, scanner /v1/capabilities healthy under cap_drop ALL; --read-only --tmpfs /tmp --tmpfs /home/scanner starts clean.

Merged

  • #273 fix: point scanner HOME to writable /home/scanner so nuclei works with cap_drop ALL (#272)

Full changelog: v0.4.0-beta...v0.4.1-beta