]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Introduce new DNSSEC tool dnssec-ksr
authorMatthijs Mekking <matthijs@isc.org>
Mon, 7 Aug 2023 08:58:05 +0000 (10:58 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 19 Apr 2024 08:41:04 +0000 (10:41 +0200)
Introduce a new DNSSEC tool, dnssec-ksr, for creating signed key
response (SKR) files, given one or more key signing requests (KSRs).

For now it is just a dummy tool, but the future purpose of this utility
is to pregenerate ZSKs and signed RRsets for DNSKEY, CDNSKEY, and CDS
for a given period that a KSK is to be offline.

.gitignore
bin/dnssec/.gitignore
bin/dnssec/Makefile.am
bin/dnssec/dnssec-ksr.c [new file with mode: 0644]
bin/dnssec/dnssec-ksr.rst [new file with mode: 0644]
bin/tests/system/conf.sh.in
doc/arm/manpages.rst
doc/man/Makefile.am
doc/man/conf.py
doc/man/dnssec-ksr.rst [new file with mode: 0644]

index 3edbde71e7e5df9fd71b4147343ea8d66ec4d8e0..242bd0efdbae4d9893e36f0c1560ab2afde0c905 100644 (file)
@@ -75,6 +75,7 @@ doc/man/dnssec-importkey.8in
 doc/man/dnssec-keyfromlabel.8in
 doc/man/dnssec-keygen.8in
 doc/man/dnssec-keymgr.8in
+doc/man/dnssec-ksr.8in
 doc/man/dnssec-revoke.8in
 doc/man/dnssec-settime.8in
 doc/man/dnssec-signzone.8in
index 9d50f6cc8c5a8a39f7c12a2b505066f8ce59daa4..c7917cdbbeddf90a1869fbf9155bc94945801712 100644 (file)
@@ -2,6 +2,7 @@ dnssec-cds
 dnssec-dsfromkey
 dnssec-keyfromlabel
 dnssec-keygen
+dnssec-ksr
 dnssec-makekeyset
 dnssec-revoke
 dnssec-settime
index 0017705a0d5881b9458216abf5ac84081caee4e5..f3ecdffb0e40660a2d5d1830651f3338bf013640 100644 (file)
@@ -21,6 +21,7 @@ bin_PROGRAMS = \
        dnssec-importkey        \
        dnssec-keyfromlabel     \
        dnssec-keygen           \
+       dnssec-ksr              \
        dnssec-revoke           \
        dnssec-settime          \
        dnssec-signzone         \
diff --git a/bin/dnssec/dnssec-ksr.c b/bin/dnssec/dnssec-ksr.c
new file mode 100644 (file)
index 0000000..5efdebb
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+/*! \file */
+
+#include <stdio.h>
+
+#include <isc/commandline.h>
+#include <isc/mem.h>
+
+#include "dnssectool.h"
+
+const char *program = "dnssec-ksr";
+
+/*
+ * Infrastructure
+ */
+static isc_log_t *lctx = NULL;
+static isc_mem_t *mctx = NULL;
+
+static void
+usage(int ret) {
+       fprintf(stderr, "Usage:\n");
+       fprintf(stderr, "    %s options [options]\n", program);
+       fprintf(stderr, "Version: %s\n", PACKAGE_VERSION);
+       fprintf(stderr, "Options:\n"
+                       "    -h: print usage and exit\n"
+                       "    -v <level>: set verbosity level\n"
+                       "    -V: print version information\n");
+       exit(ret);
+}
+
+int
+main(int argc, char *argv[]) {
+       int ch;
+       char *endp;
+
+       isc_mem_create(&mctx);
+
+       isc_commandline_errprint = false;
+
+#define OPTIONS "hv:V"
+       while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
+               switch (ch) {
+               case 'h':
+                       usage(0);
+                       break;
+               case 'V':
+                       version(program);
+                       break;
+               case 'v':
+                       verbose = strtoul(isc_commandline_argument, &endp, 0);
+                       if (*endp != '\0') {
+                               fatal("-v must be followed by a number");
+                       }
+                       break;
+               default:
+                       usage(1);
+                       break;
+               }
+       }
+       argv += isc_commandline_index;
+       argc -= isc_commandline_index;
+
+       if (argc != 0) {
+               usage(1);
+       }
+
+       setup_logging(mctx, &lctx);
+
+       vbprintf(verbose, "KSR: Hello, world.\n");
+
+       exit(0);
+}
diff --git a/bin/dnssec/dnssec-ksr.rst b/bin/dnssec/dnssec-ksr.rst
new file mode 100644 (file)
index 0000000..16daae4
--- /dev/null
@@ -0,0 +1,67 @@
+.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+..
+.. SPDX-License-Identifier: MPL-2.0
+..
+.. This Source Code Form is subject to the terms of the Mozilla Public
+.. License, v. 2.0.  If a copy of the MPL was not distributed with this
+.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
+..
+.. See the COPYRIGHT file distributed with this work for additional
+.. information regarding copyright ownership.
+
+.. highlight: console
+
+.. iscman:: dnssec-ksr
+.. program:: dnssec-ksr
+.. _man_dnssec-ksr:
+
+dnssec-ksr - Create signed key response (SKR) files for offline KSK setups
+--------------------------------------------------------------------------
+
+Synopsis
+~~~~~~~~
+
+:program:`dnssec-ksr [**-h**]` [**-V**] [**-v** level]
+
+Description
+~~~~~~~~~~~
+
+The :program:`dnssec-ksr` command creates signed key responses (SKRs) that can
+be loaded by a DNS authoritative server. An SKR is a RRset of type DNSKEY,
+CDNSKEY, or CDS, with signatures from a key that is typically offline during
+normal operation.
+
+Options
+~~~~~~~
+
+.. option:: -h
+
+   This option prints a short summary of the options and arguments to
+   :program:`dnssec-ksr`.
+
+.. option:: -V
+
+   This option prints version information.
+
+.. option:: -v level
+
+   This option sets the debugging level. Level 1 is intended to be usefully
+   verbose for general users; higher levels are intended for developers.
+
+Exit Status
+~~~~~~~~~~~
+
+The :program:`dnssec-ksr` command exits 0 on success, or non-zero if an error
+occurred.
+
+Examples
+~~~~~~~~
+
+To do.
+
+See Also
+~~~~~~~~
+
+:iscman:`dnssec-keygen(8) <dnssec-keygen>`,
+:iscman:`dnssec-signzone(8) <dnssec-signzone>`,
+BIND 9 Administrator Reference Manual.
index f09221ae5dba076a299b34c64ff8e5a2b6b01395..7b5db05baf2b912b5613956175925f3bf9f1e648 100644 (file)
@@ -42,6 +42,7 @@ export IMPORTKEY=$TOP_BUILDDIR/bin/dnssec/dnssec-importkey
 export JOURNALPRINT=$TOP_BUILDDIR/bin/tools/named-journalprint
 export KEYFRLAB=$TOP_BUILDDIR/bin/dnssec/dnssec-keyfromlabel
 export KEYGEN=$TOP_BUILDDIR/bin/dnssec/dnssec-keygen
