From: Aki Tuomi Date: Thu, 13 Aug 2015 06:44:17 +0000 (+0300) Subject: Use separate setting for supermaster and notify X-Git-Tag: dnsdist-1.0.0-alpha2~40^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=771bb0b0bb525706bb74604311de7e38fcb58615;p=pdns Use separate setting for supermaster and notify This allows enforcing signed supermaster notifications, but retains compability with possible external nameservers that do not support signed notifications. --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 1532d5050..fb4195418 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -56,7 +56,8 @@ void declareArguments() ::arg().setSwitch("dnsupdate","Enable/Disable DNS update (RFC2136) support. Default is no.")="no"; ::arg().setSwitch("write-pid","Write a PID file")="yes"; ::arg().set("allow-dnsupdate-from","A global setting to allow DNS updates from these IP ranges.")="127.0.0.0/8,::1"; - ::arg().set("allow-insecure-notify","Allow unsigned notifications for TSIG secured domains")="yes"; //FIXME: change to 'no' later + ::arg().set("allow-unsigned-notify","Allow unsigned notifications for TSIG secured domains")="yes"; //FIXME: change to 'no' later + ::arg().set("allow-unsigned-supermaster", "Allow supermasters to create zones without TSIG signed NOTIFY")="yes"; ::arg().setSwitch("forward-dnsupdate","A global setting to allow DNS update packages that are for a Slave domain, to be forwarded to the master.")="yes"; ::arg().setSwitch("log-dns-details","If PDNS should log DNS non-erroneous details")="no"; ::arg().setSwitch("log-dns-queries","If PDNS should log all incoming DNS queries")="no"; diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 82fa1c581..c2b3b2679 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -809,6 +809,12 @@ int PacketHandler::trySuperMasterSynchronous(DNSPacket *p, const DNSName& tsigke string nameserver, account; DNSBackend *db; + + if (!::arg().mustDo("allow-unsigned-supermaster") && tsigkeyname.empty()) { + L<qdomain<<" from potential supermaster "<getRemote()<<". Refusing."<getRemote(), p->qdomain, nsset, &nameserver, &account, &db)) { L<qdomain<<" for potential supermaster "<getRemote()<<". Remote nameservers: "<qdomain,"AXFR-MASTER-TSIG",meta) && meta.size() > 0) { if (!p->d_havetsig) { - if (::arg().mustDo("allow-insecure-notify")) { - L<qdomain<<" from "<getRemote()<<": permitting because allow-insecure-notify is turned on."<qdomain<<" from "<getRemote()<<": refused because allow-insecure-notify is turned off."<qdomain<<" from "<getRemote()<<": permitted because allow-unsigned-notify"; + } else { + L<qdomain<<" from "<getRemote()<<": refused"<getTSIGKeyname().toStringNoDot()) { L<qdomain<<" from "<getRemote()<<": expected TSIG key '"<getTSIGKeyname()<<"'"<