Skip to content

Commit 1047182

Browse files
hlrichardsonblp
authored andcommitted
ovn-sb: remote connection management in sb db
Add support for managing remote connections, including SSL configuration, to southbound db schema, and add necessary commands to ovn-sbctl. Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
1 parent 821302c commit 1047182

7 files changed

Lines changed: 427 additions & 12 deletions

File tree

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Post-v2.6.0
99
* Support for source IP address based routing.
1010
* ovn-trace can now trace put_dhcp_opts and put_dhcp_optsv6 actions.
1111
* Support for managing SSL and remote connection configuration in
12-
northbound database.
12+
northbound and southbound databases.
1313
- Fixed regression in table stats maintenance introduced in OVS
1414
2.3.0, wherein the number of OpenFlow table hits and misses was
1515
not accurate.

manpages.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ ovn/utilities/ovn-sbctl.8: \
44
ovn/utilities/ovn-sbctl.8.in \
55
lib/common.man \
66
lib/db-ctl-base.man \
7+
lib/ssl-bootstrap.man \
8+
lib/ssl-peer-ca-cert.man \
9+
lib/ssl.man \
710
lib/table.man \
811
lib/vlog.man \
912
ovsdb/remote-active.man \
13+
ovsdb/remote-active.man \
14+
ovsdb/remote-passive.man \
1015
ovsdb/remote-passive.man
1116
ovn/utilities/ovn-sbctl.8.in:
1217
lib/common.man:
1318
lib/db-ctl-base.man:
19+
lib/ssl-bootstrap.man:
20+
lib/ssl-peer-ca-cert.man:
21+
lib/ssl.man:
1422
lib/table.man:
1523
lib/vlog.man:
1624
ovsdb/remote-active.man:
25+
ovsdb/remote-active.man:
26+
ovsdb/remote-passive.man:
1727
ovsdb/remote-passive.man:
1828

1929
ovsdb/ovsdb-client.1: \

ovn/ovn-sb.ovsschema

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "OVN_Southbound",
33
"version": "1.9.0",
4-
"cksum": "239060528 9012",
4+
"cksum": "2240045372 9719",
55
"tables": {
66
"SB_Global": {
77
"columns": {
@@ -13,7 +13,11 @@
1313
"type": {"key": {"type": "uuid",
1414
"refTable": "Connection"},
1515
"min": 0,
16-
"max": "unlimited"}}},
16+
"max": "unlimited"}},
17+
"ssl": {
18+
"type": {"key": {"type": "uuid",
19+
"refTable": "SSL"},
20+
"min": 0, "max": 1}}},
1721
"maxRows": 1,
1822
"isRoot": true},
1923
"Chassis": {
@@ -183,4 +187,15 @@
183187
"min": 0,
184188
"max": "unlimited"},
185189
"ephemeral": true}},
186-
"indexes": [["target"]]}}}
190+
"indexes": [["target"]]},
191+
"SSL": {
192+
"columns": {
193+
"private_key": {"type": "string"},
194+
"certificate": {"type": "string"},
195+
"ca_cert": {"type": "string"},
196+
"bootstrap_ca_cert": {"type": "boolean"},
197+
"external_ids": {"type": {"key": "string",
198+
"value": "string",
199+
"min": 0,
200+
"max": "unlimited"}}},
201+
"maxRows": 1}}}

ovn/ovn-sb.xml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@
169169
connections should be configured. See the <ref table="Connection"/>
170170
table for more information.
171171
</column>
172+
<column name="ssl">
173+
Global SSL configuration.
174+
</column>
172175
</group>
173176
</table>
174177

@@ -2311,7 +2314,9 @@ tcp.flags = RST;
23112314
<p>
23122315
The specified SSL <var>port</var> on the host at the given
23132316
<var>ip</var>, which must be expressed as an IP address
2314-
(not a DNS name).
2317+
(not a DNS name). A valid SSL configuration must be provided
2318+
when this form is used, this configuration can be specified
2319+
via command-line options or the <ref table="SSL"/> table.
23152320
</p>
23162321
<p>
23172322
If <var>port</var> is not specified, it defaults to 6640.
@@ -2347,6 +2352,9 @@ tcp.flags = RST;
23472352
address, wrap in square brackets,
23482353
e.g. <code>pssl:6640:[::1]</code>. If <var>ip</var> is not
23492354
specified then it listens only on IPv4 (but not IPv6) addresses.
2355+
A valid SSL configuration must be provided when this form is used,
2356+
this can be specified either via command-line options or the
2357+
<ref table="SSL"/> table.
23502358
</p>
23512359
<p>
23522360
If <var>port</var> is not specified, it defaults to 6640.
@@ -2519,4 +2527,42 @@ tcp.flags = RST;
25192527
<column name="other_config"/>
25202528
</group>
25212529
</table>
2530+
<table name="SSL">
2531+
SSL configuration for ovn-sb database access.
2532+
2533+
<column name="private_key">
2534+
Name of a PEM file containing the private key used as the switch's
2535+
identity for SSL connections to the controller.
2536+
</column>
2537+
2538+
<column name="certificate">
2539+
Name of a PEM file containing a certificate, signed by the
2540+
certificate authority (CA) used by the controller and manager,
2541+
that certifies the switch's private key, identifying a trustworthy
2542+
switch.
2543+
</column>
2544+
2545+
<column name="ca_cert">
2546+
Name of a PEM file containing the CA certificate used to verify
2547+
that the switch is connected to a trustworthy controller.
2548+
</column>
2549+
2550+
<column name="bootstrap_ca_cert">
2551+
If set to <code>true</code>, then Open vSwitch will attempt to
2552+
obtain the CA certificate from the controller on its first SSL
2553+
connection and save it to the named PEM file. If it is successful,
2554+
it will immediately drop the connection and reconnect, and from then
2555+
on all SSL connections must be authenticated by a certificate signed
2556+
by the CA certificate thus obtained. <em>This option exposes the
2557+
SSL connection to a man-in-the-middle attack obtaining the initial
2558+
CA certificate.</em> It may still be useful for bootstrapping.
2559+
</column>
2560+
2561+
<group title="Common Columns">
2562+
The overall purpose of these columns is described under <code>Common
2563+
Columns</code> at the beginning of this document.
2564+
2565+
<column name="external_ids"/>
2566+
</group>
2567+
</table>
25222568
</database>