+export KSR=$TOP_BUILDDIR/bin/dnssec/dnssec-ksr
 export MDIG=$TOP_BUILDDIR/bin/tools/mdig
 export NAMED=$TOP_BUILDDIR/bin/named/named
 export NSEC3HASH=$TOP_BUILDDIR/bin/tools/nsec3hash
index a833bf645204df247370e915a7b358ff09e2b6e4..1a3847176ae310385b298ce6a1b46a7a2d6bb3a9 100644 (file)
@@ -23,6 +23,7 @@ Manual Pages
 .. include:: ../../bin/dnssec/dnssec-importkey.rst
 .. include:: ../../bin/dnssec/dnssec-keyfromlabel.rst
 .. include:: ../../bin/dnssec/dnssec-keygen.rst
+.. include:: ../../bin/dnssec/dnssec-ksr.rst
 .. include:: ../../bin/dnssec/dnssec-revoke.rst
 .. include:: ../../bin/dnssec/dnssec-settime.rst
 .. include:: ../../bin/dnssec/dnssec-signzone.rst
index 2590e20da6d5d8196ee5c245c01a679e83e6d5a2..37d29ed17f406d54dade338fcc88f411f5a1e2a5 100644 (file)
@@ -11,6 +11,7 @@ MANPAGES_RST =                                \
        dnssec-importkey.rst            \
        dnssec-keyfromlabel.rst         \
        dnssec-keygen.rst               \
+       dnssec-ksr.rst                  \
        dnssec-revoke.rst               \
        dnssec-settime.rst              \
        dnssec-signzone.rst             \
@@ -51,6 +52,7 @@ MANPAGES_RST =                                \
        ../../bin/dnssec/dnssec-importkey.rst \
        ../../bin/dnssec/dnssec-keyfromlabel.rst \
        ../../bin/dnssec/dnssec-keygen.rst \
+       ../../bin/dnssec/dnssec-ksr.rst \
        ../../bin/dnssec/dnssec-revoke.rst \
        ../../bin/dnssec/dnssec-settime.rst \
        ../../bin/dnssec/dnssec-signzone.rst \
@@ -87,6 +89,7 @@ man_MANS =                            \
        dnssec-importkey.1              \
        dnssec-keyfromlabel.1           \
        dnssec-keygen.1                 \
+       dnssec-ksr.1                    \
        dnssec-revoke.1                 \
        dnssec-settime.1                \
        dnssec-signzone.1               \
index bad518c1a502bf48af96aa4df1c61341079a88aa..3fc8d05ad84f7245ce4bedf2084b779475b3f85a 100644 (file)
@@ -100,6 +100,13 @@ man_pages = [
         1,
     ),
     ("dnssec-keygen", "dnssec-keygen", "DNSSEC key generation tool", author, 1),
+    (
+        "dnssec-ksr",
+        "dnssec-ksr",
+        "create signed key response (SKR) files for offline KSK setups",
+        author,
+        1,
+    ),
     (
         "dnssec-revoke",
         "dnssec-revoke",
diff --git a/doc/man/dnssec-ksr.rst b/doc/man/dnssec-ksr.rst
new file mode 100644 (file)
index 0000000..0ac2248
--- /dev/null
@@ -0,0 +1,14 @@
+.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+..
+.. SPDX-License-Identifier: MPL-2.0
+..
+.. This Source Code Form is subject to the terms of the Mozilla Public
+.. License, v. 2.0.  If a copy of the MPL was not distributed with this
+.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
+..
+.. See the COPYRIGHT file distributed with this work for additional
+.. information regarding copyright ownership.
+
+:orphan:
+
+.. include:: ../../bin/dnssec/dnssec-ksr.rst