Skip to content

Commit 1d15da3

Browse files
author
Till Brehm
committed
Merge branch '4561-add-algorithm-selection-for-dnssec' into 'stable-3.1'
Implements #4561: SHA256 (ECDSAP256SHA256) Algorithm for DNNSEC and Algorithm... Closes #4561 See merge request ispconfig/ispconfig3!1089
2 parents 48b9c11 + c0fb9a4 commit 1d15da3

32 files changed

+124
-28
lines changed

install/sql/incremental/upd_dev_collection.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,8 @@ ALTER TABLE `client` CHANGE `id_rsa` `id_rsa` TEXT CHARACTER SET utf8 COLLATE ut
6565

6666
ALTER TABLE `directive_snippets` ADD `update_sites` ENUM('y','n') NOT NULL DEFAULT 'n' ;
6767

68+
-- Add DNSSEC Algorithm setting
69+
ALTER TABLE `dns_soa` ADD `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') NULL DEFAULT NULL AFTER `dnssec_wanted`;
70+
UPDATE `dns_soa` SET `dnssec_algo` = 'NSEC3RSASHA1' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'Y';
71+
UPDATE `dns_soa` SET `dnssec_algo` = 'ECDSAP256SHA256' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'N';
72+
ALTER TABLE `dns_soa` CHANGE `dnssec_algo` `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'ECDSAP256SHA256';

install/sql/ispconfig3.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ CREATE TABLE `dns_soa` (
626626
`update_acl` varchar(255) default NULL,
627627
`dnssec_initialized` ENUM('Y','N') NOT NULL DEFAULT 'N',
628628
`dnssec_wanted` ENUM('Y','N') NOT NULL DEFAULT 'N',
629+
`dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') NOT NULL DEFAULT 'ECDSAP256SHA256',
629630
`dnssec_last_signed` BIGINT NOT NULL DEFAULT '0',
630631
`dnssec_info` TEXT NULL,
631632
PRIMARY KEY (`id`),
@@ -2501,7 +2502,7 @@ INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`, `eu`)
25012502
-- Dumping data for table `dns_template`
25022503
--
25032504

2504-
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
2505+
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\ndnssec_algo=ECDSAP256SHA256\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
25052506

25062507

25072508
-- --------------------------------------------------------

interface/web/dns/dns_soa_edit.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ function onSubmit() {
296296

297297
$this->dataRecord["xfer"] = preg_replace('/\s+/', '', $this->dataRecord["xfer"]);
298298
$this->dataRecord["also_notify"] = preg_replace('/\s+/', '', $this->dataRecord["also_notify"]);
299+
300+
if(isset($this->dataRecord['dnssec_wanted']) && $this->dataRecord['dnssec_wanted'] == 'Y' && $this->dataRecord['dnssec_algo'] == '') $this->dataRecord['dnssec_algo'] = 'ECDSAP256SHA256';
299301

300302
//* Check if a secondary zone with the same name already exists
301303
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_slave WHERE origin = ? AND server_id = ?", $this->dataRecord["origin"], $this->dataRecord["server_id"]);

interface/web/dns/dns_wizard.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
$section = '';
340340
$vars = array();
341341
$vars['xfer']='';
342+
$vars['dnssec_algo']='ECDSAP256SHA256';
342343
$dns_rr = array();
343344
foreach($tpl_rows as $row) {
344345
$row = trim($row);
@@ -398,6 +399,7 @@
398399
$xfer = $vars['xfer'];
399400
$also_notify = $vars['also_notify'];
400401
$update_acl = $vars['update_acl'];
402+
$dnssec_algo = $vars['dnssec_algo'];
401403
$serial = $app->validate_dns->increase_serial(0);
402404

403405
$insert_data = array(
@@ -420,7 +422,8 @@
420422
"xfer" => $xfer,
421423
"also_notify" => $also_notify,
422424
"update_acl" => $update_acl,
423-
"dnssec_wanted" => $enable_dnssec
425+
"dnssec_wanted" => $enable_dnssec,
426+
"dnssec_algo" => $dnssec_algo
424427
);
425428
$dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id');
426429
if($dns_soa_id > 0) $app->plugin->raiseEvent('dns:wizard:on_after_insert', $dns_soa_id);

interface/web/dns/form/dns_soa.tform.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,15 @@
276276
'default' => 'Y',
277277
'value' => array(0 => 'N', 1 => 'Y')
278278
),
279+
'dnssec_algo' => array (
280+
'datatype' => 'VARCHAR',
281+
'formtype' => 'CHECKBOXARRAY',
282+
'separator' => ',',
283+
'default' => 'ECDSAP256SHA256',
284+
'value' => array('NSEC3RSASHA1' => '7 (NSEC3RSASHA1)','ECDSAP256SHA256' => '13 (ECDSAP256SHA256)'),
285+
'width' => '30',
286+
'maxlength' => '255'
287+
),
279288
'dnssec_info' => array (
280289
'datatype' => 'TEXT',
281290
'formtype' => 'TEXTAREA',

interface/web/dns/lib/lang/ar_dns_soa.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ $wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be dele
4141
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
4242
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
4343
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
44+
$wb['dnssec_algo_txt'] = 'DNSSEC Algorithm';
4445
?>

interface/web/dns/lib/lang/bg_dns_soa.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ $wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be dele
4141
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
4242
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
4343
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
44+
$wb['dnssec_algo_txt'] = 'DNSSEC Algorithm';
4445
?>

interface/web/dns/lib/lang/br_dns_soa.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ $wb['ttl_range_error'] = 'Intervalo mínimo do TTL são 60 segundos.';
4141
$wb['error_not_allowed_server_id'] = 'O servidor selecionado não é permitido para esta conta.';
4242
$wb['soa_cannot_be_changed_txt'] = 'A zona (SOA) não pode ser alterada. Por favor, contate o administrador se deseja alterar esta zona.';
4343
$wb['configuration_error_txt'] = 'ERRO DE CONFIGURAÇÃO';
44+
$wb['dnssec_algo_txt'] = 'DNSSEC Algorithm';
4445
?>

interface/web/dns/lib/lang/ca_dns_soa.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ $wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be dele
4141
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
4242
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
4343
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
44+
$wb['dnssec_algo_txt'] = 'DNSSEC Algorithm';
4445
?>

interface/web/dns/lib/lang/cz_dns_soa.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ $wb['dnssec_wanted_info'] = 'Když deaktivujete DNSSEC klíče nebudou odstraně
4141
$wb['error_not_allowed_server_id'] = 'Vybraný server není pro tento účet povolen.';
4242
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
4343
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
44+
$wb['dnssec_algo_txt'] = 'DNSSEC Algorithm';
4445
?>

0 commit comments

Comments
 (0)