crowdsecurity / cs-haproxy-spoa-bouncer

EXPERIMENTAL: HAProxy spoe filter for CrowdSec - WAF and IP protection
MIT License
5 stars 1 forks source link

[workers] WorkerManager should keep uid, gid from config #4

Closed LaurenceJJones closed 1 month ago

LaurenceJJones commented 1 month ago

https://github.com/crowdsecurity/cs-haproxy-spoa-bouncer/blob/3c6a8aa47cf440f05e8dc0ee3035a9fe454f0126/cmd/root.go#L228

The worker manager should have the uid and gid of the socket permission instead of being set on startup by the config handler.

Reasons:

LaurenceJJones commented 1 month ago

remove: https://github.com/crowdsecurity/cs-haproxy-spoa-bouncer/blob/3c6a8aa47cf440f05e8dc0ee3035a9fe454f0126/pkg/cfg/config.go#L89-L92

LaurenceJJones commented 1 month ago

Set worker uid and gid here from manager context:

https://github.com/crowdsecurity/cs-haproxy-spoa-bouncer/blob/3c6a8aa47cf440f05e8dc0ee3035a9fe454f0126/internal/worker/root.go#L87-L95