Skip to content

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

Open
A831ARD0 wants to merge 1 commit into
rmyndharis:mainfrom
A831ARD0:feat/security-docker-proxy-bullboard-auth
Open

fix(security): replace direct Docker socket with socket proxy and add…#129
A831ARD0 wants to merge 1 commit into
rmyndharis:mainfrom
A831ARD0:feat/security-docker-proxy-bullboard-auth

Conversation

@A831ARD0
Copy link
Copy Markdown

… 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 #

… 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).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant