summaryrefslogtreecommitdiff
path: root/bin/python/dnssec-keymgr.docbook
blob: 685b0730ad85cf5ca42b3d21095782fef909e707 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<!--
 - Copyright (C) 2016  Internet Systems Consortium, Inc. ("ISC")
 -
 - 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 http://mozilla.org/MPL/2.0/.
-->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="man.dnssec-keymgr">
  <info>
    <date>2016-06-03</date>
  </info>
  <refentryinfo>
    <corpname>ISC</corpname>
    <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
  </refentryinfo>

  <refmeta>
    <refentrytitle><application>dnssec-keymgr</application></refentrytitle>
    <manvolnum>8</manvolnum>
    <refmiscinfo>BIND9</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname><application>dnssec-keymgr</application></refname>
    <refpurpose>Ensures correct DNSKEY coverage for a zone based on a defined policy</refpurpose>
  </refnamediv>

  <docinfo>
    <copyright>
      <year>2016</year>
      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
    </copyright>
  </docinfo>

  <refsynopsisdiv>
    <cmdsynopsis sepchar=" ">
      <command>dnssec-keymgr</command>
      <arg choice="opt" rep="norepeat"><option>-K <replaceable class="parameter">directory</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">file</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-f</option></arg>
      <arg choice="opt" rep="norepeat"><option>-k</option></arg>
      <arg choice="opt" rep="norepeat"><option>-q</option></arg>
      <arg choice="opt" rep="norepeat"><option>-v</option></arg>
      <arg choice="opt" rep="norepeat"><option>-z</option></arg>
      <arg choice="opt" rep="norepeat"><option>-g <replaceable class="parameter">path</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-r <replaceable class="parameter">path</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-s <replaceable class="parameter">path</replaceable></option></arg>
      <arg choice="opt" rep="repeat">zone</arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsection><info><title>DESCRIPTION</title></info>
    <para>
      <command>dnssec-keymgr</command> is a high level Python wrapper
      to facilitate the key rollover process for zones handled by
      BIND. It uses the BIND commands for manipulating DNSSEC key
      metadata: <command>dnssec-keygen</command> and
      <command>dnssec-settime</command>.
    </para>
    <para>
      DNSSEC policy can be read from a configuration file (default
      <filename>/etc/dnssec-policy.conf</filename>), from which the key
      parameters, publication and rollover schedule, and desired
      coverage duration for any given zone can be determined.  This
      file may be used to define individual DNSSEC policies on a
      per-zone basis, or to set a default policy used for all zones.
    </para>
    <para>
      When <command>dnssec-keymgr</command> runs, it examines the DNSSEC
      keys for one or more zones, comparing their timing metadata against
      the policies for those zones.  If key settings do not conform to the
      DNSSEC policy (for example, because the policy has been changed),
      they are automatically corrected.
    </para>
    <para>
      A zone policy can specify a duration for which we want to
      ensure the key correctness (<option>coverage</option>).  It can
      also specify a rollover period (<option>roll-period</option>).
      If policy indicates that a key should roll over before the
      coverage period ends, then a successor key will automatically be
      created and added to the end of the key series.
    </para>
    <para>
      If zones are specified on the command line,
      <command>dnssec-keymgr</command> will examine only those zones.
      If a specified zone does not already have keys in place, then
      keys will be generated for it according to policy.
    </para>
    <para>
      If zones are <emphasis>not</emphasis> specified on the command
      line, then <command>dnssec-keymgr</command> will search the
      key directory (either the current working directory or the directory
      set by the <option>-K</option> option), and check the keys for
      all the zones represented in the directory.
    </para>
    <para>
      It is expected that this tool will be run automatically and
      unattended (for example, by <command>cron</command>).
    </para>
  </refsection>

  <refsection><info><title>OPTIONS</title></info>
    <variablelist>
      <varlistentry>
        <term>-c <replaceable class="parameter">file</replaceable></term>
        <listitem>
          <para>
            If <option>-c</option> is specified, then the DNSSEC
            policy is read from <option>file</option>.  (If not
            specified, then the policy is read from
            <filename>/etc/dnssec-policy.conf</filename>; if that file
            doesn't exist, a built-in global default policy is used.)
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-f</term>
        <listitem>
          <para>
            Force: allow updating of key events even if they are
            already in the past. This is not recommended for use with
            zones in which keys have already been published. However,
            if a set of keys has been generated all of which have
            publication and activation dates in the past, but the
            keys have not been published in a zone as yet, then this
            option can be used to clean them up and turn them into a
            proper series of keys with appropriate rollover intervals.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-g <replaceable class="parameter">keygen-path</replaceable></term>
        <listitem>
          <para>
            Specifies a path to a <command>dnssec-keygen</command> binary.
            Used for testing.
            See also the <option>-s</option> option.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-h</term>
        <listitem>
          <para>
            Print the <command>dnssec-keymgr</command> help summary
            and exit.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-K <replaceable class="parameter">directory</replaceable></term>
        <listitem>
          <para>
            Sets the directory in which keys can be found.  Defaults to the
            current working directory.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-k</term>
        <listitem>
          <para>
            Only apply policies to KSK keys.
            See also the <option>-z</option> option.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-q</term>
        <listitem>
          <para>
            Quiet: suppress printing of <command>dnssec-keygen</command>
            and <command>dnssec-settime</command>.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-r <replaceable class="parameter">randomdev</replaceable></term>
        <listitem>
          <para>
            Specifies a path to a file containing random data.
            This is passed to the <command>dnssec-keygen</command> binary
            using its <option>-r</option> option.
<!-- TODO: what to do about "-r keyboard"? -->
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-s <replaceable class="parameter">settime-path</replaceable></term>
        <listitem>
          <para>
            Specifies a path to a <command>dnssec-settime</command> binary.
            Used for testing.
            See also the <option>-g</option> option.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-v</term>
        <listitem>
          <para>
	    Print the <command>dnssec-keymgr</command> version and exit.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-z</term>
        <listitem>
          <para>
            Only apply policies to ZSK keys.
            See also the <option>-k</option> option.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection><info><title>POLICY CONFIGURATION</title></info>
    <para>
      The <filename>dnssec-policy.conf</filename> file can specify three kinds
      of policies:
    </para>
    <itemizedlist>
      <listitem>
	<para>
	  <emphasis>Policy classes</emphasis>
	  (<option>policy <replaceable>name</replaceable> { ... };</option>)
	  can be inherited by zone policies or other policy classes; these
	  can be used to create sets of different security profiles. For
	  example, a policy class <userinput>normal</userinput> might specify
	  1024-bit key sizes, but a class <userinput>extra</userinput> might
	  specify 2048 bits instead; <userinput>extra</userinput> would be
	  used for zones that had unusually high security needs.
	</para>
      </listitem>
      <listitem>
	<para>
	  Algorithm policies:
	  (<option>algorithm-policy <replaceable>algorithm</replaceable> { ... };</option> )
	  override default per-algorithm settings.  For example, by default,
	  RSASHA256 keys use 2048-bit key sizes for both KSK and ZSK. This
	  can be modified using <command>algorithm-policy</command>, and the
	  new key sizes would then be used for any key of type RSASHA256.
	</para>
      </listitem>
      <listitem>
	<para>
	  Zone policies:
	  (<option>zone <replaceable>name</replaceable> { ... };</option> )
	  set policy for a single zone by name. A zone policy can inherit
	  a policy class by including a <option>policy</option> option.
	</para>
      </listitem>
    </itemizedlist>
    <para>
      Options that can be specified in policies:
    </para>
    <variablelist>
      <varlistentry>
	<term><command>algorithm</command></term>
	<listitem>
	  <para>
	    The key algorithm. If no policy is defined, the default is
            RSASHA256.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>coverage</command></term>
	<listitem>
	  <para>
	    The length of time to ensure that keys will be correct; no action
            will be taken to create new keys to be activated after this time.
            This can be represented as a number of seconds, or as a duration using
	    human-readable units (examples: "1y" or "6 months").
	    A default value for this option can be set in algorithm policies
	    as well as in policy classes or zone policies.
            If no policy is configured, the default is six months.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>directory</command></term>
	<listitem>
          <para>
	    Specifies the directory in which keys should be stored.
          </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>key-size</command></term>
	<listitem>
	  <para>
	    Specifies the number of bits to use in creating keys.
	    Takes two arguments: keytype (eihter "zsk" or "ksk") and size.
	    A default value for this option can be set in algorithm policies
	    as well as in policy classes or zone policies. If no policy is
            configured, the default is 1024 bits for DSA keys and 2048 for
            RSA.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>keyttl</command></term>
	<listitem>
	  <para>
	    The key TTL. If no policy is defined, the default is one hour.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>post-publish</command></term>
	<listitem>
	  <para>
	    How long after inactivation a key should be deleted from the zone.
	    Note: If <option>roll-period</option> is not set, this value is
	    ignored. Takes two arguments: keytype (eihter "zsk" or "ksk") and a
	    duration. A default value for this option can be set in algorithm
	    policies as well as in policy classes or zone policies. The default
	    is one month.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>pre-publish</command></term>
	<listitem>
	  <para>
	    How long before activation a key should be published.  Note: If
            <option>roll-period</option> is not set, this value is ignored.
	    Takes two arguments: keytype (either "zsk" or "ksk") and a duration.
	    A default value for this option can be set in algorithm policies
	    as well as in policy classes or zone policies.  The default is
            one month.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>roll-period</command></term>
	<listitem>
	  <para>
	    How frequently keys should be rolled over.
	    Takes two arguments: keytype (eihter "zsk" or "ksk") and a duration.
	    A default value for this option can be set in algorithm policies
	    as well as in policy classes or zone policies.  If no policy is
            configured, the default is one year for ZSK's. KSK's do not
            roll over by default.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><command>standby</command></term>
	<listitem>
	  <para>
	    Not yet implemented.
	  </para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection><info><title>REMAINING WORK</title></info>
  <itemizedlist>
    <listitem>
      <para>
        Enable scheduling of KSK rollovers using the <option>-P sync</option>
        and <option>-D sync</option> options to
        <command>dnssec-keygen</command> and
        <command>dnssec-settime</command>.  Check the parent zone
        (as in <command>dnssec-checkds</command>) to determine when it's
        safe for the key to roll.
      </para>
    </listitem>
    <listitem>
      <para>
        Allow configuration of standby keys and use of the REVOKE bit,
        for keys that use RFC 5011 semantics.
      </para>
    </listitem>
  </itemizedlist>
  </refsection>

  <refsection><info><title>SEE ALSO</title></info>
    <para>
      <citerefentry>
	<refentrytitle>dnssec-coverage</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>dnssec-settime</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>dnssec-checkds</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>
    </para>
  </refsection>

</refentry>