Skip to content

Commit a96df18

Browse files
committed
OSDOCS-6862: Add support for external IPsec endpoints
- https://issues.redhat.com/browse/OSDOCS-6862
1 parent e3aa332 commit a96df18

File tree

5 files changed

+221
-40
lines changed

5 files changed

+221
-40
lines changed

modules/nw-ovn-ipsec-enable.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
:_content-type: PROCEDURE
66
[id="nw-ovn-ipsec-enable_{context}"]
7-
= Enabling IPsec encryption
7+
= Enabling pod-to-pod IPsec encryption
88

9-
As a cluster administrator, you can enable IPsec encryption after cluster installation.
9+
As a cluster administrator, you can enable pod-to-pod IPsec encryption after cluster installation.
1010

1111
.Prerequisites
1212

13-
* Install the OpenShift CLI (`oc`).
14-
* Log in to the cluster with a user with `cluster-admin` privileges.
13+
* Install the {oc-first}.
14+
* You are logged in to the cluster as a user with `cluster-admin` privileges.
1515
* You have reduced the size of your cluster MTU by `46` bytes to allow for the overhead of the IPsec ESP header.
1616
1717
.Procedure
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ovn_kubernetes_network_provider/configuring-ipsec-ovn.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="nw-ovn-ipsec-north-south-enable_{context}"]
7+
= Enabling IPsec encryption for external IPsec endpoints
8+
9+
// This procedure requests installing Butane to prepare the machine config
10+
11+
As a cluster administrator, you can enable IPsec encryption between the cluster and external IPsec endpoints. Because this procedure uses Butane to create machine configs, you must have the `butane` command installed.
12+
13+
[NOTE]
14+
====
15+
After you apply the machine config, the Machine Config Operator reboots affected nodes in your cluster to rollout the new machine config.
16+
====
17+
18+
.Prerequisites
19+
20+
* Install the {oc-first}.
21+
* You are logged in to the cluster as a user with `cluster-admin` privileges.
22+
* You have reduced the size of your cluster MTU by `46` bytes to allow for the overhead of the IPsec ESP header.
23+
* You have installed the `butane` utility.
24+
* You have an existing PKCS#12 certificate for the IPsec endpoint and a CA cert in PEM format.
25+
26+
.Procedure
27+
28+
As a cluster administrator, you can enable IPsec support for external IPsec endpoints.
29+
30+
. Create an IPsec configuration file named `ipsec-endpoint-config.conf`. The configuration is consumed in the next step. For more information, see link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/securing_networks/configuring-a-vpn-with-ipsec_securing-networks#configuring-a-vpn-with-ipsec_securing-networks[Libreswan as an IPsec VPN implementation].
31+
32+
. Provide the following certificate files to add to the Network Security Services (NSS) database on each host. These files are imported as part of the Butane configuration in subsequent steps.
33+
+
34+
--
35+
* `left_server.p12`: The certificate bundle for the IPsec endpoints
36+
* `ca.pem`: The certificate authority that you signed your certificates with
37+
--
38+
39+
. Create a machine config to apply the IPsec configuration to your cluster by using the following two steps:
40+
41+
.. To add the IPsec configuration, create Butane config files for the control plane and worker nodes with the following contents:
42+
+
43+
[source,terminal,subs="attributes+"]
44+
----
45+
$ for role in master worker; do
46+
cat >> "99-ipsec-$\{role}-endpoint-config.bu" <<-EOF
47+
variant: openshift
48+
version: {product-version}.0
49+
metadata:
50+
name: 99-$\{role}-import-certs-enable-svc-os-ext
51+
labels:
52+
machineconfiguration.openshift.io/role: $role
53+
openshift:
54+
extensions:
55+
- ipsec
56+
systemd:
57+
units:
58+
- name: ipsec-import.service
59+
enabled: true
60+
contents: |
61+
[Unit]
62+
Description=Import external certs into ipsec NSS
63+
Before=ipsec.service
64+
65+
[Service]
66+
Type=oneshot
67+
ExecStart=/usr/local/bin/ipsec-addcert.sh
68+
RemainAfterExit=false
69+
StandardOutput=journal
70+
71+
[Install]
72+
WantedBy=multi-user.target
73+
- name: ipsecenabler.service
74+
enabled: true
75+
contents: |
76+
[Service]
77+
Type=oneshot
78+
ExecStart=systemctl enable --now ipsec.service
79+
80+
[Install]
81+
WantedBy=multi-user.target
82+
storage:
83+
files:
84+
- path: /etc/pki/certs/ca.pem
85+
mode: 0400
86+
overwrite: true
87+
contents:
88+
local: ca.pem
89+
- path: /etc/pki/certs/left_server.p12
90+
mode: 0400
91+
overwrite: true
92+
contents:
93+
local: left_server.p12
94+
- path: /usr/local/bin/ipsec-addcert.sh
95+
mode: 0740
96+
overwrite: true
97+
contents:
98+
inline: |
99+
#!/bin/bash -e
100+
echo "importing cert to NSS"
101+
certutil -A -n "CA" -t "CT,C,C" -d /var/lib/ipsec/nss/ -i /etc/pki/certs/ca.pem
102+
pk12util -W "" -i /etc/pki/certs/left_server.p12 -d /var/lib/ipsec/nss/
103+
certutil -M -n "left_server" -t "u,u,u" -d /var/lib/ipsec/nss/
104+
EOF
105+
done
106+
----
107+
108+
.. To transform the Butane files that you created in the previous step into machine configs, enter the following command:
109+
+
110+
[source,terminal]
111+
----
112+
$ for role in master worker; do
113+
butane 99-ipsec-${role}-endpoint-config.bu -o ./99-ipsec-$role-endpoint-config.yaml
114+
done
115+
----
116+
117+
. To apply the machine configs to your cluster, enter the following command:
118+
+
119+
[source,terminal]
120+
----
121+
$ for role in master worker; do
122+
oc apply -f 99-ipsec-${role}-endpoint-config.yaml
123+
done
124+
----
125+
+
126+
[IMPORTANT]
127+
====
128+
As the Machine Config Operator (MCO) updates machines in each machine config pool, it reboots each node one by one. You must wait until all the nodes are updated before external IPsec connectivity is available.
129+
====
130+
131+
. Check the machine config pool status by entering the following command:
132+
+
133+
[source,terminal]
134+
----
135+
$ oc get mcp
136+
----
137+
+
138+
A successfully updated node has the following status: `UPDATED=true`, `UPDATING=false`, `DEGRADED=false`.
139+
+
140+
[NOTE]
141+
====
142+
By default, the MCO updates one machine per pool at a time, causing the total time the migration takes to increase with the size of the cluster.
143+
====

