On 12/2/26 01:41, Tom wrote:


On 12/2/26 06:10, Grant Taylor via bind-users wrote:
On 11/30/26 2:35 PM, Tom wrote:
Hi list

I'm searching a way for a view-based RPZ configuration.

I've got something like that working at home.

The common-zones.conf contains the zone configuration for all the configured response-policy zones above. Some zones (badrep.host.dtq) are quiet big and consumes some memory. The problem here is, that all zones (incl. the big ones) are loaded (needs to be loaded) multiple times, if the same zone is used in multiple views.

Yep.

I suggest you research the `in-view` option for the zones.

The "in-view"-option doesn't seem to work with response-policy zones.

The error is:
"response-policy zone 'rpz-a.example.ch' for view a is not a primary or secondary zone"

The configuration looks like this, where the "common-zones.conf" contains the zone as type "primary":

view common {
     match-clients { none; };
     include "/usr/local/etc/namedb/common-zones.conf";
};

view a {
         match-clients { 11.11.11.0/24; };
         recursion yes;
         zone "rpz-a.example.ch" { in-view common; };
         response-policy { zone "rpz-a.example.ch" policy nxdomain log yes;
        } qname-wait-recurse no max-policy-ttl 0 add-soa no break- dnssec yes nsip-wait-recurse no;
};


When removing the "response-policy"-option in the view, BIND starts as expected.



The idea being you load the zone once in the first view and then reference it in subsequent views.

Previously, it was not possible to manage shared response-policy zones.

I don't know what to make of that.

Is that now possible in some way? So that I can include the zone three times, but the zones are only loaded into memory once? Or that I can load the zone globally once and then reference it in the views?

That's my understanding of what `in-view` does.


Thanks for any hints on this.

:-)






Having just looked at this code for other reasons, you cannot use 'in-view' with zones used for RPZ. This is because updates to the zone (via DNS UPDATE or XFR) need to notify the RPZ manager that the zone has changed, so that the RPZ data structure can be rebuilt with the changes, and at present the zone object only stores one RPZ manager to be notified on changes.

Depending on the rest of your configuration, you might be able to move the common RPZs into a separate system, and have each view forward their queries to that system for RPZ processing. You would have to disable DNSSEC validation in the views and perform it only on the system with the RPZs, so you'd want to trust that the network between them can't easily be tampered with.

-Doug
--
Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from 
this list.

Reply via email to