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
Copy file name to clipboardExpand all lines: modules/ossm-security-cert-manage.adoc
+64-42Lines changed: 64 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,16 @@ By default, {SMProductName} generates a self-signed root certificate and key and
12
12
* Install {SMProductName} with mutual TLS enabled to configure certificates.
13
13
* 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
14
* Deploy the Bookinfo sample application to verify the results with these instructions.
15
+
* OpenSSL is required to verify certificates.
15
16
16
17
[id="ossm-cert-manage-add-cert-key_{context}"]
17
18
== Adding an existing certificate and key
18
19
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.
20
21
21
-
Add the certificates to {SMProductShortName} by following these steps. 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.
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.
22
23
23
-
. Create a secret `cacert` that includes the input files `ca-cert.pem`, `ca-key.pem`, `root-cert.pem` and `cert-chain.pem`.
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 your certificateAuthority like 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.
33
+
. 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.
33
34
+
34
35
[source,yaml]
35
36
----
@@ -44,97 +45,117 @@ spec:
44
45
istiod:
45
46
type: PrivateKey
46
47
privateKey:
47
-
rootCADir: /etc/cacerts
48
+
rootCADir: /etc/cacerts
48
49
----
49
50
50
-
[id="ossm-cert-manage-verify-cert_{context}"]
51
-
== Verifying your certificates
52
-
53
-
Use the Bookinfo sample application to verify your certificates are mounted correctly. First, retrieve the mounted certificates. Then, verify the certificates mounted on the pod.
54
-
55
-
. Store the pod name in the variable `RATINGSPOD`.
51
+
. After creating/changing/deleting the `cacert` secret, the control plane `istiod` and `gateway` pods must be restarted so the changes go into effect. Use the following command to restart the pods:
56
52
+
57
53
[source,terminal]
58
54
----
59
-
$ RATINGSPOD=`oc get pods -l app=ratings -o jsonpath='{.items[0].metadata.name}'`
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