ovn/utilities/ovn-sbctl.8.in

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ ovn\-sbctl \- utility for querying and configuring \fBOVN_Southbound\fR database
2222
\fR[\fIargs\fR] [\fB\-\-\fR [\fIoptions\fR] \fIcommand \fR[\fIargs\fR]]...
2323
.
2424
.SH DESCRIPTION
25-
The command should only be used for advanced debugging and troubleshooting
26-
of the \fBOVN_Southbound\fR database; and should never be used in normal
27-
operation.
28-
.PP
2925
The \fBovn\-sbctl\fR program configures the \fBOVN_Southbound\fR database
3026
by providing a high\-level interface to its configuration database. See
3127
\fBovn\-sb\fR(5) for comprehensive documentation of the database schema.
@@ -105,6 +101,11 @@ These options control the format of output from the \fBlist\fR and
105101
\fBfind\fR commands.
106102
.so lib/table.man
107103
.
104+
.SS "Public Key Infrastructure Options"
105+
.so lib/ssl.man
106+
.so lib/ssl-bootstrap.man
107+
.so lib/ssl-peer-ca-cert.man
108+
.
108109
.SH COMMANDS
109110
The commands implemented by \fBovn\-sbctl\fR are described in the
110111
sections below.
@@ -166,6 +167,82 @@ flows for that logical datapath.
166167
.IP "\fBdump\-flows\fR [\fIlogical-datapath\fR]"
167168
Alias for \fBlflow\-list\fB.
168169
.
170+
.SS "Remote Connectivity Commands"
171+
.
172+
These commands manipulate the \fBconnections\fR column in the \fBSB_Global\fR
173+
table and rows in the \fBConnection\fR table. When \fBovsdb\-server\fR
174+
is configured to use the \fBconnections\fR column for OVSDB connections,
175+
this allows the administrator to use \fBovn\-sbctl\fR to configure database
176+
connections.
177+
.
178+
.IP "\fBget\-connection\fR"
179+
Prints the configured connection(s).
180+
.
181+
.IP "\fBdel\-connection\fR"
182+
Deletes the configured connection(s).
183+
.
184+
.IP "\fBset\-connection\fR [\fIaccess\-specifier\fR] \fItarget\fR\&..."
185+
Sets the configured manager target or targets. Each \fItarget\fR may
186+
be preceded by an optional access-specifier (\fBread\-only\fR or
187+
\fBread\-write\fR) and may use any of the following forms:
188+
.
189+
.RS
190+
.so ovsdb/remote-active.man
191+
.so ovsdb/remote-passive.man
192+
.RE
193+
194+
If provided, the effect of the access specifier persists for subsequent
195+
targets until changed by another access specifier.
196+
.
197+
.SS "SSL Configuration"
198+
When \fBovsdb\-server\fR is configured to connect using SSL, the
199+
following parameters are required:
200+
.TP
201+
\fIprivate-key\fR
202+
Specifies a PEM file containing the private key used for SSL connections.
203+
.TP
204+
\fIcertificate\fR
205+
Specifies a PEM file containing a certificate, signed by the
206+
certificate authority (CA) used by the connection peers, that
207+
certifies the private key, identifying a trustworthy peer.
208+
.TP
209+
\fIca-cert\fR
210+
Specifies a PEM file containing the CA certificate used to verify that
211+
the connection peers are trustworthy.
212+
.PP
213+
These SSL settings apply to all SSL connections made by the southbound
214+
database server.
215+
.
216+
.IP "\fBget\-ssl\fR"
217+
Prints the SSL configuration.
218+
.
219+
.IP "\fBdel\-ssl\fR"
220+
Deletes the current SSL configuration.
221+
.
222+
.IP "[\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR"
223+
Sets the SSL configuration. The \fB\-\-bootstrap\fR option is described
224+
below.
225+
.
226+
.ST "CA Certificate Bootstrap"
227+
.PP
228+
Ordinarily, all of the files named in the SSL configuration must exist
229+
before SSL connectivity can be used. However, if the \fIca-cert\fR file
230+
does not exist and the \fB\-\-bootstrap\fR
231+
option is given, then \fBovsdb\-server\fR will attempt to obtain the
232+
CA certificate from the target on its first SSL connection and
233+
save it to the named PEM file. If it is successful, it will
234+
immediately drop the connection and reconnect, and from then on all
235+
SSL connections must be authenticated by a certificate signed by the
236+
CA certificate thus obtained.
237+
.PP
238+
\fBThis option exposes the SSL connection to a man-in-the-middle
239+
attack obtaining the initial CA certificate\fR, but it may be useful
240+
for bootstrapping.
241+
.PP
242+
This option is only useful if the SSL peer sends its CA certificate
243+
as part of the SSL certificate chain. The SSL protocol does not
244+
require the controller to send the CA certificate.
245+
.
169246
.so lib/db-ctl-base.man
170247
.SH "EXIT STATUS"
171248
.IP "0"

0 commit comments

Comments
 (0)