modules/nw-ovn-ipsec-traffic.adoc

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
:_content-type: CONCEPT
66
[id="nw-ovn-ipsec-traffic_{context}"]
7-
= Types of network traffic flows encrypted by IPsec
7+
= Types of network traffic flows encrypted by pod-to-pod IPsec
88

99
With IPsec enabled, only the following network traffic flows between pods are encrypted:
1010

@@ -20,30 +20,3 @@ The following traffic flows are not encrypted:
2020
The encrypted and unencrypted flows are illustrated in the following diagram:
2121

2222
image::nw-ipsec-encryption.png[IPsec encrypted and unencrypted traffic flows]
23-
24-
== Network connectivity requirements when IPsec is enabled
25-
26-
You must configure the network connectivity between machines to allow {product-title} cluster
27-
components to communicate. Each machine must be able to resolve the hostnames
28-
of all other machines in the cluster.
29-
30-
.Ports used for all-machine to all-machine communications
31-
[cols="2a,2a,5a",options="header"]
32-
|===
33-
34-
|Protocol
35-
|Port
36-
|Description
37-
38-
.2+|UDP
39-
|`500`
40-
|IPsec IKE packets
41-
42-
|`4500`
43-
|IPsec NAT-T packets
44-
45-
|ESP
46-
|N/A
47-
|IPsec Encapsulating Security Payload (ESP)
48-
49-
|===
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ovn_kubernetes_network_provider/about-ipsec-ovn.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="network-connectivity-requirements-ipsec_{context}"]
7+
= Network connectivity requirements when IPsec is enabled
8+
9+
You must configure the network connectivity between machines to allow {product-title} cluster components to communicate. Each machine must be able to resolve the hostnames of all other machines in the cluster.
10+
11+
.Ports used for all-machine to all-machine communications
12+
[cols="2a,2a,5a",options="header"]
13+
|===
14+
15+
|Protocol
16+
|Port
17+
|Description
18+
19+
.2+|UDP
20+
|`500`
21+
|IPsec IKE packets
22+
23+
|`4500`
24+
|IPsec NAT-T packets
25+
26+
|ESP
27+
|N/A
28+
|IPsec Encapsulating Security Payload (ESP)
29+
30+
|===

networking/ovn_kubernetes_network_provider/configuring-ipsec-ovn.adoc

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,62 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
With IPsec enabled, all pod-to-pod network traffic between nodes on the OVN-Kubernetes cluster network is encrypted with IPsec _Transport mode_.
9+
With IPsec enabled, you can encrypt both internal pod-to-pod cluster traffic between nodes and external traffic between pods and IPsec endpoints external to your cluster. All pod-to-pod network traffic between nodes on the OVN-Kubernetes cluster network is encrypted with IPsec _Transport mode_.
1010

