1KEYMGR(8) Knot DNS KEYMGR(8)
2
3
4
6 keymgr - Knot DNS key management utility
7
9 keymgr basic_option [parameters...]
10
11 keymgr [config_option config_storage] zone command argument...
12
14 The keymgr utility serves for manual key management in Knot DNS server.
15
16 Functions for DNSSEC keys and KASP (Key And Signature Policy) manage‐
17 ment are provided.
18
19 The DNSSEC and KASP configuration is stored in a so called KASP data‐
20 base. The database is backed by LMDB.
21
22 Basic options
23 -h, --help
24 Print the program help.
25
26 -V, --version
27 Print the program version.
28
29 -t, --tsig tsig_name [tsig_algorithm] [tsig_bits]
30 Generates a TSIG key. TSIG algorithm can be specified by string
31 (default: hmac-sha256), bit length of the key by number
32 (default: optimal length given by algorithm). The generated TSIG
33 key is only displayed on stdout: the command does not create a
34 file, nor include the key in a keystore.
35
36 Config options
37 -c, --config file
38 Use a textual configuration file (default is
39 /etc/knot/knot.conf).
40
41 -C, --confdb directory
42 Use a binary configuration database directory (default is
43 /var/lib/knot/confdb). The default configuration database, if
44 exists, has a preference to the default configuration file.
45
46 -d, --dir path
47 Use specified KASP database path and default configuration.
48
49 NOTE:
50 Keymgr runs with the same user privileges as configured for knotd.
51 For example, if keymgr is run as root, but the configured user is
52 knot, it won't be able to read files (PEM files, KASP db, ...) read‐
53 able only by root.
54
55 Commands
56 list [timestamp_format]
57 Prints the list of key IDs and parameters of keys belonging to
58 the zone.
59
60 generate [arguments...]
61 Generates new DNSSEC key and stores it in KASP database. Prints
62 the key ID. This action takes some number of arguments (see
63 below). Values for unspecified arguments are taken from corre‐
64 sponding policy (if -c or -C options used) or from Knot policy
65 defaults.
66
67 import-bind BIND_key_file
68 Imports a BIND-style key into KASP database (converting it to
69 PEM format). Takes one argument: path to BIND key file (private
70 or public, but both MUST exist).
71
72 import-pub BIND_pubkey_file
73 Imports a public key into KASP database. This key won't be
74 rollovered nor used for signing. Takes one argument: path to
75 BIND public key file.
76
77 import-pem PEM_file [arguments...]
78 Imports a DNSSEC key from PEM file. The key parameters (same as
79 for the generate action) need to be specified (mainly algorithm,
80 timers...) because they are not contained in the PEM format.
81
82 import-pkcs11 key_id [arguments...]
83 Imports a DNSSEC key from PKCS #11 storage. The key parameters
84 (same as for the generate action) need to be specified (mainly
85 algorithm, timers...) because they are not available. In fact,
86 no key data is imported, only KASP database metadata is created.
87
88 nsec3-salt [new_salt]
89 Prints the current NSEC3 salt used for signing. If new_salt is
90 specified, the salt is overwritten. The salt is printed and
91 expected in hexadecimal, or dash if empty.
92
93 set key_spec [arguments...]
94 Changes a timing argument (or ksk/zsk) of an existing key to a
95 new value. Key_spec is either the key tag or a prefix of the key
96 ID, with an optional [id=|keytag=] prefix; arguments are like
97 for generate, but just the related ones.
98
99 ds [key_spec]
100 Generate DS record (all digest algorithms together) for speci‐
101 fied key. Key_spec is like for set, if unspecified, all KSKs are
102 used.
103
104 dnskey [key_spec]
105 Generate DNSKEY record for specified key. Key_spec is like for
106 ds, if unspecified, all KSKs are used.
107
108 delete key_spec
109 Remove the specified key from zone. If the key was not shared,
110 it is also deleted from keystore.
111
112 share key_ID
113 Import a key (specified by full key ID) from another zone as
114 shared. After this, the key is owned by both zones equally.
115
116 Commands related to Offline KSK feature
117 pregenerate timestamp
118 Pre-generate ZSKs for use with offline KSK, for the specified
119 period starting from now.
120
121 show-offline timestamp-from [timestamp-to]
122 Print pre-generated offline key-related records for specified
123 time interval. If timestamp_to is omitted, it will be to infin‐
124 ity.
125
126 del-offline timestamp-from timestamp-to
127 Delete pre-generated offline key-related records in specified
128 time interval.
129
130 del-all-old
131 Delete old keys that are in state 'removed'.
132
133 generate-ksr timestamp-from timestamp-to
134 Print to stdout KeySigningRequest based on pre-generated ZSKs
135 for specified period.
136
137 sign-ksr ksr_file
138 Read KeySigingRequest from a text file, sign it using local key‐
139 set and print SignedKeyResponse to stdout.
140
141 import-skr skr_file
142 Read SignedKeyResponse from a text file and import the signa‐
143 tures for later use in zone. (The signatures are not checked at
144 import time, but they will be ignored at signing time if
145 invalid.) If some signatures have already been imported, they
146 will be deleted for the period from beginning of the SKR to
147 infinity.
148
149 Generate arguments
150 Arguments are separated by space, each of them is in format
151 'name=value'.
152
153 algorithm
154 Either an algorithm number (e.g. 14), or text name without
155 dashes (e.g. ECDSAP384SHA384).
156
157 size Key length in bits.
158
159 ksk If set to yes, the key will be used for signing DNSKEY rrset.
160 The generated key will also have the Secure Entry Point flag set
161 to 1.
162
163 zsk If set to yes, the key will be used for signing zone (except
164 DNSKEY rrset). This flag can be set concurrently with the ksk
165 flag.
166
167 sep Overrides the standard setting of the Secure Entry Point flag
168 for the generated key.
169
170 The following arguments are timestamps of key lifetime (see DNSSEC Key
171 states):
172
173 pre_active
174 Key started to be used for signing, not published (only for
175 algorithm rollover).
176
177 publish
178 Key published.
179
180 ready Key used for signing and submitted to the parent zone (only for
181 KSK).
182
183 active Key used for signing.
184
185 retire_active
186 Key still used for signing, but another key is active (only for
187 KSK or algorithm rollover).
188
189 retire Key still published, but no longer used for signing.
190
191 post_active
192 Key no longer published, but still used for signing (only for
193 algorithm rollover).
194
195 remove Key deleted.
196
197 Timestamps
198 0 Zero timestamp means infinite future.
199
200 UNIX_time
201 Positive number of seconds since 1970 UTC.
202
203 YYYYMMDDHHMMSS
204 Date and time in this format without any punctuation.
205
206 relative_timestamp
207 A sign character (+, -), a number, and an optional time unit (y,
208 mo, d, h, mi, s). The default unit is one second. E.g. +1mi,
209 -2mo.
210
211 Output timestamp formats
212 (none) The timestamps are printed as UNIX timestamp.
213
214 human The timestamps are printed relatively to now using time units
215 (e.g. -2y5mo, +1h13s).
216
217 iso The timestamps are printed in the ISO8601 format (e.g.
218 2016-12-31T23:59:00).
219
221 Exit status of 0 means successful operation. Any other exit status
222 indicates an error.
223
225 1. Generate new TSIG key:
226
227 $ keymgr -t my_name hmac-sha384
228
229 2. Generate new DNSSEC key:
230
231 $ keymgr example.com. generate algorithm=ECDSAP256SHA256 size=256 \
232 ksk=true created=1488034625 publish=20170223205611 retire=+10mo remove=+1y
233
234 3. Import a DNSSEC key from BIND:
235
236 $ keymgr example.com. import-bind ~/bind/Kharbinge4d5.+007+63089.key
237
238 4. Configure key timing:
239
240 $ keymgr example.com. set 4208 active=+2mi retire=+4mi remove=+5mi
241
242 5. Share a KSK from another zone:
243
244 $ keymgr example.com. share e687cf927029e9db7184d2ece6d663f5d1e5b0e9
245
247 RFC 6781 - DNSSEC Operational Practices. RFC 7583 - DNSSEC Key
248 Rollover Timing Considerations.
249
250 knot.conf(5), knotc(8), knotd(8).
251
253 CZ.NIC Labs <https://www.knot-dns.cz>
254
256 Copyright 2010–2019, CZ.NIC, z.s.p.o.
257
258
259
260
2612.9.2 2019-12-12 KEYMGR(8)