OpenWA
OpenWA copied to clipboard
fix(security): replace direct Docker socket with socket proxy and add…
… Bull Board auth
Three critical security fixes:
-
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
-
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
-
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 #