1111
IPsec is disabled by default. It can be enabled either during or after installing the cluster. For information about cluster installation, see xref:../../installing/index.adoc#ocp-installation-overview[{product-title} installation overview]. If you need to enable IPsec after cluster installation, you must first resize your cluster MTU to account for the overhead of the IPsec ESP IP header.
1212

13-
The following documentation describes how to enable and disable IPSec after cluster installation.
13+
[NOTE]
14+
====
15+
IPsec on IBM Cloud VPC supports only NAT-T. Using ESP is not supported.
16+
====
17+
18+
Use the procedures in the following documentation to:
19+
20+
* Enable and disable IPSec after cluster installation
21+
* Configure support for external IPsec endpoints outside the cluster
22+
* Verify that IPsec encrypts traffic between pods on different nodes
1423
1524
[id="{context}-prerequisites"]
1625
== Prerequisites
1726

1827
* You have decreased the size of the cluster MTU by `46` bytes to allow for the additional overhead of the IPsec ESP header. For more information on resizing the MTU that your cluster uses, see xref:../../networking/changing-cluster-network-mtu.adoc#changing-cluster-network-mtu[Changing the MTU for the cluster network].
1928

20-
include::modules/nw-ovn-ipsec-traffic.adoc[leveloffset=+1]
21-
include::modules/nw-ovn-ipsec-encryption.adoc[leveloffset=+1]
22-
include::modules/nw-ovn-ipsec-certificates.adoc[leveloffset=+1]
23-
include::modules/nw-ovn-ipsec-enable.adoc[leveloffset=+1]
24-
include::modules/nw-ovn-ipsec-verification.adoc[leveloffset=+1]
25-
include::modules/nw-ovn-ipsec-disable.adoc[leveloffset=+1]
29+
include::modules/nw-own-ipsec-required-ports.adoc[leveloffset=+1]
30+
31+
[id="{context}-pod-to-pod-ipsec"]
32+
== IPsec encryption for pod-to-pod traffic
33+
34+
{product-title} supports IPsec encryption for network traffic between pods.
35+
36+
include::modules/nw-ovn-ipsec-traffic.adoc[leveloffset=+2]
37+
include::modules/nw-ovn-ipsec-encryption.adoc[leveloffset=+2]
38+
include::modules/nw-ovn-ipsec-certificates.adoc[leveloffset=+2]
39+
include::modules/nw-ovn-ipsec-enable.adoc[leveloffset=+2]
40+
include::modules/nw-ovn-ipsec-verification.adoc[leveloffset=+2]
41+
include::modules/nw-ovn-ipsec-disable.adoc[leveloffset=+2]
42+
43+
[id="{context}-external-traffic-ipsec"]
44+
== IPsec encryption for external traffic
45+
46+
{product-title} supports IPsec encryption for traffic to external hosts.
47+
48+
You must supply a custom IPsec configuration, which includes the IPsec configuration file itself and TLS certificates.
49+
50+
Ensure that the following prohibitions are observed:
51+
52+
* The custom IPsec configuration must not include any connection specifications that might interfere with the cluster's pod-to-pod IPsec configuration.
53+
* Certificate common names (CN) in the provided certificate bundle must not begin with the `ovs_` prefix, because this naming can collide with pod-to-pod IPsec CN names in the Network Security Services (NSS) database of each node.
54+
55+
// Tech Preview
56+
:FeatureName: IPsec support for external endpoints
57+
include::snippets/technology-preview.adoc[]
58+
59+
include::modules/nw-ovn-ipsec-north-south-enable.adoc[leveloffset=+2]
2660

2761
[id="{context}_additional-resources"]
2862
== Additional resources
2963

3064
* xref:../../networking/ovn_kubernetes_network_provider/about-ovn-kubernetes.adoc#about-ovn-kubernetes[About the OVN-Kubernetes Container Network Interface (CNI) network plugin]
3165
* xref:../../networking/changing-cluster-network-mtu.adoc#changing-cluster-network-mtu[Changing the MTU for the cluster network]
66+
* xref:../../installing/install_config/installing-customizing.adoc#installation-special-config-butane-install_installing-customizing[Installing Butane]
3267
* xref:../../rest_api/operator_apis/network-operator-openshift-io-v1.adoc#network-operator-openshift-io-v1[Network [operator.openshift.io/v1]] API

0 commit comments

Comments
 (0)