Skip to content

Commit 0b4bb6d

Browse files
Add custom CA certificate support for UNS bridge (#605)
## Summary - Adds `remote.caConfigMapName` Helm value to mount a custom CA certificate ConfigMap into the UNS bridge container - The CA cert is copied into `/etc/ssl/certs/` at startup so both custom and system CAs are trusted via `bridge_capath` - Exposes an optional "CA Certificate ConfigMap" field in the Admin UI (visible when TLS is enabled) ## Context Users on corporate networks with TLS inspection were getting "A TLS error occurred" because the proxy-injected CA wasn't trusted by the Mosquitto container. This allows them to provide their org's CA via a Kubernetes ConfigMap.
2 parents 5c6e04b + 9811e25 commit 0b4bb6d

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

acs-admin/src/components/Bridges/NewBridgeDialog.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@
134134
<label for="tls" class="text-sm font-medium cursor-pointer">Use TLS</label>
135135
</div>
136136

137+
<div v-if="remoteTls" class="flex flex-col gap-1 mt-3">
138+
<label class="text-sm font-medium">CA Certificate ConfigMap</label>
139+
<Input
140+
placeholder="e.g. corporate-ca"
141+
v-model="caConfigMapName"
142+
/>
143+
<p class="text-xs text-gray-500">
144+
Optional. Name of a Kubernetes ConfigMap containing a custom CA certificate (key: <code>ca.crt</code>).
145+
Required when the remote broker uses a certificate signed by a private CA (e.g. corporate TLS inspection).
146+
</p>
147+
</div>
148+
137149
<div class="grid grid-cols-2 gap-4 mt-4">
138150
<div class="flex flex-col gap-1">
139151
<label class="text-sm font-medium">Username <span class="text-red-500">*</span></label>
@@ -321,6 +333,7 @@ export default {
321333
this.remoteTls = true
322334
this.remoteUsername = null
323335
this.remotePassword = null
336+
this.caConfigMapName = null
324337
this.isSubmitting = false
325338
this.v$.$reset()
326339
},
@@ -345,6 +358,7 @@ export default {
345358
this.remoteHost = values.remote.host
346359
this.remotePort = values.remote.port
347360
this.remoteTls = values.remote.tls
361+
this.caConfigMapName = values.remote.caConfigMapName || null
348362
}
349363
}
350364
},
@@ -418,7 +432,8 @@ export default {
418432
tls: this.remoteTls,
419433
secretName: secretName,
420434
usernameKey: 'username',
421-
passwordKey: 'password'
435+
passwordKey: 'password',
436+
...(this.caConfigMapName ? { caConfigMapName: this.caConfigMapName } : {}),
422437
}
423438
}
424439
@@ -459,6 +474,7 @@ export default {
459474
remoteTls: true,
460475
remoteUsername: null,
461476
remotePassword: null,
477+
caConfigMapName: null,
462478
isSubmitting: false,
463479
unsChartUuid: null,
464480
}

edge-helm-charts/charts/uns-bridge/README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,35 @@ The bridge uses a local Mosquitto instance that:
2323
- Forwarding to remote MQTT broker
2424
- Configurable topic filters
2525
- Support for TLS on remote connection
26+
- Custom CA certificate support for corporate TLS inspection or private CAs
2627
- Remote credentials are accepted via the admin UI and encrypted using
2728
sealed secrets (as per the normal edge-deployment flow)
2829

2930
⚠️ **Known Limitations:**
3031
- Remote brokers must support basic authentication (username/password).
31-
No authentication is not supported.
32+
No authentication is not supported.
33+
34+
## Custom CA Certificates
35+
36+
If the remote broker uses a certificate signed by a private CA (e.g.
37+
corporate networks that perform TLS inspection), you can provide a custom
38+
CA certificate via a Kubernetes ConfigMap.
39+
40+
1. Create a ConfigMap containing the CA certificate with the key `ca.crt`:
41+
42+
```bash
43+
kubectl create configmap corporate-ca \
44+
--from-file=ca.crt=/path/to/corporate-ca.pem \
45+
-n <edge-namespace>
46+
```
47+
48+
2. Set `remote.caConfigMapName` in the bridge values, either via the Admin
49+
UI "CA Certificate ConfigMap" field or directly in the Helm values:
50+
51+
```yaml
52+
remote:
53+
caConfigMapName: corporate-ca
54+
```
55+
56+
The certificate is copied into the container's system CA store at startup,
57+
so both the custom CA and standard public CAs are trusted.

edge-helm-charts/charts/uns-bridge/templates/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ spec:
4646
- name: remote-credentials
4747
secret:
4848
secretName: {{ .Values.remote.secretName }}
49+
{{- end }}
50+
{{- if .Values.remote.caConfigMapName }}
51+
- name: remote-ca
52+
configMap:
53+
name: {{ .Values.remote.caConfigMapName }}
4954
{{- end }}
5055
containers:
5156
- name: mosquitto
@@ -54,6 +59,10 @@ spec:
5459
- /bin/sh
5560
- -c
5661
- |
62+
# Install custom CA certificate if provided
63+
{{- if .Values.remote.caConfigMapName }}
64+
cp /ca/ca.crt /etc/ssl/certs/custom-remote-ca.crt
65+
{{- end }}
5766
# Read credentials
5867
LOCAL_PASSWORD=$(cat /secrets/local/keytab)
5968
{{- if .Values.remote.secretName }}
@@ -95,4 +104,9 @@ spec:
95104
name: remote-credentials
96105
readOnly: true
97106
{{- end }}
107+
{{- if .Values.remote.caConfigMapName }}
108+
- mountPath: /ca
109+
name: remote-ca
110+
readOnly: true
111+
{{- end }}
98112

edge-helm-charts/charts/uns-bridge/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ remote:
3939
# Keys in the secret for username and password
4040
usernameKey: username
4141
passwordKey: password
42+
# Name of a ConfigMap containing a custom CA certificate (key: ca.crt)
43+
# Use this when the remote broker uses a certificate signed by a private CA
44+
# (e.g. corporate TLS inspection proxies)
45+
caConfigMapName: ""
4246

4347
# Image configuration
4448
image:

0 commit comments

Comments
 (0)