You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unbound 1.15.0: A rpz-passthru action is not ending RPZ zone processing #628
Describe the bug
It seems that even thought "hiting" a rpz-passthru in a RPZ zone, unbound continues to process matching against the after-coming RPZ zones (removing the possibility to override entries in after-coming RPZ zones):
Feb 15 12:49:08 punoqun unbound: [31724:2] info: rpz: applied [wl.zone] api.zoomeye.org. rpz-passthru ::1@48753 api.zoomeye.org. A IN
Feb 15 12:49:08 punoqun unbound: [31724:2] info: RPZ applied [zone3.misc.rpz] 168.80.0.0/15 rpz-nxdomain ::1@48753 api.zoomeye.org. A IN
To reproduce
Run unbound with simple RPZ configuration:
rpz:
name: "wl.zone"
zonefile: "/etc/unbound/rpz/wl.zone"
#rpz-action-override: passthru # this option doesn't make a difference in this case
rpz-log: yes
rpz-log-name: wl.zone
rpz:
name: "zone3.misc.rpz.switch.ch."
zonefile: "/etc/unbound/rpz/zone3.misc.rpz.switch.ch.zone"
master: localhost@5353
rpz-action-override: nxdomain # this is needed as default action points at a web page
rpz-log: yes
rpz-log-name: zone3.misc.rpz
Expected behavior
A rpz-passthru hit should end all further RPZ zone processing.
(However this is a tricky one as the QNAME is whitelisted but the hit is on the response IP...)
changed the title [-]unbound 1.15.0: A rpz-passthru is not ending RPZ zone processing[/-][+]unbound 1.15.0: A rpz-passthru action is not ending RPZ zone processing[/+]on Feb 15, 2022
Thanks for the report, fixed it! The issue was that the passthru would work correctly, also between RPZ zones, but only within a particular callback. It needed to be kept stored in a member variable to be used in subsequent callbacks, this is what caused the failure with another RPZ action applied at the later callback in the problem you found.
host:~$ host api.zoomeye.org
api.zoomeye.org is an alias for 15dcd082f081e272.cdn.jiashule.com.
15dcd082f081e272.cdn.jiashule.com has address 160.116.186.18
15dcd082f081e272.cdn.jiashule.com has address 118.143.194.182
host:~$ host 15dcd082f081e272.cdn.jiashule.com.
15dcd082f081e272.cdn.jiashule.com has address 160.116.186.18
15dcd082f081e272.cdn.jiashule.com has address 168.80.171.96
host:~$ host 15dcd082f081e272.cdn.jiashule.com.
15dcd082f081e272.cdn.jiashule.com has address 160.116.186.18
15dcd082f081e272.cdn.jiashule.com has address 118.143.194.182
I tried to add the CNAME to wl.zone too, but the result becomes the same
Feb 15 15:14:45 punoqun unbound: [31724:0] info: rpz: applied [wl.zone] 15dcd082f081e272.cdn.jiashule.com. rpz-passthru ::1@44696 15dcd082f081e272.cdn.jiashule.com. A IN
Feb 15 15:14:45 punoqun unbound: [31724:0] info: RPZ applied [zone3.misc.rpz] 168.80.0.0/15 rpz-nxdomain ::1@44696 15dcd082f081e272.cdn.jiashule.com. A IN
So I reproduced it with a different code path, and the exact configuration that you used missed out. Fixed that in the commit and now it works also for qname trigger from the rpz localzone type. Thanks for the detailed report! I needed to know the exact rpz triggers that did not set the passthru correctly.
Activity
[-]unbound 1.15.0: A rpz-passthru is not ending RPZ zone processing[/-][+]unbound 1.15.0: A rpz-passthru action is not ending RPZ zone processing[/+]wcawijngaards commentedon Feb 15, 2022
Thanks for the report, fixed it! The issue was that the passthru would work correctly, also between RPZ zones, but only within a particular callback. It needed to be kept stored in a member variable to be used in subsequent callbacks, this is what caused the failure with another RPZ action applied at the later callback in the problem you found.
pettai commentedon Feb 15, 2022
I looked a little more on the blocked domain:
I tried to add the CNAME to wl.zone too, but the result becomes the same
pettai commentedon Feb 15, 2022
Hmm... I cherry-picked your patch and rebuilt unbound, but it still fails:
@wcawijngaards any Ideas?
- Fix for #628: fix rpz-passthru for qname trigger by localzone type.
wcawijngaards commentedon Feb 16, 2022
So I reproduced it with a different code path, and the exact configuration that you used missed out. Fixed that in the commit and now it works also for qname trigger from the rpz localzone type. Thanks for the detailed report! I needed to know the exact rpz triggers that did not set the passthru correctly.
- Fix NLnetLabs#628: A rpz-passthru action is not ending RPZ zone pro…
feat(arawi): rsshub.regulad.xyz keeps its public records on the LAN