1KEYMGR(8)                          Knot DNS                          KEYMGR(8)
2
3
4

NAME

6       keymgr - Knot DNS key management utility
7

SYNOPSIS

9       keymgr basic_option [parameters...]
10
11       keymgr [config_option config_storage] zone command argument...
12

DESCRIPTION

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       local-serial [new_serial]
94              Print SOA serial stored in KASP database when using on-secondary
95              DNSSEC signing.  If new_serial is specified, the serial is over‐
96              written.  After updating the serial, expire the zone (zone-purge
97              +expire +zonefile +journal) if the server is running, or  remove
98              corresponding  zone  file  and journal contents if the server is
99              stopped.
100
101       set key_spec [arguments...]
102              Changes a timing argument (or ksk/zsk) of an existing key  to  a
103              new value. Key_spec is either the key tag or a prefix of the key
104              ID, with an optional [id=|keytag=] prefix;  arguments  are  like
105              for generate, but just the related ones.
106
107       ds [key_spec]
108              Generate  DS  record (all digest algorithms together) for speci‐
109              fied key. Key_spec is like for set, if unspecified, all KSKs are
110              used.
111
112       dnskey [key_spec]
113              Generate  DNSKEY  record for specified key. Key_spec is like for
114              ds, if unspecified, all KSKs are used.
115
116       delete key_spec
117              Remove the specified key from zone. If the key was  not  shared,
118              it is also deleted from keystore.
119
120       share key_ID zone_from
121              Import  a  key  (specified  by full key ID) from another zone as
122              shared. After this, the key is owned by both zones equally.
123
124   Commands related to Offline KSK feature
125       pregenerate timestamp
126              Pre-generate ZSKs for use with offline KSK,  for  the  specified
127              period starting from now.
128
129       show-offline timestamp-from [timestamp-to]
130              Print  pre-generated  offline  key-related records for specified
131              time interval. If timestamp_to is omitted, it will be to  infin‐
132              ity.
133
134       del-offline timestamp-from timestamp-to
135              Delete  pre-generated  offline  key-related records in specified
136              time interval.
137
138       del-all-old
139              Delete old keys that are in state 'removed'.
140
141       generate-ksr timestamp-from timestamp-to
142              Print to stdout KeySigningRequest based  on  pre-generated  ZSKs
143              for specified period.
144
145       sign-ksr ksr_file
146              Read KeySigingRequest from a text file, sign it using local key‐
147              set and print SignedKeyResponse to stdout.
148
149       validate-skr skr_file
150              Read SignedKeyResponse from a text file and validate the  RRSIGs
151              in it if not corrupt.
152
153       import-skr skr_file
154              Read  SignedKeyResponse  from  a text file and import the signa‐
155              tures for later use in zone. If  some  signatures  have  already
156              been  imported,  they will be deleted for the period from begin‐
157              ning of the SKR to infinity.
158
159   Generate arguments
160       Arguments  are  separated  by  space,  each  of  them  is   in   format
161       'name=value'.
162
163       algorithm
164              Either  an  algorithm  number  (e.g.  14),  or text name without
165              dashes (e.g. ECDSAP384SHA384).
166
167       size   Key length in bits.
168
169       ksk    If set to yes, the key will be used for  signing  DNSKEY  rrset.
170              The generated key will also have the Secure Entry Point flag set
171              to 1.
172
173       zsk    If set to yes, the key will be used  for  signing  zone  (except
174              DNSKEY  rrset).  This  flag can be set concurrently with the ksk
175              flag.
176
177       sep    Overrides the standard setting of the Secure Entry Point flag.
178
179       The following arguments are timestamps of key lifetime (see DNSSEC  Key
180       states):
181
182       pre_active
183              Key  started  to  be  used  for signing, not published (only for
184              algorithm rollover).
185
186       publish
187              Key published.
188
189       ready  Key used for signing and submitted to the parent zone (only  for
190              KSK).
191
192       active Key used for signing.
193
194       retire_active
195              Key  still used for signing, but another key is active (only for
196              KSK or algorithm rollover).
197
198       retire Key still published, but no longer used for signing.
199
200       post_active
201              Key no longer published, but still used for  signing  (only  for
202              algorithm rollover).
203
204       revoke Key revoked according to RFC 5011 trust anchor roll-over.
205
206       remove Key deleted.
207
208   Timestamps
209       0      Zero timestamp means infinite future.
210
211       UNIX_time
212              Positive number of seconds since 1970 UTC.
213
214       YYYYMMDDHHMMSS
215              Date and time in this format without any punctuation.
216
217       relative_timestamp
218              A sign character (+, -), a number, and an optional time unit (y,
219              mo, d, h, mi, s). The default unit is one  second.   E.g.  +1mi,
220              -2mo.
221
222   Output timestamp formats
223       (none) The timestamps are printed as UNIX timestamp.
224
225       human  The  timestamps  are  printed relatively to now using time units
226              (e.g. -2y5mo, +1h13s).
227
228       iso    The  timestamps  are  printed  in  the  ISO8601   format   (e.g.
229              2016-12-31T23:59:00).
230

EXIT VALUES

232       Exit  status  of  0  means  successful operation. Any other exit status
233       indicates an error.
234

EXAMPLES

236       1. Generate new TSIG key:
237
238             $ keymgr -t my_name hmac-sha384
239
240       2. Generate new DNSSEC key:
241
242             $ keymgr example.com. generate algorithm=ECDSAP256SHA256 size=256 \
243               ksk=true created=1488034625 publish=20170223205611 retire=+10mo remove=+1y
244
245       3. Import a DNSSEC key from BIND:
246
247             $ keymgr example.com. import-bind ~/bind/Kharbinge4d5.+007+63089.key
248
249       4. Configure key timing:
250
251             $ keymgr example.com. set 4208 active=+2mi retire=+4mi remove=+5mi
252
253       5. Share a KSK from another zone:
254
255             $ keymgr example.com. share e687cf927029e9db7184d2ece6d663f5d1e5b0e9 another-zone.com.
256

SEE ALSO

258       RFC 6781 -  DNSSEC  Operational  Practices.   RFC  7583  -  DNSSEC  Key
259       Rollover Timing Considerations.
260
261       knot.conf(5), knotc(8), knotd(8).
262

AUTHOR

264       CZ.NIC Labs <https://www.knot-dns.cz>
265
267       Copyright 2010–2021, CZ.NIC, z.s.p.o.
268
269
270
271
2723.0.5                             2021-03-25                         KEYMGR(8)
Impressum