Skip to content

fix(tools): run as non-root user and move binaries to /usr/local/bin#114

Open
monkeygold wants to merge 2 commits into
elder-plinius:mainfrom
monkeygold:fix/tools-nonroot-user
Open

fix(tools): run as non-root user and move binaries to /usr/local/bin#114
monkeygold wants to merge 2 commits into
elder-plinius:mainfrom
monkeygold:fix/tools-nonroot-user

Conversation

@monkeygold

Copy link
Copy Markdown

Summary

  • Add non-root operator user so the Kali tools container no longer runs as root by default
  • Move Go and Foundry binaries to /usr/local/bin (accessible to non-root) instead of /root/go/bin and /root/.foundry/bin
  • Remove /root paths from PATH env

Test plan

  • npm run tools:build succeeds
  • npm run tools:check passes (radare2/gdb/objdump/upx + python stack + pip-audit)
  • Container runs as operator user: docker run --rm cybench-tools:latest whoamioperator
  • Go tools accessible: docker run --rm cybench-tools:latest nuclei -version

Add 'operator' user so the Kali tools container no longer runs as root
by default. Go and Foundry binaries are installed to /usr/local/bin
instead of /root/ so they remain accessible to the non-root user.
Web challenges use curl on port 80, pwn challenges use process liveness
(kill -0 1), and python-based infra services use urllib. Enables
depends_on condition: service_healthy for proper startup ordering.

@jmagly jmagly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR #114 at bb183694c502f8229d3c83b967b07b1c782ed0eb.

Blocking finding:

  • npm run tools:build fails at the changed GOBIN=/usr/local/bin layer. The Go install for ProjectDiscovery httpx reports that /usr/local/bin/httpx already exists and is not an object file. The earlier Python dependency layer installs an httpx console script there, so this path change creates a deterministic collision and the image cannot build.

Please stage or rename the ProjectDiscovery binary, or otherwise resolve the collision, then run the checked-off build, tools check, whoami, and representative Go-tool checks.

The compose healthcheck commit is also independent of the stated non-root scope; please split it or document and verify that scope explicitly.

Verification:

  • docker compose config: pass, obsolete version warning only
  • npm run tools:build: fail at Dockerfile Go-tool layer
  • Public-input threat preflight: low risk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants