Skip to content

Commit 98fdb02

Browse files
lexfreiclaude
andcommitted
refactor(openbao): restructure TLS to use proper CA chain
Replace simple self-signed certificate with a proper PKI hierarchy: selfSigned Issuer → CA Certificate → CA Issuer → leaf certificates (server + client), matching the etcd-operator pattern. This enables issuing separate client certificates for connecting to OpenBAO and provides a proper trust hierarchy with CA rotation support. Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent ac7292c commit 98fdb02

3 files changed

Lines changed: 78 additions & 6 deletions

File tree

‎hack/e2e-apps/openbao.bats‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ spec:
1818
ui: true
1919
EOF
2020
sleep 5
21-
kubectl -n tenant-test wait certificate openbao-$name-tls --timeout=60s --for=condition=ready
21+
kubectl -n tenant-test wait certificate openbao-$name-ca --timeout=60s --for=condition=ready
22+
kubectl -n tenant-test wait certificate openbao-$name-server --timeout=60s --for=condition=ready
23+
kubectl -n tenant-test wait certificate openbao-$name-client --timeout=60s --for=condition=ready
2224
kubectl -n tenant-test wait hr openbao-$name --timeout=60s --for=condition=ready
2325
kubectl -n tenant-test wait hr openbao-$name-system --timeout=120s --for=condition=ready
2426

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,60 @@
11
apiVersion: cert-manager.io/v1
22
kind: Issuer
33
metadata:
4-
name: {{ .Release.Name }}-selfsigned
4+
name: {{ .Release.Name }}-selfsigning-issuer
55
spec:
66
selfSigned: {}
77
---
88
apiVersion: cert-manager.io/v1
99
kind: Certificate
1010
metadata:
11-
name: {{ .Release.Name }}-tls
11+
name: {{ .Release.Name }}-ca
1212
spec:
13-
secretName: {{ .Release.Name }}-tls
13+
isCA: true
14+
commonName: {{ .Release.Name }}-ca
15+
secretName: {{ .Release.Name }}-ca-tls
16+
subject:
17+
organizations:
18+
- {{ .Release.Namespace }}
19+
organizationalUnits:
20+
- {{ .Release.Name }}
21+
duration: 87600h
22+
usages:
23+
- "signing"
24+
- "key encipherment"
25+
- "cert sign"
26+
privateKey:
27+
algorithm: RSA
28+
size: 4096
1429
issuerRef:
15-
name: {{ .Release.Name }}-selfsigned
30+
name: {{ .Release.Name }}-selfsigning-issuer
1631
kind: Issuer
32+
---
33+
apiVersion: cert-manager.io/v1
34+
kind: Issuer
35+
metadata:
36+
name: {{ .Release.Name }}-issuer
37+
spec:
38+
ca:
39+
secretName: {{ .Release.Name }}-ca-tls
40+
---
41+
apiVersion: cert-manager.io/v1
42+
kind: Certificate
43+
metadata:
44+
name: {{ .Release.Name }}-server
45+
spec:
46+
commonName: {{ .Release.Name }}-server
47+
secretName: {{ .Release.Name }}-server-tls
48+
subject:
49+
organizations:
50+
- {{ .Release.Namespace }}
51+
organizationalUnits:
52+
- {{ .Release.Name }}
53+
isCA: false
54+
usages:
55+
- "server auth"
56+
- "signing"
57+
- "key encipherment"
1758
dnsNames:
1859
- "{{ .Release.Name }}"
1960
- "{{ .Release.Name }}-internal"
@@ -25,3 +66,32 @@ spec:
2566
- "*.{{ .Release.Name }}-internal.{{ .Release.Namespace }}.svc.cluster.local"
2667
duration: 87600h
2768
renewBefore: 720h
69+
privateKey:
70+
rotationPolicy: Always
71+
algorithm: RSA
72+
size: 4096
73+
issuerRef:
74+
name: {{ .Release.Name }}-issuer
75+
---
76+
apiVersion: cert-manager.io/v1
77+
kind: Certificate
78+
metadata:
79+
name: {{ .Release.Name }}-client
80+
spec:
81+
commonName: {{ .Release.Name }}-client
82+
secretName: {{ .Release.Name }}-client-tls
83+
subject:
84+
organizations:
85+
- {{ .Release.Namespace }}
86+
organizationalUnits:
87+
- {{ .Release.Name }}
88+
usages:
89+
- "signing"
90+
- "key encipherment"
91+
- "client auth"
92+
privateKey:
93+
rotationPolicy: Always
94+
algorithm: RSA
95+
size: 4096
96+
issuerRef:
97+
name: {{ .Release.Name }}-issuer

‎packages/apps/openbao/templates/openbao.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
volumes:
3232
- name: tls
3333
secret:
34-
secretName: {{ .Release.Name }}-tls
34+
secretName: {{ .Release.Name }}-server-tls
3535
volumeMounts:
3636
- name: tls
3737
mountPath: /openbao/tls

0 commit comments

Comments
 (0)