Skip to content

Commit 603d9f3

Browse files
committed
docs: document CA-only SecretClass for TLS server verification
1 parent d46043b commit 603d9f3

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: secrets.stackable.tech/v1alpha1
3+
kind: SecretClass
4+
metadata:
5+
name: ldap-tls-ca
6+
spec:
7+
backend:
8+
autoTls:
9+
ca:
10+
secret:
11+
name: ldap-tls-ca # <1>
12+
namespace: default
13+
autoGenerate: false # <2>

docs/modules/secret-operator/pages/secretclass.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,31 @@ CAUTION: Attributes of the certificate (such as the expiration date, fingerprint
4040

4141
xref:scope.adoc[Scopes] are used to populate the claims (such as `subjectAlternateName`) of the provisioned certificates.
4242

43+
[#backend-autotls-byo-ca]
44+
==== Providing your own certificate authority
45+
46+
Instead of letting the Secret Operator generate a certificate authority, you can provide your own.
47+
A common reason to do this is verifying the TLS certificate of an external service such as an LDAP or S3 server: you create a SecretClass that holds that service's CA certificate and reference it from the product CRD (see xref:concepts:tls-server-verification.adoc[]).
48+
49+
Store the CA certificate (in PEM format) in a Secret under the key `ca.crt`:
50+
51+
[source,bash]
52+
----
53+
kubectl create secret generic ldap-tls-ca --from-file=ca.crt=/path/to/ca.crt
54+
----
55+
56+
Then reference that Secret from a SecretClass and set `autoGenerate: false`:
57+
58+
[source,yaml]
59+
----
60+
include::example$secretclass-byo-ca.yaml[]
61+
----
62+
<1> The Secret created above. It must contain the CA certificate under the key `ca.crt`.
63+
<2> Disable CA generation so that the provided CA is used as-is instead of generating a new one.
64+
65+
When the SecretClass is only used to *verify* servers and does not issue any certificates, the Secret needs nothing but `ca.crt`, the `ca.key` entry can be omitted.
66+
If you also want the Secret Operator to issue certificates signed by this CA, the Secret must additionally contain the private key under `ca.key`.
67+
4368
[#backend-tls-certificate-key-pair-generation]
4469
==== `TLS certificate key pair generation`
4570

@@ -132,6 +157,7 @@ spec:
132157
`autoTls.ca`:: Configures the certificate authority used to issue `Pod` certificates.
133158
`autoTls.ca.secret`:: Reference (`name` and `namespace`) to a K8s `Secret` object where the CA certificate and key is stored in the keys `ca.crt`
134159
and `ca.key` respectively.
160+
When the SecretClass is only used to verify servers (see xref:#backend-autotls-byo-ca[]), only `ca.crt` is required and `ca.key` may be omitted.
135161
`autoTls.ca.autoGenerate`:: Whether the certificate authority should be provisioned and managed by the Secret Operator.
136162
`autoTls.ca.caCertificateLifetime` :: The lifetime of the certificate authority's root certificate.
137163
`autoTls.ca.caCertificateRetirementDuration` :: Duration at the end of the CA certificate lifetime where no signed certificate will exist.

0 commit comments

Comments
 (0)