data-prepper icon indicating copy to clipboard operation
data-prepper copied to clipboard

[BUG] Health Check returns 401 when Auth is enabled

Open dinujoh opened this issue 2 years ago • 2 comments

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:

  1. Configure the Data Pepper Pipeline config with Auth
source:
  http:
    authentication:
      http_basic:
        username: my-user
        password: my_s3cr3t
  1. Start Data Prepper
  2. 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

dinujoh avatar Jul 21 '22 18:07 dinujoh

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.

dlvenable avatar Aug 08 '22 19:08 dlvenable

The fix needs to be added to OTelMetricsSource as well here.

dinujoh avatar Aug 12 '22 22:08 dinujoh