Skip to content

Commit 26e25b1

Browse files
authored
Merge pull request #96542 from dfitzmau/OCPBUGS-22844
OCPBUGS-22844: Added pk12util tool command to the nw-ovn-ipsec-north-…
2 parents 3deb08f + 5b11f41 commit 26e25b1

File tree

3 files changed

+66
-52
lines changed

3 files changed

+66
-52
lines changed

modules/nw-ovn-ipsec-north-south-enable.adoc

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@
66
[id="nw-ovn-ipsec-north-south-enable_{context}"]
77
= Configuring IPsec encryption for external traffic
88

9-
As a cluster administrator, to encrypt external traffic with IPsec you must configure IPsec for your network infrastructure, including providing PKCS#12 certificates. Because this procedure uses Butane to create machine configs, you must have the `butane` command installed.
9+
[role="_abstract"]
10+
As a cluster administrator, to encrypt external traffic with IPsec you must configure IPsec for your network infrastructure, including providing PKCS#12 certificates. Because this procedure uses Butane to create machine configs, you must have the `butane` tool installed.
1011

1112
[NOTE]
1213
====
13-
After you apply the machine config, the Machine Config Operator reboots affected nodes in your cluster to rollout the new machine config.
14+
After you apply the machine config, the Machine Config Operator (MCO) reboots affected nodes in your cluster to rollout the new machine config.
1415
====
1516

1617
.Prerequisites
1718

1819
* Install the {oc-first}.
19-
* You have installed the `butane` utility on your local computer.
20+
* You have installed the `butane` tool on your local computer.
2021
* You have installed the NMState Operator on the cluster.
2122
* You logged in to the cluster as a user with `cluster-admin` privileges.
22-
* You have an existing PKCS#12 certificate for the IPsec endpoint and a CA cert in PEM format.
23+
* You have an existing PKCS#12 certificate for the IPsec endpoint and a CA cert in Privacy Enhanced Mail (PEM) format.
2324
* You enabled IPsec in either `Full` or `External` mode on your cluster.
2425
* You must set the `routingViaHost` parameter to `true` in the `ovnKubernetesConfig.gatewayConfig` specification of the OVN-Kubernetes network plugin.
2526
2627
.Procedure
2728

