Files
pentestagent/docker-compose.yml
giveen 36350775f9 docker: improve safety, UX, and Metasploit MCP defaults
Why:
- Persist artifacts to /app/loot so container outputs remain available when mounted.
- Avoid mandatory host chown; make chown opt-in via CHOWN_ON_START to prevent accidental ownership changes.
- Bind msfrpcd to 127.0.0.1 by default and add EXPOSE_MSF_RPC opt-in to avoid exposing RPC to host network.
- Replace crashing assertion on missing default model with a friendly CLI/TUI error path.
- Add .dockerignore to reduce build context and avoid copying unnecessary files.
2026-01-15 08:58:06 -07:00

49 lines
1.4 KiB
YAML

services:
pentestagent:
build:
context: .
dockerfile: Dockerfile
container_name: pentestagent
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- PENTESTAGENT_MODEL=${PENTESTAGENT_MODEL}
- PENTESTAGENT_DEBUG=${PENTESTAGENT_DEBUG:-false}
volumes:
- ./loot:/app/loot
networks:
- pentestagent-net
stdin_open: true
tty: true
pentestagent-kali:
build:
context: .
dockerfile: Dockerfile.kali
container_name: pentestagent-kali
privileged: true # Required for VPN and some tools. NOTE: this is risky on shared hosts; prefer running inside a disposable VM.
cap_add:
- NET_ADMIN
- SYS_ADMIN
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- PENTESTAGENT_MODEL=${PENTESTAGENT_MODEL}
- ENABLE_TOR=${ENABLE_TOR:-false}
- INIT_METASPLOIT=${INIT_METASPLOIT:-false}
# By default msfrpcd binds to loopback; to intentionally expose Metasploit RPC to the host
# set EXPOSE_MSF_RPC=true in your environment. This is NOT recommended on shared machines.
- EXPOSE_MSF_RPC=${EXPOSE_MSF_RPC:-false}
volumes:
- ./loot:/app/loot
networks:
- pentestagent-net
stdin_open: true
tty: true
profiles:
- kali
networks:
pentestagent-net:
driver: bridge