string s_pidfname;
unsigned int g_numThreads;
uint16_t g_outgoingEDNSBufsize;
+bool g_logRPZChanges{false};
#define LOCAL_NETS "127.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fc00::/7, fe80::/10"
// Bad Nets taken from both:
g_latencyStatSize=::arg().asNum("latency-statistic-size");
g_logCommonErrors=::arg().mustDo("log-common-errors");
+ g_logRPZChanges = ::arg().mustDo("log-rpz-changes");
g_anyToTcp = ::arg().mustDo("any-to-tcp");
g_udpTruncationThreshold = ::arg().asNum("udp-truncation-threshold");
::arg().set("cpu-map", "Thread to CPU mapping, space separated thread-id=cpu1,cpu2..cpuN pairs")="";
+ ::arg().setSwitch("log-rpz-changes", "Log additions and removals to RPZ zones at Info level")="no";
+
::arg().setCmd("help","Provide a helpful message");
::arg().setCmd("version","Print version string");
::arg().setCmd("config","Output blank configuration");
Some DNS errors occur rather frequently and are no cause for alarm.
+``log-rpz-changes``
+---------------------
+.. versionadded:: 4.1.0
+
+- Boolean
+- Default: no
+
+Log additions and removals to RPZ zones at Info (6) level instead of Debug (7).
+
.. _setting-logging-facility:
``logging-facility``
}
else {
totremove++;
- L<<Logger::Debug<<"Had removal of "<<rr.d_name<<endl;
+ L<<(g_logRPZChanges ? Logger::Info : Logger::Debug)<<"Had removal of "<<rr.d_name<<" from RPZ zone "<<zoneName.toStringNoDot()<<endl;
RPZRecordToPolicy(rr, newZone, false, defpol, maxTTL);
}
}
}
else {
totadd++;
- L<<Logger::Debug<<"Had addition of "<<rr.d_name<<endl;
+ L<<(g_logRPZChanges ? Logger::Info : Logger::Debug)<<"Had addition of "<<rr.d_name<<" to RPZ zone "<<zoneName.toStringNoDot()<<endl;
RPZRecordToPolicy(rr, newZone, true, defpol, maxTTL);
}
}
#include <string>
#include "dnsrecords.hh"
+extern bool g_logRPZChanges;
+
void loadRPZFromFile(const std::string& fname, std::shared_ptr<DNSFilterEngine::Zone> zone, boost::optional<DNSFilterEngine::Policy> defpol, uint32_t maxTTL);
std::shared_ptr<SOARecordContent> loadRPZFromServer(const ComboAddress& master, const DNSName& zoneName, std::shared_ptr<DNSFilterEngine::Zone> zone, boost::optional<DNSFilterEngine::Policy> defpol, uint32_t maxTTL, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress);
void RPZRecordToPolicy(const DNSRecord& dr, std::shared_ptr<DNSFilterEngine::Zone> zone, bool addOrRemove, boost::optional<DNSFilterEngine::Policy> defpol, uint32_t maxTTL);