28-
. Create an IPsec configuration with an NMState Operator node network configuration policy. For more information, see link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/securing_networks/configuring-a-vpn-connection_securing-networks#libreswan-as-an-ipsec-vpn-implementation_configuring-a-vpn-with-ipsec[Libreswan as an IPsec VPN implementation].
29-
29+
. Create an IPsec configuration with an NMState Operator node network configuration policy. For more information, see link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/setting-up-an-ipsec-vpn_configuring-and-managing-networking#configuring-an-ipsec-based-vpn-connection-by-using-nmstatectl_setting-up-an-ipsec-vpn[Configuring an IPsec based VPN connection by using nmstatectl].
30+
+
3031
.. To identify the IP address of the cluster node that is the IPsec endpoint, enter the following command:
3132
+
3233
----
3334
$ oc get nodes
3435
----
35-
36-
.. Create a file named `ipsec-config.yaml` that contains a node network configuration policy for the NMState Operator, such as in the following examples. For an overview about `NodeNetworkConfigurationPolicy` objects, see link:https://nmstate.io/kubernetes-nmstate/[The Kubernetes NMState project].
3736
+
38-
--
37+
.. Create a file named `ipsec-config.yaml` that has a node network configuration policy for the NMState Operator, such as in the following examples. For an overview about `NodeNetworkConfigurationPolicy` objects, see link:https://nmstate.io/kubernetes-nmstate/[The Kubernetes NMState project].
38+
+
3939
.Example NMState IPsec transport configuration
4040
[source,yaml]
4141
----
@@ -45,30 +45,33 @@ metadata:
4545
name: ipsec-config
4646
spec:
4747
nodeSelector:
48-
kubernetes.io/hostname: "<hostname>" <1>
48+
kubernetes.io/hostname: "<hostname>"
4949
desiredState:
5050
interfaces:
51-
- name: <interface_name> <2>
51+
- name: <interface_name>
5252
type: ipsec
5353
libreswan:
54-
left: <cluster_node> <3>
54+
left: <cluster_node>
5555
leftid: '%fromcert'
5656
leftrsasigkey: '%cert'
5757
leftcert: left_server
5858
leftmodecfgclient: false
59-
right: <external_host> <4>
59+
right: <external_host>
6060
rightid: '%fromcert'
6161
rightrsasigkey: '%cert'
62-
rightsubnet: <external_address>/32 <5>
62+
rightsubnet: <external_address>/32
6363
ikev2: insist
6464
type: transport
6565
----
66-
<1> Specifies the host name to apply the policy to. This host serves as the left side host in the IPsec configuration.
67-
<2> Specifies the name of the interface to create on the host.
68-
<3> Specifies the host name of the cluster node that terminates the IPsec tunnel on the cluster side. The name should match SAN `[Subject Alternate Name]` from your supplied PKCS#12 certificates.
69-
<4> Specifies the external host name, such as `host.example.com`. The name should match the SAN `[Subject Alternate Name]` from your supplied PKCS#12 certificates.
70-
<5> Specifies the IP address of the external host, such as `10.1.2.3/32`.
71-
66+
+
67+
where:
68+
+
69+
`kubernetes.io/hostname`:: Specifies the hostname to apply the policy to. This host serves as the left side host in the IPsec configuration.
70+
`name`:: Specifies the name of the interface to create on the host.
71+
`left`:: Specifies the hostname of the cluster node that terminates the IPsec tunnel on the cluster side. The name must match the SAN `[Subject Alternate Name]` from your supplied PKCS#12 certificates.
72+
`right`:: Specifies the external hostname, such as `host.example.com`. The name should match the SAN `[Subject Alternate Name]` from your supplied PKCS#12 certificates.
73+
`rightsubnet`:: Specifies the IP address of the external host, such as `10.1.2.3/32`.
74+
+
7275
.Example NMState IPsec tunnel configuration
7376
[source,yaml]
7477
----
@@ -78,48 +81,56 @@ metadata:
7881
name: ipsec-config
7982
spec:
8083
nodeSelector:
81-
kubernetes.io/hostname: "<hostname>" <1>
84+
kubernetes.io/hostname: "<hostname>"
8285
desiredState:
8386
interfaces:
84-
- name: <interface_name> <2>
87+
- name: <interface_name>
8588
type: ipsec
8689
libreswan:
87-
left: <cluster_node> <3>
90+
left: <cluster_node>
8891
leftid: '%fromcert'
8992
leftmodecfgclient: false
9093
leftrsasigkey: '%cert'
9194
leftcert: left_server
92-
right: <external_host> <4>
95+
right: <external_host>
9396
rightid: '%fromcert'
9497
rightrsasigkey: '%cert'
95-
rightsubnet: <external_address>/32 <5>
98+
rightsubnet: <external_address>/32
9699
ikev2: insist
97100
type: tunnel
98101
----
99-
<1> Specifies the host name to apply the policy to. This host serves as the left side host in the IPsec configuration.
100-
<2> Specifies the name of the interface to create on the host.
101-
<3> Specifies the host name of the cluster node that terminates the IPsec tunnel on the cluster side. The name should match SAN `[Subject Alternate Name]` from your supplied PKCS#12 certificates.
102-
<4> Specifies the external host name, such as `host.example.com`. The name should match the SAN `[Subject Alternate Name]` from your supplied PKCS#12 certificates.
103-
<5> Specifies the IP address of the external host, such as `10.1.2.3/32`.
104-
--
105-
102+
+
106103
.. To configure the IPsec interface, enter the following command:
107104
+
108105
[source,terminal]
109106
----
110107
$ oc create -f ipsec-config.yaml
111108
----
112109

113-
. 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 later steps.
110+
. Give 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 the next steps.
114111
+
115-
--
116112
* `left_server.p12`: The certificate bundle for the IPsec endpoints
117113
* `ca.pem`: The certificate authority that you signed your certificates with
118-
--
119114

120-
. Create a machine config to add your certificates to the cluster:
115+
. Create a machine config to add your certificates to the cluster.
121116

