dns/bind: enhance allow transfer (#1814)

* dns/bind: allow-transfer/query for slave zones

* dns/bind: global allow-transfer configuration
This commit is contained in:
Ang Iongchun
2021-04-15 13:48:10 +02:00
committed by GitHub
parent fddf85bef2
commit 3a163e8c94
4 changed files with 36 additions and 12 deletions
@@ -11,6 +11,18 @@
<type>text</type>
<help>Set the name for this zone. Both forward and reverse zones may be specified, i.e. example.com or 0.168.192.in-addr.arpa.</help>
</field>
<field>
<id>domain.allowtransfer</id>
<label>Allow Transfer</label>
<type>dropdown</type>
<help>Define an ACL where you allow which server can retrieve this zone.</help>
</field>
<field>
<id>domain.allowquery</id>
<label>Allow Query</label>
<type>dropdown</type>
<help>Define an ACL where you allow which client are allowed to query this zone.</help>
</field>
<field>
<id>domain.type</id>
<label>Type</label>
@@ -41,18 +53,6 @@
<type>header</type>
<style>zone_type zone_type_master</style>
</field>
<field>
<id>domain.allowtransfer</id>
<label>Allow Transfer</label>
<type>dropdown</type>
<help>Define an ACL where you allow which server can retrieve this zone. If this value is empty, domain transfers from everywhere are allowed.</help>
</field>
<field>
<id>domain.allowquery</id>
<label>Allow Query</label>
<type>dropdown</type>
<help>Define an ACL where you allow which client are allowed to query this zone.</help>
</field>
<field>
<id>domain.ttl</id>
<label>TTL</label>
@@ -73,6 +73,12 @@
<type>dropdown</type>
<help>Define an ACL where you allow which clients can resolve via this service. Usually use your local LAN.</help>
</field>
<field>
<id>general.allowtransfer</id>
<label>Allow Transfer</label>
<type>dropdown</type>
<help>Define an ACL where you allow which server can retrieve zones.</help>
</field>
<field>
<id>general.dnssecvalidation</id>
<label>DNSSEC Validation</label>
@@ -72,6 +72,17 @@
<Required>N</Required>
<ValidationMessage>Choose an ACL.</ValidationMessage>
</recursion>
<allowtransfer type="ModelRelationField">
<Model>
<template>
<source>OPNsense.Bind.Acl</source>
<items>acls.acl</items>
<display>name</display>
</template>
</Model>
<Multiple>N</Multiple>
<Required>N</Required>
</allowtransfer>
<dnssecvalidation type="OptionField">
<OptionValues>
<no>No</no>
@@ -46,6 +46,13 @@ options {
{% endfor %}
{% endif %}
{% if helpers.exists('OPNsense.bind.general.allowtransfer') and OPNsense.bind.general.allowtransfer != '' %}
{% for list in helpers.toList('OPNsense.bind.general.allowtransfer') %}
{% set allowtransfer = helpers.getUUID(list) %}
allow-transfer { {{ allowtransfer.name }}; };
{% endfor %}
{% endif %}
{% if helpers.exists('OPNsense.bind.general.maxcachesize') and OPNsense.bind.general.maxcachesize != '' %}
max-cache-size {{ OPNsense.bind.general.maxcachesize }}%;
{% endif %}