<div dir="ltr">It's not powerdns specific, but we have been using packetbeat for that sort of work.<div><br></div><div>Chris Stradtman</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 2, 2018 at 6:06 AM, Brian Candler <span dir="ltr"><<a href="mailto:b.candler@pobox.com" target="_blank">b.candler@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm investigating how to monitor DNS queries as a source of security information for breach detection.  In the case of client machines, we can check the queries against a blacklist of known C&C or malware domains; in the case of servers, we know they should only be making outbound connections to a very limited set of domains, so we can highlight any queries outside of a restricted whitelist.<br>
<br>
I notice that pdns-recursor has a log-dns-queries option, but the manual warns: "Only enable for debugging!"<br>
<br>
I therefore wonder what approaches other people have taken to this problem.  Is it possible to do this efficiently within pdns itself, e.g. using LUA [^1]?  Should I put dnsdist in front [^2]? Or should I be passively sniffing the DNS query packets?<br>
<br>
I am happy for a degree of local aggregation to be done: e.g. if the same client queries the same domain 100 times in a minute, then a single aggregate record rather than 100 separate logs is fine (probably preferable in fact).<br>
<br>
On searching I came across these projects:<br>
<br>
<a href="https://github.com/DNS-OARC/dsc" rel="noreferrer" target="_blank">https://github.com/DNS-OARC/ds<wbr>c</a><br>
<a href="https://github.com/DNS-OARC/PacketQ" rel="noreferrer" target="_blank">https://github.com/DNS-OARC/Pa<wbr>cketQ</a><br>
<a href="https://github.com/JustinAzoff/bro-pdns" rel="noreferrer" target="_blank">https://github.com/JustinAzoff<wbr>/bro-pdns</a><br>
<br>
Does anyone here have experience doing something similar, and what worked well?<br>
<br>
Thanks,<br>
<br>
Brian Candler.<br>
<br>
[^1] <a href="https://doc.powerdns.com/recursor/lua-config/protobuf.html" rel="noreferrer" target="_blank">https://doc.powerdns.com/recur<wbr>sor/lua-config/protobuf.html</a><br>
<br>
[^2] I found these:<br>
<br>
<a href="https://dnsdist.org/reference/protobuf.html" rel="noreferrer" target="_blank">https://dnsdist.org/reference/<wbr>protobuf.html</a><br>
<a href="https://dnsdist.org/reference/dnstap.html" rel="noreferrer" target="_blank">https://dnsdist.org/reference/<wbr>dnstap.html</a><br>
<br>
______________________________<wbr>_________________<br>
Pdns-users mailing list<br>
<a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.co<wbr>m</a><br>
<a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" rel="noreferrer" target="_blank">https://mailman.powerdns.com/m<wbr>ailman/listinfo/pdns-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br></div></div><div dir="ltr"><img src="http://geo.network/assets/img/logo.png"><br></div></div></div></div></div></div></div></div></div></div></div>
</div>