Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns/bind: enable DNSSEC zone signing #4258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,23 @@
<type>text</type>
<help>Set the DNS server hosting this file. This should usually be the FQDN of your firewall where the BIND plugin is installed.</help>
</field>
<field>
<type>header</type>
<label>DNSSEC</label>
<advanced>true</advanced>
</field>
<field>
<id>domain.dnssecpolicy</id>
<label>DNSSEC policy</label>
<type>dropdown</type>
<advanced>true</advanced>
<help>Enable the default or a custom 'dnssec-policy' for this zone. The custom 'dnssec-policy' has to be configured in the 'General' tab.</help>
</field>
<field>
<id>domain.inlinesigning</id>
<label>DNSSEC inline-signing</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>Sign this zone completely transparently. 'inline-signing' must be enabled explicitly for zones using 'dnssec-policy' without a configured 'allow-update' or 'update-policy'. See https://kb.isc.org/docs/dnssec-policy-requires-dynamic-dns-or-inline-signing</help>
</field>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,16 @@
<advanced>true</advanced>
<help>The base64-encoded RNDC key. This requires a restart of the Bind Service.</help>
</field>
<field>
<type>header</type>
<label>DNSSEC</label>
<advanced>true</advanced>
</field>
<field>
<id>general.dnssecpolicycustom</id>
<label>custom DNSSEC policy</label>
<type>textbox</type>
<advanced>true</advanced>
<help><![CDATA[Configure <code>dnssec-policy "custom" { ... };</code> with the parameters specified within this field. This 'dnssec-policy' can be assigned to primary zones.<br>Example:<br><code>keys {</code><br><code>&nbsp;&nbsp;ksk key-directory lifetime unlimited algorithm 15;</code><br><code>&nbsp;&nbsp;zsk key-directory lifetime P60D algorithm 15;</code><br><code>};</code><br><code>nsec3param;</code>]]></help>
</field>
</form>
11 changes: 11 additions & 0 deletions dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@
<Default>opnsense.localdomain</Default>
<Required>Y</Required>
</dnsserver>
<dnssecpolicy type="OptionField">
<Required>N</Required>
<OptionValues>
<default>default</default>
<custom>custom</custom>
</OptionValues>
</dnssecpolicy>
<inlinesigning type="BooleanField">
<Default>0</Default>
<Required>N</Required>
</inlinesigning>
</domain>
</domains>
</items>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,8 @@
<Required>Y</Required>
<Default>VxtIzJevSQXqnr7h2qerrcwjnZlMWSGGFBndKeNIDfw=</Default>
</rndcsecret>
<dnssecpolicycustom type="TextField">
<Required>N</Required>
</dnssecpolicycustom>
</items>
</model>
12 changes: 12 additions & 0 deletions dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ acl "{{ acl_list.name }}" { {{ acl_list.networks.replace(',', '; ') }}; };
{% endfor %}
{% endif %}

{% if helpers.exists('OPNsense.bind.general.dnssecpolicycustom') and OPNsense.bind.general.dnssecpolicycustom != '' %}
dnssec-policy "custom" {
{{ OPNsense.bind.general.dnssecpolicycustom }}
};
{% endif %}

options {

directory "/usr/local/etc/namedb/working";
Expand Down Expand Up @@ -164,6 +170,12 @@ zone "{{ domain.domainname }}" {
{% else %}
file "/usr/local/etc/namedb/primary/{{ domain.domainname }}.db";
{% endif %}
{% if domain.dnssecpolicy is defined and domain.type != 'secondary' %}
dnssec-policy "{{ domain.dnssecpolicy }}";
{% endif %}
{% if domain.inlinesigning is defined and domain.inlinesigning == "1" and domain.type != 'secondary' %}
inline-signing yes;
{% endif %}
{% if domain.allowtransfer is defined or (domain.allowrndctransfer is defined and domain.allowrndctransfer == "1") %}
allow-transfer {
{% if domain.allowrndctransfer is defined and domain.allowrndctransfer == "1" %}
Expand Down