This scenario describes integrating third-party components and has not been verified as part of Deckhouse Platform.
By default, Istio issues workload certificates for mTLS with its own certificate authority in istiod. To have certificates issued by an intermediate CA from Stronghold, use this chain:
- The Stronghold PKI secrets engine holds the intermediate CA for the mesh and a role for issuing SPIFFE certificates.
- cert-manager calls Stronghold through a
vaultIssuer, as described in cert-manager. - The istio-csr component of the cert-manager project accepts certificate requests from Istio proxies and issues them through cert-manager.
Goal
After the setup, Istio workload certificates for mTLS are issued by the intermediate CA in Stronghold instead of the built-in istiod CA.
Prerequisites
Before you start, prepare the following:
- The PKI secrets engine at the
pki_intpath with an intermediate CA, as in Internal PKI with Stronghold. - cert-manager in the cluster and the Kubernetes auth method in Stronghold, configured as in cert-manager.
- Istio installed in the cluster, and permissions to change its installation parameters.
- A Stronghold token with permissions to write PKI roles and policies.
Step 1. Configure Stronghold
Create a PKI role for workload certificates and allow cert-manager to sign requests for it.
Create a PKI role that allows SPIFFE URI SANs used by Istio:
d8 stronghold write pki_int/roles/istio-mesh allowed_uri_sans="spiffe://cluster.local/*" allow_any_name=true require_cn=false max_ttl=24hThe role sets a short
max_ttl: workload certificates are renewed automatically.Create a policy that allows signing requests for this role:
d8 stronghold policy write cert-manager-mesh - <<'POLICY' path "pki_int/sign/istio-mesh" { capabilities = ["create", "update"] } POLICYCreate a Kubernetes auth role with the
cert-manager-meshpolicy, as described in cert-manager. For a ClusterIssuer, the token audience in the role isvault://<CLUSTER_ISSUER_NAME>, in this examplevault://stronghold-mesh.
Step 2. Configure cert-manager and Istio
Connect istio-csr to Stronghold through a ClusterIssuer and switch Istio to istio-csr.
Create a
stronghold-meshClusterIssuer of typevaultwithpath: pki_int/sign/istio-mesh.Install istio-csr and set the
stronghold-meshClusterIssuer in its parameters. Example istio-csr Helm chart values:app: certmanager: issuer: name: stronghold-mesh kind: ClusterIssuer group: cert-manager.ioConfigure Istio to use istio-csr as its CA: set the istio-csr service address in
global.caAddressand disable the built-in istiod CA (ENABLE_CA_SERVER=false).
Proxies must trust the root certificate of the chain. It is the root-ca.pem file from Internal PKI with Stronghold. If the root CA is in the pki_root mount, read it from Stronghold:
d8 stronghold read -field=certificate pki_root/cert/caVerification
Check the result:
Check that the ClusterIssuer is ready:
d8 k get clusterissuer stronghold-meshThe
READYcolumn must showTrue.Check that Stronghold issues certificates for the mesh. The list of serial numbers in
pki_intmust grow as workloads start:d8 stronghold list pki_int/certs
Cleanup
Before you remove the integration, switch Istio back to the built-in istiod CA and remove istio-csr. Then delete the ClusterIssuer and the Stronghold objects:
d8 k delete clusterissuer stronghold-mesh
d8 stronghold delete pki_int/roles/istio-mesh
d8 stronghold policy delete cert-manager-meshAlso delete the Kubernetes auth role created in step 1.