What if I want to use a simpler walled garden triggered by IP address?


It's possible that the only thing you know about an attacker is the IP address block they will use for their "phishing" web servers. If you don't know what domain names they'll use and you don't know what name servers they'll use, but you do know that every one of their "phishing" web servers in a small block of IP addresses, then you can trigger on all answers which would include records in this address range using RPZ rules that look like the following example:

$ORIGIN rpz.example.com.          CNAME   drop.garden.example.com.
*.212.94.109.in-addr.arpa       CNAME   .
*.213.94.109.in-addr.arpa       CNAME   .
*.214.94.109.in-addr.arpa       CNAME   .
*.215.94.109.in-addr.arpa       CNAME   .

Here, if a truthful answer would include an A (address) RR (resource record) whose value was within the address block, then a sythentic answer will be sent instead of the truthful answer. Assuming the question is www.malicious.net, the synthetic answer will be:

www.malicious.net.              CNAME   drop.garden.example.com.
drop.garden.example.com.        A
This assumes that you've entered real DNS content (outside of your RPZ):

$ORIGIN example.com.
walled-garden                   A

In this example there is no "*" in the CNAME target name, and so the original query name will not be present in your walled garden web server's log file. This is an undesireable loss of information, and is shown here for example purposes only. See "When maintaining a DNS RPZ, how do I keep infected users in a walled garden?" for an example policy action that would preserve this information.

Other queries will also be affected by the above RPZ example rules, which are the PTR queries used in address-to-name translation. If your mail or web server receives a connection from an address in the example address block, they will perform a PTR (pointer) record lookup to find out domain name is associated with that IP address. This kind of address-to-name translation is usually used for diagnostic or logging purposes, but it is also common for e-mail servers to reject any e-mail from IP addresses which have no address-to-name translation. (Most mail from such IP addresses will be spam, so the lack of a PTR record here has some predictive value.)

By using the "force name-does-not-exist" policy trigger on all lookups in the PTR name space associated with an address block, you can give your servers a hint that these IP addresses are probably sending junk.

See also: Building DNS Firewalls with Response Policy Zones (RPZ)