Number of milliseconds to wait for a remote authoritative server to respond.
+## `nsec3-max-iterations`
+* Integer
+* Default: 2500
+* Available since: 4.1
+
+Maximum number of iterations allowed for an NSEC3 record. If an answer containing an NSEC3 record
+with more iterations is received, its DNSSEC validation status is treated as Insecure.
+
## `packetcache-ttl`
* Integer
* Default: 3600
}
g_dnssecLogBogus = ::arg().mustDo("dnssec-log-bogus");
+ g_maxNSEC3Iterations = ::arg().asNum("nsec3-max-iterations");
try {
loadRecursorLuaConfig(::arg()["lua-config-file"], ::arg().mustDo("daemon"));
::arg().set("snmp-master-socket", "If set and snmp-agent is set, the socket to use to register to the SNMP master")="";
::arg().set("tcp-fast-open", "Enable TCP Fast Open support on the listening sockets, using the supplied numerical value as the queue size")="0";
+ ::arg().set("nsec3-max-iterations", "Maximum number of iterations allowed for an NSEC3 record")="2500";
::arg().setCmd("help","Provide a helpful message");
::arg().setCmd("version","Print version string");
updateValidationState(state, Insecure);
return;
}
+ else if (res == INSECURE) {
+ LOG("Insecure denial found for "<<ne.d_name<<", retuning Insecure"<<endl);
+ ne.d_validationState = Insecure;
+ }
else {
LOG("Invalid denial found for "<<ne.d_name<<", retuning Bogus"<<endl);
ne.d_validationState = Bogus;
harvestNXRecords(lwr.d_records, ne);
cspmap_t csp = harvestCSPFromNE(ne);
dState denialState = getDenial(csp, newauth, QType::DS);
- if (denialState == NXQTYPE || denialState == OPTOUT) {
+ if (denialState == NXQTYPE || denialState == OPTOUT || denialState == INSECURE) {
ne.d_validationState = Secure;
rec.d_ttl = min(s_maxnegttl, rec.d_ttl);
LOG(prefix<<qname<<": got negative indication of DS record for '"<<newauth<<"'"<<endl);
#include "base32.hh"
#include "logger.hh"
bool g_dnssecLOG{false};
+uint16_t g_maxNSEC3Iterations{0};
#define LOG(x) if(g_dnssecLOG) { L <<Logger::Warning << x; }
void dotEdge(DNSName zone, string type1, DNSName name1, string tag1, string type2, DNSName name2, string tag2, string color="");
if(!nsec3)
continue;
+ if (g_maxNSEC3Iterations && nsec3->d_iterations > g_maxNSEC3Iterations) {
+ return INSECURE;
+ }
+
string h = hashQNameWithSalt(nsec3->d_salt, nsec3->d_iterations, qname);
// cerr<<"Salt length: "<<nsec3->d_salt.length()<<", iterations: "<<nsec3->d_iterations<<", hashed: "<<qname<<endl;
LOG("\tquery hash: "<<toBase32Hex(h)<<endl);
if(!nsec3)
continue;
+ if (g_maxNSEC3Iterations && nsec3->d_iterations > g_maxNSEC3Iterations) {
+ return INSECURE;
+ }
+
string h = hashQNameWithSalt(nsec3->d_salt, nsec3->d_iterations, sname);
string beginHash=fromBase32Hex(v.first.first.getRawLabels()[0]);
auto nsec3 = std::dynamic_pointer_cast<NSEC3RecordContent>(r);
if(!nsec3)
continue;
+ if (g_maxNSEC3Iterations && nsec3->d_iterations > g_maxNSEC3Iterations) {
+ return INSECURE;
+ }
string h = hashQNameWithSalt(nsec3->d_salt, nsec3->d_iterations, nextCloser);
string beginHash=fromBase32Hex(v.first.first.getRawLabels()[0]);
#include "dnsrecords.hh"
extern bool g_dnssecLOG;
+extern uint16_t g_maxNSEC3Iterations;
// 4033 5
enum vState { Indeterminate, Bogus, Insecure, Secure, NTA, TA };