]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Update the documentation to better describe our RPZ behaviour 9414/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 26 Aug 2020 14:39:00 +0000 (16:39 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 26 Aug 2020 14:39:00 +0000 (16:39 +0200)
pdns/recursordist/docs/lua-config/rpz.rst

index 1e352468356fa2cf89c3b1238a3279f83085f581..73d7475642c5ff4aa337dead2ba986b5bc4e5bd5 100644 (file)
@@ -21,7 +21,9 @@ It would stop as soon as a match was found and apply the requested decision imme
 
 Since 4.4.0 the behaviour is a bit different, to better follow the RPZ specifications. The source address of the client is still checked first. Then the normal resolution process starts and the initial qname as well as any CNAME part of the chain starting from the qname is checked against "QNAME" rules. "NSDNAME" and "NSIP" rules are still checked during the remaining part of the process, and "Response IP Address" rules are applied to the final records in the end.
 This matches the precedence rules from the RPZ specifications that specify that "A policy rule match which occurs at an earlier stage of resolution is preferred to a policy rule match which occurs at a later stage".
-For compatibility reasons, 4.4.0 still evaluates policy rules of higher order after a "passthru", even though the section 5.1 of the RPZ specifications seems to deny that behaviour: "Recall that only one policy rule, from among all those matched at all stages of resolving a CNAME or DNAME chain, can affect the final response; this is true even if the selected rule has a PASSTHRU action".
+
+For performance and privacy reasons, the order of evaluation does not strictly follow the one mandated by the RPZ specifications. In particular matching on the client IP and qname is done first before any processing, NS IP and NS DNAME matching is done when a nameserver is about to be sent a query, and matching on response records is done then a stage of resolution is done.
+The RPZ specifications mention that a match on the response record from a higher order RPZ should take precedence on a qname match from a lower one. Doing so would require delaying evaluation of RPZ policies until the whole resolution process has been completed, which would mean that queries might have been sent to a malicious nameserver already, in addition to performance issues.
 
 Note that "RPZ rules do not apply to synthetic data generated by using RPZ rules. For example, if RPZ supplies a CNAME pointing to a walled garden, RPZ policies will not be used while following that CNAME. If RPZ supplies local data giving a particular A record, RPZ policies will not apply to that response IP address", as stated in section 6.1 of the RPZ specifications.