122-
.. To create Butane config files for the control plane and worker nodes, enter the following command:
117+
. Read the password from a mounted secret file:
118+
+
119+
[source,terminal]
120+
----
121+
$ password=$(cat run/secrets/<left_server_password>)
122+
----
123+
+
124+
* `left_server_password`:: The name of the file that contains the password. This file exists in the mounted secret.
125+
126+
. Use the `pk12util` tool, which comes prepackaged with {op-system-base-full}, to specify a password that protects `PKCS#12` files by entering the following command. Ensure that you replace the `<password>` value with your password.
127+
+
128+
[source,terminal]
129+
----
130+
$ pk12util -W "<password>" -i /etc/pki/certs/left_server.p12 -d /var/lib/ipsec/nss/
131+
----
132+
133+
. To create Butane config files for the control plane and compute nodes, enter the following command:
123134
+
124135
[NOTE]
125136
====
@@ -179,7 +190,7 @@ EOF
179190
done
180191
----
181192

182-
.. To transform the Butane files that you created in an earlier step into machine configs, enter the following command:
193+
. To transform the Butane files that you created in the earlier step into machine configs, enter the following command:
183194
+
184195
[source,terminal]
185196
----
@@ -199,9 +210,11 @@ done
199210
+
200211
[IMPORTANT]
201212
====
202-
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 to update before external IPsec connectivity is available.
213+
As the Machine Config Operator (MCO) updates machines in each machine config pool, it reboots each node one by one. You must wait for all the nodes to update before external IPsec connectivity is available.
203214
====
204215

216+
.Verification
217+
205218
. Check the machine config pool status by entering the following command:
206219
+
207220
[source,terminal]
@@ -217,6 +230,7 @@ By default, the MCO updates one machine per pool at a time, causing the total ti
217230
====
218231

219232
. To confirm that IPsec machine configs rolled out successfully, enter the following commands:
233+
+
220234
.. Confirm the creation of the IPsec machine configs:
221235
+
222236
[source,terminal]
@@ -230,22 +244,17 @@ $ oc get mc | grep ipsec
230244
80-ipsec-master-extensions 3.2.0 6d15h
231245
80-ipsec-worker-extensions 3.2.0 6d15h
232246
----
233-
234-
.. Confirm the application of the IPsec extension to control plane nodes. Example output would show `2`.
247+
+
248+
.. Confirm you have applied the IPsec extension to control plane nodes:
235249
+
236250
[source,terminal]
237251
----
238252
$ oc get mcp master -o yaml | grep 80-ipsec-master-extensions -c
239253
----
240-
254+
+
241255
.. Confirm the application of the IPsec extension to compute nodes. Example output would show `2`.
242256
+
243257
[source,terminal]
244258
----
245259
$ oc get mcp worker -o yaml | grep 80-ipsec-worker-extensions -c
246260
----
247-
248-
[role="_additional-resources"]
249-
.Additional resources
250-
251-
* For more information about the nmstate IPsec API, see link:https://nmstate.io/devel/yaml_api.html#ipsec-encryption[IPsec Encryption]

networking/network_security/configuring-ipsec-ovn.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The following list outlines key tasks in the IPsec documentation:
3939
include::modules/nw-own-ipsec-modes.adoc[leveloffset=+1]
4040

4141
// Uses xrefs, so must be located here
42-
[id="{context}-prerequisites"]
42+
[id="prerequisites_{context}"]
4343
== Prerequisites
4444

4545
For IPsec support for encrypting traffic to external hosts, ensure that you meet the following prerequisites:
@@ -59,7 +59,7 @@ These prerequisites are required to add certificates into the host NSS database
5959

6060
include::modules/nw-own-ipsec-required-ports.adoc[leveloffset=+1]
6161

62-
[id="{context}-pod-to-pod-ipsec"]
62+
[id="pod-to-pod-ipsec_{context}"]
6363
== IPsec encryption for pod-to-pod traffic
6464

