diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 864f2cc0f..f9ffd920c 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog * Cleanup/Fix the Master/Slave domain dialogs (contributed by Robbert Rijkse) * Revamp the logging page with proper columns (contributed by Robbert Rijkse) +* Add UI for RNDC Key configuration (contributed by Robbert Rijkse) * Update base to BIND 9.18 1.24 diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php index 132322f19..f2bdcac42 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php @@ -34,6 +34,7 @@ class GeneralController extends \OPNsense\Base\IndexController { $this->view->generalForm = $this->getForm("general"); $this->view->dnsblForm = $this->getForm("dnsbl"); + $this->view->rndcKeyForm = $this->getForm("rndcKey"); $this->view->formDialogEditBindAcl = $this->getForm("dialogEditBindAcl"); $this->view->formDialogEditBindMasterDomain = $this->getForm("dialogEditBindMasterDomain"); $this->view->formDialogEditBindSlaveDomain = $this->getForm("dialogEditBindSlaveDomain"); diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/rndcKey.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/rndcKey.xml new file mode 100644 index 000000000..48f2fc43d --- /dev/null +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/rndcKey.xml @@ -0,0 +1,14 @@ +
+ + general.rndcalgo + + dropdown + Set the authentication algorithm for the RNDC key. + + + general.rndcsecret + + text + The base64-encoded RNDC key. + +
diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index d9f73fc68..7773989e0 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -1,7 +1,7 @@ //OPNsense/bind/general BIND configuration - 1.0.8 + 1.0.9 0 @@ -143,5 +143,21 @@ Y Y + + Y + hmac-sha256 + + HMAC-SHA512 + HMAC-SHA384 + HMAC-SHA256 + HMAC-SHA224 + HMAC-SHA1 + HMAC-MD5 + + + + Y + VxtIzJevSQXqnr7h2qerrcwjnZlMWSGGFBndKeNIDfw= + diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 5a8202969..16071491d 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('General') }}
  • {{ lang._('DNSBL') }}
  • {{ lang._('ACLs') }}
  • +
  • {{ lang._('Keys') }}
  • {{ lang._('Master Zones') }}
  • {{ lang._('Slave Zones') }}
  • @@ -83,6 +84,21 @@ POSSIBILITY OF SUCH DAMAGE.

    + +
    +
    +
    +

    {{ lang._('RNDC Key') }}

    +
    + {{ partial("layout_partials/base_form",['fields':rndcKeyForm,'id':'frm_general_settings'])}} +
    +
    +
    + +
    + Note: Bind will be restarted when you Save, this is required when the RNDC key changes. +

    +
    @@ -323,6 +339,13 @@ $( document ).ready(function() { }); }); + $("#saveRestartAct_rndckey").click(function(){ + $("#saveRestartAct_rndckey_progress").addClass("fa fa-spinner fa-pulse"); + ajaxCall("/api/bind/service/restart", {}, function(data,status) { + updateServiceControlUI('bind'); + $("#saveRestartAct_rndckey_progress").removeClass("fa fa-spinner fa-pulse"); + }); + }); $(".saveAct_domain").click(function(){ $(".saveAct_domain_progress").addClass("fa fa-spinner fa-pulse"); ajaxCall("/api/bind/service/reconfigure", {}, function(data,status) { diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index b0e2efc38..028e066f8 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -88,14 +88,16 @@ options { {% endif %} }; +{% if helpers.exists('OPNsense.bind.general.rndcalgo') and helpers.exists('OPNsense.bind.general.rndcsecret') %} key "rndc-key" { - algorithm hmac-sha256; - secret "VxtIzJevSQXqnr7h2qerrcwjnZlMWSGGFBndKeNIDfw="; + algorithm "{{ OPNsense.bind.general.rndcalgo }}"; + secret "{{ OPNsense.bind.general.rndcsecret }}"; }; controls { inet 127.0.0.1 port 9530 allow { 127.0.0.1; } keys { "rndc-key"; }; }; +{% endif %} zone "." { type hint; file "/usr/local/etc/namedb/named.root"; }; diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/rndc.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/rndc.conf index ec9896739..d4800520f 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/rndc.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/rndc.conf @@ -1,6 +1,7 @@ +{% if helpers.exists('OPNsense.bind.general.rndcalgo') and helpers.exists('OPNsense.bind.general.rndcsecret') %} key "rndc-key" { - algorithm hmac-sha256; - secret "VxtIzJevSQXqnr7h2qerrcwjnZlMWSGGFBndKeNIDfw="; + algorithm "{{ OPNsense.bind.general.rndcalgo }}"; + secret "{{ OPNsense.bind.general.rndcsecret }}"; }; options { @@ -8,3 +9,4 @@ options { default-server 127.0.0.1; default-port 9530; }; +{% endif %}