|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * security/zer_trust_workload_identity_manager/zero-trust-manager.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="zero-trust-manager-configure-cert-vault_{context}"] |
| 7 | += Configuring the Vault plugin |
| 8 | + |
| 9 | +This procedure outlines the steps required to configure a SPIRE server to obtain its intermediate signing certificates from Vault. The plugin supports the following methodes for authenticating to Vault: |
| 10 | + |
| 11 | +* Client Certificate Authentication |
| 12 | +
|
| 13 | +* Token Authentication |
| 14 | +
|
| 15 | +* AppRole Authentication |
| 16 | +
|
| 17 | +* Kubernetes Authentication |
| 18 | +
|
| 19 | +.Prerequisites |
| 20 | + |
| 21 | +* A running and accessible HashiCorp Vault server is available. |
| 22 | +
|
| 23 | +* A PKI secret engine must be enabled and configured in Vault at the specified `pki_mount_point`. |
| 24 | +
|
| 25 | +* A role within the Vault PKI engine must be configured to allow issuing of intermediate CA certificates. |
| 26 | +
|
| 27 | +* The Vault token or authentication method used by the plugin must have the necessary permissions. |
| 28 | +
|
| 29 | +* The `ca_ttl` configured in your SPIRE Server configuration must be less than or equal to the cofigured `max_lease_ttl` of the Vault PKI secret engine role that the plugin uses. |
| 30 | +
|
| 31 | +
|
| 32 | +
|
| 33 | +.Procedure |
| 34 | + |
| 35 | +. Create a YAML file containing the configuration for the `SpireServer` resource, for example `spireserver.yaml`. The file includes the `spec` block and the `upstreamAuthority` block configured to use the `vault` plugin. |
| 36 | ++ |
| 37 | +.Example `spireserver.yaml` |
| 38 | ++ |
| 39 | +[source,yaml] |
| 40 | +---- |
| 41 | +apiVersion: spire.spiffe.io/v1alpha1 |
| 42 | +kind: SpireServer |
| 43 | +metadata: |
| 44 | + name: spire-server |
| 45 | + namespace: spire |
| 46 | +spec: |
| 47 | + replicas: 1 |
| 48 | + # ... other SpireServer configuration ... |
| 49 | + upstreamAuthority: |
| 50 | + vault: |
| 51 | + address: "https://vault.example.com" <1> |
| 52 | + tokenPath: "/var/run/secrets/kubernetes.io/serviceaccount/token" <2> |
| 53 | + mtls: |
| 54 | + spireTrustDomain: "spiffe://example.org" <3> |
| 55 | + serverName: "vault.example.com" <4> |
| 56 | + pkcs11: <5> |
| 57 | + # ... PKCS11 configuration if needed ... |
| 58 | + jwt: <5> |
| 59 | + # ... JWT configuration if needed ... |
| 60 | +---- |
| 61 | + |
| 62 | +<1> The URL of your Vault server. |
| 63 | +<2> The path to the Kubernetes service account token used for authentication with Vault. |
| 64 | +<3> The trust domain of your Spire Server. |
| 65 | +<4> The name used for the Mutual Transport Layer Security (mTLS) authentication with the Vault server. |
| 66 | +<5> Alternative authentication methods with Vault. |
| 67 | + |
| 68 | +. Configure one of the authentication methods: |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +. Apply the configuration by running the following command: |
| 73 | ++ |
| 74 | +[source, terminal] |
| 75 | +---- |
| 76 | +$ oc apply -f spireserver.yaml |
| 77 | +---- |
0 commit comments