OpenWA icon indicating copy to clipboard operation
OpenWA copied to clipboard

fix(security): replace direct Docker socket with socket proxy and add…

Open A831ARD0 opened this issue 6 months ago • 0 comments

… Bull Board auth

Three critical security fixes:

  1. Docker socket proxy (tecnativa/docker-socket-proxy)

    • Add docker-proxy service that is the only container with access to /var/run/docker.sock
    • openwa-api connects via DOCKER_HOST=tcp://docker-proxy:2375 (TCP)
    • Proxy exposes only the required Docker API operations (CONTAINERS, IMAGES, VOLUMES, INFO, PING, POST, DELETE)
    • Eliminates the Docker daemon escape vector from openwa-api
  2. Non-root container execution

    • Install gosu for safe privilege dropping
    • Add docker-entrypoint.sh: fixes named-volume ownership as root, then exec's to openwa user via gosu before starting Node.js
    • Process no longer runs as root inside the container
  3. Bull Board dashboard authentication

    • Add BullBoardAuthMiddleware that validates X-API-Key / Bearer token before allowing access to /admin/queues
    • Requires ADMIN role; returns 401/403 otherwise
    • Applied globally via AppModule.configure()

Also fix dashboard nginx upstream name: openwa -> openwa-api to match the Docker Compose service name (fixes dashboard crash-loop on startup).

Description

Brief description of changes

Type of Change

  • [ ] Bug fix
  • [ ] New feature
  • [ ] Breaking change
  • [ ] Documentation update

Checklist

  • [ ] Tests added/updated
  • [ ] Documentation updated
  • [ ] Lint passes
  • [ ] Self-reviewed

Screenshots (if applicable)

Related Issues

Closes #

A831ARD0 avatar May 22 '26 01:05 A831ARD0