You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OSSM-3352: Split ossm-security-cert-manage file into 3 ossm-cert-cleanup, ossm-cert-manage-add, ossm-cert-manage-verify to bring file into compliance with current doc practices. No review is needed as only architectural change. Content has been previously reviewed and approved.
To use an existing signing (CA) certificate and key, you must create a chain of trust file that includes the CA certificate, key, and root certificate. You must use the following exact file names for each of the corresponding certificates. The CA certificate is named `ca-cert.pem`, the key is `ca-key.pem`, and the root certificate, which signs `ca-cert.pem`, is named `root-cert.pem`. If your workload uses intermediate certificates, you must specify them in a `cert-chain.pem` file.
10
+
11
+
. Save the example certificates from the link:https://github.com/maistra/istio/tree/maistra-{MaistraVersion}/samples/certs[Maistra repository] locally and replace `<path>` with the path to your certificates.
12
+
13
+
. Create a secret named `cacert` that includes the input files `ca-cert.pem`, `ca-key.pem`, `root-cert.pem` and `cert-chain.pem`.
. In the `ServiceMeshControlPlane` resource set `spec.security.dataPlane.mtls true` to `true` and configure the `certificateAuthority` field as shown in the following example. The default `rootCADir` is `/etc/cacerts`. You do not need to set the `privateKey` if the key and certs are mounted in the default location. {SMProductShortName} reads the certificates and key from the secret-mount files.
23
+
+
24
+
[source,yaml]
25
+
----
26
+
apiVersion: maistra.io/v2
27
+
kind: ServiceMeshControlPlane
28
+
spec:
29
+
security:
30
+
dataPlane:
31
+
mtls: true
32
+
certificateAuthority:
33
+
type: Istiod
34
+
istiod:
35
+
type: PrivateKey
36
+
privateKey:
37
+
rootCADir: /etc/cacerts
38
+
----
39
+
40
+
. After creating/changing/deleting the `cacert` secret, the {SMProductShortName} control plane `istiod` and `gateway` pods must be restarted so the changes go into effect. Use the following command to restart the pods:
Use the Bookinfo sample application to verify that the workload certificates are signed by the certificates that were plugged into the CA. This requires you have `openssl` installed on your machine
10
+
11
+
. To extract certificates from bookinfo workloads use the following command:
Copy file name to clipboardExpand all lines: modules/ossm-security-cert-manage.adoc
+1-167Lines changed: 1 addition & 167 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
//
3
3
// * service_mesh/v2x/ossm-security.adoc
4
4
5
+
:_content-type: CONCEPT
5
6
[id="ossm-cert-manage_{context}"]
6
7
= Adding an external certificate authority key and certificate
7
8
@@ -13,170 +14,3 @@ By default, {SMProductName} generates a self-signed root certificate and key and
13
14
* This example uses the certificates from the link:https://github.com/maistra/istio/tree/maistra-{MaistraVersion}/samples/certs[Maistra repository]. For production, use your own certificates from your certificate authority.
14
15
* Deploy the Bookinfo sample application to verify the results with these instructions.
15
16
* OpenSSL is required to verify certificates.
16
-
17
-
[id="ossm-cert-manage-add-cert-key_{context}"]
18
-
== Adding an existing certificate and key
19
-
20
-
To use an existing signing (CA) certificate and key, you must create a chain of trust file that includes the CA certificate, key, and root certificate. You must use the following exact file names for each of the corresponding certificates. The CA certificate is named `ca-cert.pem`, the key is `ca-key.pem`, and the root certificate, which signs `ca-cert.pem`, is named `root-cert.pem`. If your workload uses intermediate certificates, you must specify them in a `cert-chain.pem` file.
21
-
22
-
. Save the example certificates from the link:https://github.com/maistra/istio/tree/maistra-{MaistraVersion}/samples/certs[Maistra repository] locally and replace `<path>` with the path to your certificates.
23
-
24
-
. Create a secret named `cacert` that includes the input files `ca-cert.pem`, `ca-key.pem`, `root-cert.pem` and `cert-chain.pem`.
. In the `ServiceMeshControlPlane` resource set `spec.security.dataPlane.mtls true` to `true` and configure the `certificateAuthority` field as shown in the following example. The default `rootCADir` is `/etc/cacerts`. You do not need to set the `privateKey` if the key and certs are mounted in the default location. {SMProductShortName} reads the certificates and key from the secret-mount files.
34
-
+
35
-
[source,yaml]
36
-
----
37
-
apiVersion: maistra.io/v2
38
-
kind: ServiceMeshControlPlane
39
-
spec:
40
-
security:
41
-
dataPlane:
42
-
mtls: true
43
-
certificateAuthority:
44
-
type: Istiod
45
-
istiod:
46
-
type: PrivateKey
47
-
privateKey:
48
-
rootCADir: /etc/cacerts
49
-
----
50
-
51
-
. After creating/changing/deleting the `cacert` secret, the {SMProductShortName} control plane `istiod` and `gateway` pods must be restarted so the changes go into effect. Use the following command to restart the pods:
The Operator will automatically recreate the pods after they have been deleted.
59
-
60
-
. Restart the bookinfo application pods so that the sidecar proxies pick up the secret changes. Use the following command to restart the pods:
61
-
+
62
-
[source,terminal]
63
-
----
64
-
$ oc -n bookinfo delete pods --all
65
-
----
66
-
+
67
-
You should see output similar to the following:
68
-
+
69
-
70
-
[source,terminal]
71
-
----
72
-
pod "details-v1-6cd699df8c-j54nh" deleted
73
-
pod "productpage-v1-5ddcb4b84f-mtmf2" deleted
74
-
pod "ratings-v1-bdbcc68bc-kmng4" deleted
75
-
pod "reviews-v1-754ddd7b6f-lqhsv" deleted
76
-
pod "reviews-v2-675679877f-q67r2" deleted
77
-
pod "reviews-v3-79d7549c7-c2gjs" deleted
78
-
----
79
-
80
-
. Verify that the pods were created and are ready with the following command:
81
-
+
82
-
83
-
[source,terminal]
84
-
----
85
-
$ oc get pods -n bookinfo
86
-
----
87
-
88
-
[id="ossm-cert-manage-verify-cert_{context}"]
89
-
== Verifying your certificates
90
-
91
-
Use the Bookinfo sample application to verify that the workload certificates are signed by the certificates that were plugged into the CA. This requires you have `openssl` installed on your machine
92
-
93
-
. To extract certificates from bookinfo workloads use the following command:
0 commit comments