|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * security/cert_manager_operator/cert-manager-operator-proxy.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="zero-trust-manager-proxy-support_{context}"] |
| 7 | += Injecting a custom CA certificate for the {zero-trust-full} |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +Inject certificate authority (CA) certificates into the {zero-trust-full} to support proxying HTTPS connections. This configuration helps ensure that the Identity Manager can communicate securely when you enable a cluster-wide proxy. |
| 11 | + |
| 12 | +.Prerequisites |
| 13 | + |
| 14 | +* You have access to the cluster as a user with the `cluster-admin` role. |
| 15 | +
|
| 16 | +* You have enabled the cluster-wide proxy for {product-title}. |
| 17 | +
|
| 18 | +* You have installed {zero-trust-full} 1.0.0 or later. |
| 19 | +
|
| 20 | +* You have deployed the SPIRE Server, SPIRE Agent, SPIFFEE CSI Driver, and the SPIRE OIDC Discovery Provider operands in the cluster. |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +. Create a config map in the `zero-trust-workload-identity-manager` namespace by running the following command: |
| 25 | ++ |
| 26 | +[source,terminal] |
| 27 | +---- |
| 28 | +$ oc create configmap trusted-ca -n zero-trust-workload-identity-manager |
| 29 | +---- |
| 30 | + |
| 31 | +. Inject the CA bundle that is trusted by {product-title} into the config map by running the following command: |
| 32 | ++ |
| 33 | +[source,terminal] |
| 34 | +---- |
| 35 | +$ oc label cm trusted-ca config.openshift.io/inject-trusted-cabundle=true -n zero-trust-workload-identity-manager |
| 36 | +---- |
| 37 | + |
| 38 | +. Update the subscription for the {zero-trust-full} to use the config map by running the following command: |
| 39 | ++ |
| 40 | +[source,terminal] |
| 41 | +---- |
| 42 | +$ oc -n zero-trust-workload-identity-manager patch subscription openshift-zero-trust-workload-identity-manager --type='merge' -p '{"spec":{"config":{"env":[{"name":"TRUSTED_CA_BUNDLE_CONFIGMAP","value":"trusted-ca"}]}}}' |
| 43 | +---- |
| 44 | + |
| 45 | +.Verification |
| 46 | + |
| 47 | +. Verify that the operands have finished rolling out by running the following command: |
| 48 | ++ |
| 49 | +[source,terminal] |
| 50 | +---- |
| 51 | +$ oc rollout status deployment/zero-trust-workload-identity-manager-controller-manager -n zero-trust-workload-identity-manager && \ |
| 52 | +$ oc rollout status statefulset/spireserver -n zero-trust-workload-identity-manager && \ |
| 53 | +$ oc rollout status daemonset/spire-agent -n zero-trust-workload-identity-manager && \ |
| 54 | +$ oc rollout status deployment/spire-spiffe-oidc-discovery-provider -n zero-trust-workload-identity-manager |
| 55 | +---- |
| 56 | ++ |
| 57 | +.Example output |
| 58 | +[source,terminal] |
| 59 | +---- |
| 60 | +deployment "zero-trust-workload-identity-manager-controller-manager" successfully rolled out |
| 61 | +statefulset "spire-server" successfully rolled out |
| 62 | +daemonset "spire-agent" successfully rolled out |
| 63 | +deployment "spire-spiffe-oidc-discovery-provider" successfully rolled out |
| 64 | +---- |
| 65 | + |
| 66 | +. Verify that the CA bundle was mounted as a volume by running the following command: |
| 67 | ++ |
| 68 | +[source,terminal] |
| 69 | +---- |
| 70 | +$ oc get deployment zero-trust-workload-identity-manager -n zero-trust-workload-identity-manager -o=jsonpath={.spec.template.spec.'containers[0].volumeMounts'} |
| 71 | +---- |
| 72 | ++ |
| 73 | +[source,terminal] |
| 74 | +---- |
| 75 | +$ oc get statefulset spire-server -n zero-trust-workload-identity-manager -o jsonpath='{.spec.template.spec.containers[*].volumeMounts[?(@.name=="trusted-ca-bundle")]}' |
| 76 | +---- |
| 77 | ++ |
| 78 | +[source,terminal] |
| 79 | +---- |
| 80 | +$ oc get daemonset spire-agent -n zero-trust-workload-identity-manager -o jsonpath='{.spec.template.spec.containers[*].volumeMounts[?(@.name=="trusted-ca-bundle")]}' |
| 81 | +---- |
| 82 | ++ |
| 83 | +[source,terminal] |
| 84 | +---- |
| 85 | +$ oc get daemonset spire-spiffe-csi-driver -n zero-trust-workload-identity-manager -o jsonpath='{.spec.template.spec.containers[*].volumeMounts[?(@.name=="trusted-ca-bundle")]}' |
| 86 | +---- |
| 87 | ++ |
| 88 | +.Example output |
| 89 | +[source,terminal] |
| 90 | +---- |
| 91 | +[{{"mountPath":"/etc/pki/ca-trust/extracted/pem","name":"trusted-ca-bundle","readOnly":true}] |
| 92 | +---- |
| 93 | + |
| 94 | +. Verify that the source of the CA bundle is the `trusted-ca` config map by running the following command: |
| 95 | ++ |
| 96 | +[source,terminal] |
| 97 | +---- |
| 98 | +$ oc get deployment zero-trust-workload-identity-manager -n zero-trust-workload-identity-manager -o=jsonpath={.spec.template.spec.volumes} |
| 99 | +---- |
| 100 | ++ |
| 101 | +[source,terminal] |
| 102 | +---- |
| 103 | +$ oc get statefulset spire-server -n zero-trust-workload-identity-manager -o=jsonpath='{.spec.template.spec.volumes}' | jq '.[] | select(.name=="trusted-ca-bundle")' |
| 104 | +---- |
| 105 | ++ |
| 106 | +[source,terminal] |
| 107 | +---- |
| 108 | +$ oc get daemonset spire-agent -n zero-trust-workload-identity-manager -o=jsonpath='{.spec.template.spec.volumes}' | jq '.[] | select(.name=="trusted-ca-bundle")' |
| 109 | +---- |
| 110 | ++ |
| 111 | +[source,terminal] |
| 112 | +---- |
| 113 | +$ oc get deployment spire-spiffe-oidc-discovery-provider -n zero-trust-workload-identity-manager -o=jsonpath='{.spec.template.spec.volumes}' | jq '.[] | select(.name=="trusted-ca-bundle")' |
| 114 | +---- |
| 115 | ++ |
| 116 | +.Example output |
| 117 | +[source,terminal] |
| 118 | +---- |
| 119 | +{ |
| 120 | + "configMap": { |
| 121 | + "defaultMode": 420, |
| 122 | + "items": [ |
| 123 | + { |
| 124 | + "key": "ca-bundle.crt", |
| 125 | + "path": "tls-ca-bundle.pem" |
| 126 | + } |
| 127 | + ], |
| 128 | + "name": "trusted-ca" |
| 129 | + }, |
| 130 | + "name": "trusted-ca-bundle" |
| 131 | +} |
| 132 | +---- |
0 commit comments