Plus corrections from review.
#include "namespaces.hh"
#include "dnsrecords.hh"
-// Names below are RPZ Actions and end with a dot (execpt "Local Data")
+// Names below are RPZ Actions and end with a dot (except "Local Data")
static const std::string rpzDropName("rpz-drop."),
rpzTruncateName("rpz-tcp-only."),
rpzNoActionName("rpz-passthru."),
iter = polmap.find(g_wildcarddnsname+s);
if(iter != polmap.end()) {
pol=iter->second;
- pol.d_trigger = g_wildcarddnsname+s;
+ pol.d_trigger = iter->first;
pol.d_hit = qname.toStringNoDot();
return true;
}
++g_stats.policyResults[appliedPolicy.d_kind];
}
+ if (sr.doLog() && appliedPolicy.d_type != DNSFilterEngine::PolicyType::None) {
+ g_log << Logger::Warning << dc->d_mdp.d_qname << "|" << QType(dc->d_mdp.d_qtype).getName() << appliedPolicy.getLogString() << endl;
+ }
+
switch (appliedPolicy.d_kind) {
case DNSFilterEngine::PolicyKind::NoAction:
goto haveAnswer;
}
else if (policyResult == PolicyResult::Drop) {
- if (sr.doLog()) {
- g_log << Logger::Warning << dc->d_mdp.d_qname << "|" << QType(dc->d_mdp.d_qtype).getName() << appliedPolicy.getLogString() << endl;
- }
- g_stats.policyDrops++;
return;
}
}
}
}
}
- if (sr.doLog() && appliedPolicy.d_type != DNSFilterEngine::PolicyType::None) {
- g_log << Logger::Warning << dc->d_mdp.d_qname << "|" << QType(dc->d_mdp.d_qtype).getName() << appliedPolicy.getLogString() << endl;
- }
if(res == -1) {
pw.getHeader()->rcode=RCode::ServFail;
The TTL in seconds for the ``pdns.policyactions.Custom`` response
+ .. attribute:: DNSQuestion.appliedPolicy.policyTrigger
+
+ The trigger (left-hand) part of the RPZ rule that was matched
+
+ .. attribute:: DNSQuestion.appliedPolicy.policyHit
+
+ The value that was matched. This is a string representing a name or an address.
+
.. attribute:: DNSQuestion.wantsRPZ
A boolean that indicates the use of the Policy Engine.
++g_stats.policyResults[d_appliedPolicy.d_kind];
}
+ if (d_appliedPolicy.d_type != DNSFilterEngine::PolicyType::None) {
+ LOG(prefix << qname << "|" << qtype.getName() << d_appliedPolicy.getLogString() << endl);
+ }
+
switch (d_appliedPolicy.d_kind) {
case DNSFilterEngine::PolicyKind::NoAction: