-
-
Notifications
You must be signed in to change notification settings - Fork 290
Description
Describe the problem
When PowerDNS webserver is configured with Basic Auth enabled, the /metrics endpoint requires HTTP Basic Authentication.
PowerAdmin’s PHP code calls /metrics directly but does not include any Basic Auth headers. As a result, every request to /metrics returns 401 Unauthorized.
This makes it impossible to use the integrated metrics functionality when PowerDNS is secured with Basic Auth.
Steps to reproduce
- Configure PowerDNS with webserver enabled and Basic Auth (e.g. webserver=yes, webserver-password=...).
- Enable /metrics endpoint (curl -su user:pass http://127.0.0.1:8081/metrics works).
- Use PowerAdmin’s metrics feature.
- The request fails with 401 Unauthorized.
Poweradmin version
4.0.2
Database
PostgreSQL
Additional information (optional)
I created an Apache reverse proxy in front of PowerDNS.
All API requests are proxied directly.
/metrics requests are intercepted by Apache, which injects the required Basic Auth credentials.
I also configured settings.php setting explicit the port, because PowerAdmin’s code rewrites the link and forces port 8081, breaking the call.
This way, PowerAdmin receives the response correctly even though it doesn’t natively support Basic Auth for /metrics.