aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
523 stars 151 forks source link

Using X-Forwarded-For to check for external request #176

Open Dainii opened 10 months ago

Dainii commented 10 months ago

Description

There is a mechanism to prevent external queries to reach the metrics endpoints based on the presence or not of the X-Forwarded-Host header. Would it be possible to also check the presence of the X-Forwarded-For header (very often used when an application runs behind a reverse proxy) ?

We do not use the X-Forwarded-Host anywhere because the Host header is never changed.

Expected Behavior

Deny request when the DISABLE_EXTERNAL_ACCESSenv is set and the X-Forwarded-For header present in the request.

Actual Behavior

It only checks the presence of the X-Forwarded-Host header.

Environment