Skip to content

[Bug]: /metrics endpoint does not support Basic Auth #800

@vincenzomartusciello

Description

@vincenzomartusciello

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

  1. Configure PowerDNS with webserver enabled and Basic Auth (e.g. webserver=yes, webserver-password=...).
  2. Enable /metrics endpoint (curl -su user:pass http://127.0.0.1:8081/metrics works).
  3. Use PowerAdmin’s metrics feature.
  4. 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.

Metadata

Metadata

Assignees

Labels

apiAPI-related features, improvements, and integrations

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions