-
-
Notifications
You must be signed in to change notification settings - Fork 173
feat: kubernetes support for tls/x509 redis and more modernizations #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 18 commits
80bdf98
d5207c2
d5b0963
71c59f0
5d93985
f93a6c5
a43fe31
eb8e75b
2195a70
a8f3ed5
0871905
ba5ca27
b3af547
6eb9947
e75160d
6225d37
b3d8d2c
cf75ae7
b8cc690
a3071dc
b9f6a23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Certificate | ||
| metadata: | ||
| name: redis-openemr-client | ||
| spec: | ||
| secretName: redis-openemr-client-certs | ||
| duration: 87660h # 10y | ||
| renewBefore: 360h # 15d | ||
| isCA: false | ||
| privateKey: | ||
| size: 2048 | ||
| algorithm: RSA | ||
| encoding: PKCS1 | ||
| usages: | ||
| - digital signature | ||
| - key encipherment | ||
| - client auth | ||
| subject: | ||
| organizations: | ||
| - openemr | ||
| commonName: openemr | ||
| issuerRef: | ||
| name: ca-issuer | ||
| kind: Issuer | ||
| group: cert-manager.io |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Certificate | ||
| metadata: | ||
| name: redis | ||
| spec: | ||
| secretName: redis-certs | ||
| duration: 87660h # 10y | ||
| renewBefore: 360h # 15d | ||
| isCA: false | ||
| privateKey: | ||
| size: 2048 | ||
| algorithm: RSA | ||
| encoding: PKCS1 | ||
| usages: | ||
| - digital signature | ||
| - key encipherment | ||
| - server auth | ||
| - client auth | ||
| subject: | ||
| organizations: | ||
| - redis | ||
| commonName: redis | ||
| dnsNames: | ||
| - redis-0.redis | ||
| - redis-1.redis | ||
| - redis-2.redis | ||
| - redis-0.redis.default.svc.cluster.local | ||
| - redis-1.redis.default.svc.cluster.local | ||
| - redis-2.redis.default.svc.cluster.local | ||
| issuerRef: | ||
| name: ca-issuer | ||
| kind: Issuer | ||
| group: cert-manager.io | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Certificate | ||
| metadata: | ||
| name: sentinel | ||
| spec: | ||
| secretName: sentinel-certs | ||
| duration: 87660h # 10y | ||
| renewBefore: 360h # 15d | ||
| isCA: false | ||
| privateKey: | ||
| size: 2048 | ||
| algorithm: RSA | ||
| encoding: PKCS1 | ||
| usages: | ||
| - digital signature | ||
| - key encipherment | ||
| - server auth | ||
| - client auth | ||
| subject: | ||
| organizations: | ||
| - sentinel | ||
| commonName: sentinel | ||
| dnsNames: | ||
| - sentinel-0.sentinel | ||
| - sentinel-1.sentinel | ||
| - sentinel-2.sentinel | ||
| - sentinel-0.sentinel.default.svc.cluster.local | ||
| - sentinel-1.sentinel.default.svc.cluster.local | ||
| - sentinel-2.sentinel.default.svc.cluster.local | ||
| issuerRef: | ||
| name: ca-issuer | ||
| kind: Issuer | ||
| group: cert-manager.io |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||||
| # single node cluster config | ||||||||
| kind: Cluster | ||||||||
| apiVersion: kind.x-k8s.io/v1alpha4 | ||||||||
| nodes: | ||||||||
| - role: control-plane | ||||||||
| extraPortMappings: | ||||||||
| - containerPort: 30080 | ||||||||
| hostPort: 8800 | ||||||||
| - containerPort: 30443 | ||||||||
| hostPort: 9800 | ||||||||
|
Comment on lines
+5
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. 🟠 Kind extraPortMappings expose OpenEMR NodePort on all host interfaces
DescriptionOpenEMR is exposed via a fixed
Vulnerable configuration: extraPortMappings:
- containerPort: 30080
hostPort: 8800
- containerPort: 30443
hostPort: 9800RecommendationBind the Kind port mappings to localhost (or remove host port mappings entirely) to avoid unintended exposure. Option A (recommended for local dev): set extraPortMappings:
- containerPort: 30080
hostPort: 8800
listenAddress: "127.0.0.1"
- containerPort: 30443
hostPort: 9800
listenAddress: "127.0.0.1"Option B: avoid NodePort exposure:
Also consider tightening Last updated on: 2026-04-26T21:46:46Z |
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,13 @@ | ||
| # four node (three workers) cluster config | ||
| # Supports shared volumes over different nodes, however, to support this, | ||
| # have hard-coded hostpath to use /tmp/hostpath-provisioner in this script | ||
| # and in the kind-pvc-hostpath.yaml (custom storage class) script. | ||
| kind: Cluster | ||
| apiVersion: kind.x-k8s.io/v1alpha4 | ||
| nodes: | ||
| - role: control-plane | ||
| extraMounts: | ||
| - hostPath: ./kind-pvc-hostpath.yaml | ||
| containerPath: /kind/manifests/default-storage.yaml | ||
| - hostPath: /tmp/hostpath-provisioner | ||
| containerPath: /tmp/hostpath-provisioner | ||
| - role: worker | ||
| extraMounts: | ||
| - hostPath: /tmp/hostpath-provisioner | ||
| containerPath: /tmp/hostpath-provisioner | ||
| - role: worker | ||
| extraMounts: | ||
| - hostPath: /tmp/hostpath-provisioner | ||
| containerPath: /tmp/hostpath-provisioner | ||
| extraPortMappings: | ||
| - containerPort: 30080 | ||
| hostPort: 8800 | ||
| - containerPort: 30443 | ||
| hostPort: 9800 | ||
| - role: worker | ||
| - role: worker | ||
| - role: worker | ||
| extraMounts: | ||
| - hostPath: /tmp/hostpath-provisioner | ||
| containerPath: /tmp/hostpath-provisioner |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6. 🟡 Overly long-lived Redis/Sentinel mTLS certificates and overly-broad EKU usages
Description
The newly added cert-manager
Certificateresources for Redis and Sentinel issue end-entity certificates with a 10-year validity and include both server and client authentication usages.Implications:
duration: 87660h # 10ygreatly increases the blast radius of key compromise and reduces the effectiveness of rotation/revocation in typical Kubernetes environments.usagesincludes bothserver authandclient auth, which allows the same certificate/keypair to potentially be accepted as a client certificate where mTLS is enforced, undermining identity separation between servers and clients.Vulnerable configuration:
Recommendation
Use shorter-lived leaf certificates and restrict EKUs to intended roles.
client auth.Certificateresource with onlyclient auth.Example (Redis server cert):
Example (Redis client cert):
Also consider switching to
encoding: PKCS8unless a consuming component explicitly requires PKCS1.Last updated on: 2026-04-26T21:46:48Z