plugin/kubernetes: Only answer transfer requests for authoritative zones (#4802)

* check for zone match

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver
2021-08-13 11:02:00 -04:00
committed by GitHub
parent 5aae49cee5
commit 88d94dc148
2 changed files with 21 additions and 0 deletions

View File

@@ -18,6 +18,10 @@ import (
// Transfer implements the transfer.Transfer interface.
func (k *Kubernetes) Transfer(zone string, serial uint32) (<-chan []dns.RR, error) {
match := plugin.Zones(k.Zones).Matches(zone)
if match == "" {
return nil, transfer.ErrNotAuthoritative
}
// state is not used here, hence the empty request.Request{]
soa, err := plugin.SOA(context.TODO(), k, zone, request.Request{}, plugin.Options{})
if err != nil {