6565
For IPsec encryption of pod-to-pod traffic, the following sections describe which specific pod-to-pod traffic is encrypted, what kind of encryption protocol is used, and how X.509 certificates are handled. These sections do not apply to IPsec encryption between the cluster and external hosts, which you must configure manually for your specific external network infrastructure.
@@ -82,13 +82,19 @@ include::modules/nw-ovn-ipsec-enable.adoc[leveloffset=+1]
8282
// Configuring IPsec encryption for external traffic
8383
include::modules/nw-ovn-ipsec-north-south-enable.adoc[leveloffset=+1]
8484

85+
[role="_additional-resources"]
86+
[id="additional-resources_{context}"]
87+
== Additional resources
88+
89+
* link:https://nmstate.io/devel/yaml_api.html#ipsec-encryption[IPsec Encryption]
90+
8591
// Disabling IPsec encryption for an external IPsec endpoint
8692
include::modules/nw-ovn-ipsec-north-south-disable.adoc[leveloffset=+1]
8793

8894
// Disabling IPsec encryption
8995
include::modules/nw-ovn-ipsec-disable.adoc[leveloffset=+1]
9096

91-
[id="{context}_additional-resources"]
97+
[role="_additional-resources"]
9298
== Additional resources
9399

94100
* link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/configuring_and_managing_networking/setting-up-an-ipsec-vpn[Configuring a VPN with IPsec] in {op-system-base-full} 10

networking/network_security/zero-trust-networking.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
109
Zero trust is an approach to designing security architectures based on the premise that every interaction begins in an untrusted state. This contrasts with traditional architectures, which might determine trustworthiness based on whether communication starts inside a firewall. More specifically, zero trust attempts to close gaps in security architectures that rely on implicit trust models and one-time authentication.
1110

1211
{product-title} can add some zero trust networking capabilities to containers running on the platform without requiring changes to the containers or the software running in them. There are also several products that Red Hat offers that can further augment the zero trust networking capabilities of containers. If you have the ability to change the software running in the containers, then there are other projects that Red Hat supports that can add further capabilities.
@@ -30,7 +29,7 @@ Ensure that all traffic on the wire is encrypted and the endpoints are identifia
3029

3130
Leverage:
3231

33-
* {product-title}: With transparent xref:../../networking/network_security/configuring-ipsec-ovn.adoc#configuring-ipsec-ovn-pod-to-pod-ipsec[pod-to-pod IPsec], the source and destination of the traffic can be identified by the IP address. There is the capability for egress traffic to be xref:../../networking/network_security/configuring-ipsec-ovn.adoc#nw-ovn-ipsec-north-south-enable_configuring-ipsec-ovn[encrypted using IPsec]. By using the xref:../../networking/ovn_kubernetes_network_provider/configuring-egress-ips-ovn.adoc#configuring-egress-ips-ovn[egress IP] feature, the source IP address of the traffic can be used to identify the source of the traffic inside the cluster.
32+
* {product-title}: With transparent xref:../../networking/network_security/configuring-ipsec-ovn.adoc#pod-to-pod-ipsec_configuring-ipsec-ovn[pod-to-pod IPsec], the source and destination of the traffic can be identified by the IP address. There is the capability for egress traffic to be xref:../../networking/network_security/configuring-ipsec-ovn.adoc#nw-ovn-ipsec-north-south-enable_configuring-ipsec-ovn[encrypted using IPsec]. By using the xref:../../networking/ovn_kubernetes_network_provider/configuring-egress-ips-ovn.adoc#configuring-egress-ips-ovn[egress IP] feature, the source IP address of the traffic can be used to identify the source of the traffic inside the cluster.
3433
* xref:../../service_mesh/v2x/ossm-about.adoc#ossm-about[{SMProductName}]: Provides powerful xref:../../service_mesh/v2x/ossm-security.adoc#ossm-security-mtls_ossm-security[mTLS capabilities] that can transparently augment traffic leaving a pod to provide authentication and encryption.
3534
* xref:../../security/cert_manager_operator/index.adoc#cert-manager-operator-about[OpenShift cert-manager Operator]: Use custom resource definitions (CRDs) to request certificates that can be mounted for your programs to use for SSL/TLS protocols.
3635

0 commit comments

Comments
 (0)