[dnsdist] disable apiKey for Webserver not working in dnsdist 1.5?

willow.pine.2011 willow.pine.2011 at gmail.com
Fri Apr 2 02:47:12 UTC 2021


Hi, All,

I am unable to get disable apiKey working for Webserver in dnsdist 1.5.

First, I tried using webserver to config in the dnsdist configuration file:

1. add webserver("127.0.0.1:9086", "supersecretpassword", "")  to the
config_file

2.  start dnsdist: /usr/bin/dnsdist -C /var/log/dnsdist/test/dnsdist.conf

3. try to access the webserver:

curl -i 127.0.0.1 -s -H 'X-API-Key: '
http://127.0.0.1:9086/api/v1/servers/localhost


or curl -i 127.0.0.1 -s  http://127.0.0.1:9086/api/v1/servers/localhost



but both above curl command returns the following: "

HTTP/1.1 401 Unauthorized

Transfer-Encoding: chunked

Connection: close

Content-Security-Policy: default-src 'self'; style-src 'self'
'unsafe-inline'

Www-Authenticate: basic realm="PowerDNS"

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Permitted-Cross-Domain-Policies: none

X-Xss-Protection: 1; mode=block

"


4. if I config  a apiKey using webserver function call, it works.

webserver("127.0.0.1:9083", "supersecretpassword", "12")


then curl works: curl -i 127.0.0.1 -s -H 'X-API-Key: 12'
http://127.0.0.1:9086/api/v1/servers/localhost



My question is: what I did wrong? How should I configure webserver to
disable the apiKey usage?

Also, is there a way to look at the current webserver configuration using
the  dnsdist console command?


Thanks,


Eve


P.S. I also tried to set the apiKey to empty using the following without
success:

 setWebserverConfig({apiKey=""})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/dnsdist/attachments/20210401/c17e333d/attachment.htm>


More information about the dnsdist mailing list