data-prepper
data-prepper copied to clipboard
[BUG] Health Check returns 401 when Auth is enabled
Describe the bug Health Check to Log Source or Otel Source returns 401 when Auth is enabled. If we have data prepper fronted by load balancer and load balancer is doing health check, the health check path should be excluded from Auth.
To Reproduce Steps to reproduce the behavior:
- Configure the Data Pepper Pipeline config with Auth
source:
http:
authentication:
http_basic:
username: my-user
password: my_s3cr3t
- Start Data Prepper
- curl http://localhost:2021/health
Expected behavior return Http status 200 with response {}.
Screenshots
curl http://localhost:2021/health
401 Unauthorized%
Environment (please complete the following information):
- OS: Linux
I think this should be an enhancement which allows users to configure whether the health check is open to anonymous requests or requires authentication.
Here is a possible configuration: unauthenticated_health_check
which has the following values: allow
, deny
.
The fix needs to be added to OTelMetricsSource as well here.