Skip to content

Commit 839de66

Browse files
chore: Update importing-untrusted-tls-certificates article (#2805)
* chore: Update importing-untrusted-tls-certificates article Signed-off-by: Anatolii Bazko <abazko@redhat.com> * Update modules/administration-guide/pages/importing-untrusted-tls-certificates.adoc Co-authored-by: Jana Vrbkova <jvrbkova@redhat.com> --------- Signed-off-by: Anatolii Bazko <abazko@redhat.com> Co-authored-by: Jana Vrbkova <jvrbkova@redhat.com>
1 parent a8dcc29 commit 839de66

File tree

1 file changed

+17
-66
lines changed

1 file changed

+17
-66
lines changed

modules/administration-guide/pages/importing-untrusted-tls-certificates.adoc

Lines changed: 17 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ Therefore, you must import into {prod-short} all untrusted CA chains in use by a
1515
* An identity provider (OIDC)
1616
* A source code repositories provider (Git)
1717

18-
{prod-short} uses labeled config maps in {prod-short} {orch-namespace} as sources for TLS certificates.
19-
The config maps can have an arbitrary amount of keys with a random amount of certificates each.
18+
{prod-short} uses labeled ConfigMaps in {prod-short} {orch-namespace} as sources for TLS certificates.
19+
The ConfigMaps can have an arbitrary amount of keys with a random amount of certificates each. Operator merges all ConfigMaps into a single one titled `ca-certs-merged`, and mounts it as a volume in the {prod-short} server, dashboard and workspace pods.
20+
By default, the Operator mounts the `ca-certs-merged` ConfigMap in a user's workspace at two locations: `/public-certs` and `/etc/pki/ca-trust/extracted/pem`. The `/etc/pki/ca-trust/extracted/pem` directory is where the system stores extracted CA certificates for trusted certificate authorities on Red Hat (e.g., CentOS, Fedora). CLI tools automatically use certificates from the system-trusted locations, when the user's workspace is up and running.
2021

2122
[NOTE]
2223
====
2324
When an OpenShift cluster contains cluster-wide trusted CA certificates added through the link:https://docs.openshift.com/container-platform/latest/networking/configuring-a-custom-pki.html#nw-proxy-configure-object_configuring-a-custom-pki[cluster-wide-proxy configuration],
24-
{prod-short} Operator detects them and automatically injects them into a config map with the `config.openshift.io/inject-trusted-cabundle="true"` label.
25-
Based on this annotation, OpenShift automatically injects the cluster-wide trusted CA certificates inside the `ca-bundle.crt` key of the config map.
25+
{prod-short} Operator detects them and automatically injects them into a ConfigMap with the `config.openshift.io/inject-trusted-cabundle="true"` label.
26+
Based on this annotation, OpenShift automatically injects the cluster-wide trusted CA certificates inside the `ca-bundle.crt` key of the ConfigMap.
2627
====
2728

2829
.Prerequisites
@@ -42,7 +43,7 @@ See {orch-cli-link}.
4243
$ cat ca-cert-for-{prod-id-short}-*.pem | tr -d '\r' > custom-ca-certificates.pem
4344
----
4445

45-
. Create the `custom-ca-certificates` config map with the required TLS certificates:
46+
. Create the `custom-ca-certificates` ConfigMap with the required TLS certificates:
4647
+
4748
[subs="+attributes,+quotes"]
4849
----
@@ -51,7 +52,7 @@ $ {orch-cli} create configmap custom-ca-certificates \
5152
--namespace={prod-namespace}
5253
----
5354

54-
. Label the `custom-ca-certificates` config map:
55+
. Label the `custom-ca-certificates` ConfigMap:
5556
+
5657
[subs="+attributes,+quotes"]
5758
----
@@ -67,8 +68,8 @@ Otherwise, wait until the rollout of {prod-short} components finishes.
6768
. Restart running workspaces for the changes to take effect.
6869

6970
.Verification steps
70-
. Verify that the config map contains your custom CA certificates.
71-
This command returns your custom CA certificates in PEM format:
71+
. Verify that the ConfigMap contains your custom CA certificates.
72+
This command returns CA bundle certificates in PEM format:
7273
+
7374
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
7475
----
@@ -78,85 +79,35 @@ $ {orch-cli} get configmap \
7879
--selector=app.kubernetes.io/component=ca-bundle,app.kubernetes.io/part-of=che.eclipse.org
7980
----
8081

81-
. Verify {prod-short} pod contains a volume mounting the `ca-certs-merged` config map:
82-
+
83-
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
84-
----
85-
$ {orch-cli} get pod \
86-
--selector=app.kubernetes.io/component={prod-id-short} \
87-
--output='jsonpath={.items[0].spec.volumes[0:].configMap.name}' \
88-
--namespace={prod-namespace} \
89-
| grep ca-certs-merged
90-
----
91-
92-
. Verify the {prod-short} server container has your custom CA certificates.
93-
This command returns your custom CA certificates in PEM format:
94-
+
95-
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
96-
----
97-
$ {orch-cli} exec -t deploy/{prod-id-short} \
98-
--namespace={prod-namespace} \
99-
-- cat /public-certs/custom-ca-certificates.pem
100-
----
101-
10282
. Verify in the {prod-short} server logs that the imported certificates count is not null:
10383
+
10484
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
10585
----
10686
$ {orch-cli} logs deploy/{prod-id-short} --namespace={prod-namespace} \
107-
| grep custom-ca-certificates.pem
108-
----
109-
110-
. List the SHA256 fingerprints of your certificates:
111-
+
112-
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
113-
----
114-
$ for certificate in ca-cert*.pem ;
115-
do openssl x509 -in $certificate -digest -sha256 -fingerprint -noout | cut -d= -f2;
116-
done
117-
----
118-
119-
. Verify that {prod-short} server Java truststore contains certificates with the same fingerprint:
120-
+
121-
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
122-
----
123-
$ {orch-cli} exec -t deploy/{prod-id-short} --namespace={prod-namespace} -- \
124-
keytool -list -keystore {prod-home}/cacerts \
125-
| grep --after-context=1 custom-ca-certificates.pem
87+
| grep tls-ca-bundle.pem
12688
----
12789

12890
. Start a workspace, get the {orch-namespace} name in which it has been created: __<workspace_namespace>__, and wait for the workspace to be started.
12991

130-
. Verify that the `che-trusted-ca-certs` config map contains your custom CA certificates.
131-
This command returns your custom CA certificates in PEM format:
92+
. Verify that the `ca-certs-merged` ConfigMap contains your custom CA certificates.
93+
This command returns {prod-short} CA bundle certificates in PEM format:
13294
+
13395
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
13496
----
13597
$ {orch-cli} get configmap che-trusted-ca-certs \
13698
--namespace=__<workspace_namespace>__ \
137-
--output='jsonpath={.data.custom-ca-certificates\.custom-ca-certificates\.pem}'
99+
--output='jsonpath={.data.tls-ca-bundle\.pem}'
138100
----
139101

140-
. Verify that the workspace pod mounts the `che-trusted-ca-certs` config map:
102+
. Verify that the workspace pod mounts the `ca-certs-merged` ConfigMap:
141103
+
142104
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
143105
----
144106
$ {orch-cli} get pod \
145107
--namespace=__<workspace_namespace>__ \
146108
--selector='controller.devfile.io/devworkspace_name=__<workspace_name>__' \
147109
--output='jsonpath={.items[0:].spec.volumes[0:].configMap.name}' \
148-
| grep che-trusted-ca-certs
149-
----
150-
151-
. Verify that the `universal-developer-image` container (or the container defined in the workspace devfile) mounts the `che-trusted-ca-certs` volume:
152-
+
153-
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
154-
----
155-
$ {orch-cli} get pod \
156-
--namespace=__<workspace_namespace>__ \
157-
--selector='controller.devfile.io/devworkspace_name=__<workspace_name>__' \
158-
--output='jsonpath={.items[0:].spec.containers[0:]}' \
159-
| jq 'select (.volumeMounts[].name == "che-trusted-ca-certs") | .name'
110+
| grep ca-certs-merged
160111
----
161112

162113
. Get the workspace pod name __<workspace_pod_name>__:
@@ -170,13 +121,13 @@ $ {orch-cli} get pod \
170121
----
171122

172123
. Verify that the workspace container has your custom CA certificates.
173-
This command returns your custom CA certificates in PEM format:
124+
This command returns {prod-short} CA bundle certificates in PEM format:
174125
+
175126
[subs="+attributes,+quotes",options="nowrap",role=white-space-pre]
176127
----
177128
$ {orch-cli} exec __<workspace_pod_name>__ \
178129
--namespace=__<workspace_namespace>__ \
179-
-- cat /public-certs/custom-ca-certificates.custom-ca-certificates.pem
130+
-- cat /public-certs/tls-ca-bundle.pem
180131
----
181132

182133
.Additional resources

0 commit comments

Comments
 (0)