summaryrefslogtreecommitdiff
path: root/utilities/ovs-pki.8.in
blob: a1bcc11ee59983ce8e3b6bc59e9a06e47d0aca83 (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
.de IQ
.  br
.  ns
.  IP "\\$1"
..
.TH ovs\-pki 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"

.SH NAME
ovs\-pki \- OpenFlow public key infrastructure management utility

.SH SYNOPSIS
Each command takes the form:
.sp
\fBovs\-pki\fR [\fIoptions\fR] \fIcommand\fR [\fIargs\fR]
.sp
The implemented commands and their arguments are:
.br
\fBovs\-pki\fR \fBinit\fR
.br
\fBovs\-pki\fR \fBreq\fR \fIname\fR
.br
\fBovs\-pki\fR \fBsign\fR \fIname\fR [\fItype\fR]
.br
\fBovs\-pki\fR \fBreq+sign\fR \fIname\fR [\fItype\fR]
.br
\fBovs\-pki\fR \fBverify\fR \fIname\fR [\fItype\fR]
.br
\fBovs\-pki\fR \fBfingerprint\fR \fIfile\fR
.br
\fBovs\-pki\fR \fBself\-sign\fR \fIname\fR
.sp
Each \fItype\fR above is a certificate type, either \fBswitch\fR
(default) or \fBcontroller\fR.
.sp
The available options are:
.br
[\fB\-k\fR \fItype\fR | \fB\-\^\-key=\fItype\fR]
.br
[\fB\-B\fR \fInbits\fR | \fB\-\^\-bits=\fInbits\fR]
.br
[\fB\-D\fR \fIfile\fR | \fB\-\^\-dsaparam=\fIfile\fR]
.br
[\fB\-b\fR | \fB\-\^\-batch\fR]
.br
[\fB\-f\fR | \fB\-\^\-force\fR]
.br
[\fB\-d\fR \fIdir\fR | \fB\-\^\-dir=\fR\fIdir\fR]
.br
[\fB\-l\fR \fIfile\fR | \fB\-\^\-log=\fIfile\fR]
.br
[\fB\-u\fR | \fB\-\^\-unique\fR]
.br
[\fB\-h\fR | \fB\-\^\-help\fR]
.sp
Some options do not apply to every command.

.SH DESCRIPTION
The \fBovs\-pki\fR program sets up and manages a public key
infrastructure for use with OpenFlow.  It is intended to be a simple
interface for organizations that do not have an established public key
infrastructure.  Other PKI tools can substitute for or supplement the
use of \fBovs\-pki\fR.

\fBovs\-pki\fR uses \fBopenssl\fR(1) for certificate management and key
generation.

.SH "OFFLINE COMMANDS"

The following \fBovs\-pki\fR commands support manual PKI
administration:

.TP
\fBinit\fR
Initializes a new PKI (by default in directory \fB@PKIDIR@\fR) and populates
it with a pair of certificate authorities for controllers and
switches.

This command should ideally be run on a high\-security machine separate
from any OpenFlow controller or switch, called the CA machine.  The
files \fBpki/controllerca/cacert.pem\fR and
\fBpki/switchca/cacert.pem\fR that it produces will need to be copied
over to the OpenFlow switches and controllers, respectively.  Their
contents may safely be made public.

By default, \fBovs\-pki\fR generates 2048\-bit RSA keys.  The \fB\-B\fR
or \fB\-\^\-bits\fR option (see below) may be used to override the key
length.  The \fB\-k dsa\fR or \fB\-\^\-key=dsa\fR option may be used to use
DSA in place of RSA.  If DSA is selected, the \fBdsaparam.pem\fR file
generated in the new PKI hierarchy must be copied to any machine on
which the \fBreq\fR command (see below) will be executed.  Its
contents may safely be made public.

Other files generated by \fBinit\fR may remain on the CA machine.
The files \fBpki/controllerca/private/cakey.pem\fR and
\fBpki/switchca/private/cakey.pem\fR have particularly sensitive
contents that should not be exposed.

.TP
\fBreq\fR \fIname\fR
Generates a new private key named \fIname\fR\fB\-privkey.pem\fR and
corresponding certificate request named \fIname\fR\fB\-req.pem\fR.
The private key can be intended for use by a switch or a controller.

This command should ideally be run on the switch or controller that
will use the private key to identify itself.  The file
\fIname\fR\fB\-req.pem\fR must be copied to the CA machine for signing
with the \fBsign\fR command (below).  

This command will output a fingerprint to stdout as its final step.
Write down the fingerprint and take it to the CA machine before
continuing with the \fBsign\fR step.

When RSA keys are in use (as is the default), \fBreq\fR, unlike the
rest of \fBovs\-pki\fR's commands, does not need access to a PKI
hierarchy created by \fBovs\-pki init\fR.  The \fB\-B\fR or
\fB\-\^\-bits\fR option (see below) may be used to specify the number of
bits in the generated RSA key.

When DSA keys are used (as specified with \fB\-\^\-key=dsa\fR), \fBreq\fR
needs access to the \fBdsaparam.pem\fR file created as part of the PKI
hierarchy (but not to other files in that tree).  By default,
\fBovs\-pki\fR looks for this file in \fB@PKIDIR@/dsaparam.pem\fR, but
the \fB\-D\fR or \fB\-\^\-dsaparam\fR option (see below) may be used to
specify an alternate location.

\fIname\fR\fB\-privkey.pem\fR has sensitive contents that should not be
exposed.  \fIname\fR\fB\-req.pem\fR may be safely made public.

.TP
\fBsign\fR \fIname\fR [\fItype\fR]
Signs the certificate request named \fIname\fR\fB\-req.pem\fR that was
produced in the previous step, producing a certificate named
\fIname\fR\fB\-cert.pem\fR.  \fItype\fR, either \fBswitch\fR (default) or
\fBcontroller\fR, indicates the use for which the key is being
certified.

This command must be run on the CA machine.

The command will output a fingerprint to stdout and request that you
verify that it is the same fingerprint output by the \fBreq\fR
command.  This ensures that the request being signed is the same one
produced by \fBreq\fR.  (The \fB\-b\fR or \fB\-\^\-batch\fR option
suppresses the verification step.)

The file \fIname\fR\fB\-cert.pem\fR will need to be copied back to the
switch or controller for which it is intended.  Its contents may
safely be made public.

.TP
\fBreq+sign\fR \fIname\fR [\fItype\fR]
Combines the \fBreq\fR and \fBsign\fR commands into a single step,
outputting all the files produced by each.  The
\fIname\fR\fB\-privkey.pem\fR and \fIname\fR\fB\-cert.pem\fR files must
be copied securely to the switch or controller.
\fIname\fR\fB\-privkey.pem\fR has sensitive contents and must not be
exposed in transit.  Afterward, it should be deleted from the CA
machine.

This combined method is, theoretically, less secure than the
individual steps performed separately on two different machines,
because there is additional potential for exposure of the private
key.  However, it is also more convenient.

.TP
\fBverify\fR \fIname\fR [\fItype\fR]
Verifies that \fIname\fR\fB\-cert.pem\fR is a valid certificate for the
given \fItype\fR of use, either \fBswitch\fR (default) or
\fBcontroller\fR.  If the certificate is valid for this use, it prints
the message ``\fIname\fR\fB\-cert.pem\fR: OK''; otherwise, it prints an
error message.

.TP
\fBfingerprint\fR \fIfile\fR
Prints the fingerprint for \fIfile\fR.  If \fIfile\fR is a
certificate, then this is the SHA\-1 digest of the DER encoded version
of the certificate; otherwise, it is the SHA\-1 digest of the entire
file.

.TP
\fBself\-sign\fR \fIname\fR
Signs the certificate request named \fIname\fB\-req.pem\fR using the
private key \fIname\fB\-privkey.pem\fR, producing a self-signed
certificate named \fIname\fB\-cert.pem\fR.  The input files should have
been produced with \fBovs\-pki req\fR.

Some controllers accept such self-signed certificates.

.SH OPTIONS
.IP "\fB\-k\fR \fItype\fR"
.IQ "\fB\-\^\-key=\fItype\fR"
For the \fBinit\fR command, sets the public key algorithm to use for
the new PKI hierarchy.  For the \fBreq\fR and \fBreq+sign\fR commands,
sets the public key algorithm to use for the key to be generated,
which must match the value specified on \fBinit\fR.  With other
commands, the value has no effect.

The \fItype\fR may be \fBrsa\fR (the default) or \fBdsa\fR.

.IP "\fB\-B\fR \fInbits\fR"
.IQ "\fB\-\^\-bits=\fInbits\fR"
Sets the number of bits in the key to be generated.  When RSA keys are
in use, this option affects only the \fBinit\fR, \fBreq\fR, and
\fBreq+sign\fR commands, and the same value should be given each time.
With DSA keys are in use, this option affects only the \fBinit\fR
command.

The value must be at least 1024.  The default is 2048.

.IP "\fB\-D\fR \fIfile\fR"
.IQ "\fB\-\^\-dsaparam=\fIfile\fR"
Specifies an alternate location for the \fBdsaparam.pem\fR file
required by the \fBreq\fR and \fBreq+sign\fR commands.  This option
affects only these commands, and only when DSA keys are used.

The default is \fBdsaparam.pem\fR under the PKI hierarchy.

.IP "\fB\-b\fR"
.IQ "\fB\-\^\-batch\fR"
Suppresses the interactive verification of fingerprints that the
\fBsign\fR command by default requires.

.IP "\fB\-d\fR \fIdir\fR"
.IQ "\fB\-\^\-dir=\fR\fIdir\fR"
Specifies the location of the PKI hierarchy to be used or created by
the command (default: \fB@PKIDIR@\fR).  All commands, except \fBreq\fR,
need access to a PKI hierarchy.

.IP "\fB\-f\fR"
.IQ "\fB\-\^\-force\fR"
By default, \fBovs\-pki\fR will not overwrite existing files or
directories.  This option overrides this behavior.

.IP "\fB\-l\fR \fIfile\fR"
.IQ "\fB\-\^\-log=\fIfile\fR"
Sets the log file to \fIfile\fR.  Default:
\fB@LOGDIR@/ovs\-pki.log\fR.

.IP "\fB\-u\fR"
.IQ "\fB\-\^\-unique\fR"
Changes the format of the certificate's Common Name (CN) field; by
default, this field has the format "<name> id:<uuid-or-date>", this
option causes the provided name to be treated as unique and changes
the format of the CN field to be simply "<name>".

.IP "\fB\-h\fR"
.IQ "\fB\-\^\-help\fR"
Prints a help usage message and exits.