CoreDNS dnsserver package use as a library (as a go package by other programs)
What would you like to be added:
- Remove flag handling from
dnsserver - Allow setting the list of plugins as a function call
- stay away from init() on load initialization of the
dnsserverpackage
Why is this needed: As part of developing Knative Security-Guard, we wish to explore adding a minimal DNS proxy between protected user containers and the cluster DNS services. This proxy will profile the DNS requests and responses from/to the container and compare the profile to established criteria. It will identify behavior changes in the protected containers and can also protect against DNS tunneling.
We are exploring using CoreDNS. To start, we can run CoreDNS by setting it to always use a single proxy plugin that will forward all requests to the cluster DNS services. Then, enhance it to perform the necessary security work (profile requests and responses and so forth). A potential benefit from this approach is that such enhancement can later be used as the basis of a new CoreDNS security enhancement by the community.
This issue deals only with the ability to use CoreDNS as a library of a different program. To do so, we ask to make a slight change in the initialization.
Source: coredns/coredns