dns/bind: Implement filter-aaaa (#1722)

This commit is contained in:
Zane Chua
2022-02-03 08:31:47 +01:00
committed by GitHub
parent a2c07f5ec4
commit 1415dcccc2
3 changed files with 47 additions and 0 deletions
@@ -69,6 +69,26 @@
<allownew>true</allownew>
<help>Set one or more hosts to send your DNS queries if the request is unknown.</help>
</field>
<field>
<id>general.filteraaaav4</id>
<label>Enable filter-aaaa on IPv4 Clients</label>
<type>checkbox</type>
<help>This will filter AAAA records on IPv4 Clients</help>
</field>
<field>
<id>general.filteraaaav6</id>
<label>Enable filter-aaaa on IPv6 Clients</label>
<type>checkbox</type>
<help>This will filter AAAA records on IPv6 Clients</help>
</field>
<field>
<id>general.filteraaaaacl</id>
<label>ACl for filter-aaaa</label>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Specifies a list of client addresses for which AAAA filtering is to be applied.</help>
</field>
<field>
<id>general.logsize</id>
<label>Logsize in MB</label>
@@ -56,6 +56,19 @@
<Required>N</Required>
<asList>Y</asList>
</forwarders>
<filteraaaav4 type="BooleanField">
<default>0</default>
<Required>Y</Required>
</filteraaaav4>
<filteraaaav6 type="BooleanField">
<default>0</default>
<Required>Y</Required>
</filteraaaav6>
<filteraaaaacl type="NetworkField">
<FieldSeparator>,</FieldSeparator>
<Required>N</Required>
<asList>Y</asList>
</filteraaaaacl>
<logsize type="IntegerField">
<default>5</default>
<Required>Y</Required>
@@ -193,3 +193,17 @@ logging {
category lame-servers { null; };
};
{% endif %}
{% if helpers.exists('OPNsense.bind.general.filteraaaav4') and OPNsense.bind.general.filteraaaav4 == '1' or helpers.exists('OPNsense.bind.general.filteraaaav6') and OPNsense.bind.general.filteraaaav6 == '1' %}
plugin query "/usr/local/lib/named/filter-aaaa.so" {
{% if helpers.exists('OPNsense.bind.general.filteraaaav4') and OPNsense.bind.general.filteraaaav4 == '1' %}
filter-aaaa-on-v4 yes;
{% endif %}
{% if helpers.exists('OPNsense.bind.general.filteraaaav6') and OPNsense.bind.general.filteraaaav6 == '1' %}
filter-aaaa-on-v6 yes;
{% endif %}
{% if helpers.exists('OPNsense.bind.general.filteraaaaacl') and OPNsense.bind.general.filteraaaaacl != '' %}
filter-aaaa { {{ OPNsense.bind.general.filteraaaaacl.replace(',', '; ') }}; };
{% endif %}
};
{% endif %}