Reverse Proxy Security Model
Reverse Proxy Security Model
This page focuses on the security considerations when using a reverse proxy in front of Uptrakit. For the general deployment guide, see docs/end-user/deployment/reverse-proxy.md.
Trusted Proxies and Header Trust
- Trusted proxies required. The controller only processes certificate-related headers (
X-Forwarded-Client-Cert-Info, PEM headers, etc.) when the request originates from an IP listed in--trusted-proxy(ornetwork.trusted_proxies). Headers are stripped from untrusted sources. - CA verification. The issuer CN from forwarded cert headers must match either the active CA or the most recent non-expired CA maintained in the controller.
- Header stripping. Headers such as the configured cert header,
X-Forwarded-Proto,X-Forwarded-Host, andOriginare removed from non-proxy traffic to avoid spoofing. - mTLS precedence. Direct mTLS connections take priority; if the mTLS verifier already extracted
ServiceIdentity, all proxy headers are ignored.
Correct ClientIp resolution is also required for service activity visibility in /api/v1/services. The controller
refreshes service ip_address on each WebSocket connect for both Agent and MQTT services; if proxy trust or real-IP
header settings are wrong, service IP metadata may remain stale or missing. See
docs/api/wire-protocol.md and
docs/development/testing.md for API/runtime verification guidance.
Revocation Checking
OCSP (recommended)
OCSP provides real-time revocation checks without periodic downloads. Configure the controller with --pki-addr (use http://), and optionally
--pki-http=listener to expose /api/v1/pki/ocsp over plain HTTP. Nginx requires http:// responder URLs — HTTPS OCSP URLs are rejected.
Proxies that support OCSP include:
- Nginx:
ssl_ocsp leafplusssl_ocsp_responder http://controller:8080/api/v1/pki/ocsp. Useresolverfor hostname lookup. (--pki-http=listenerensures the endpoint runs over HTTP.)
CRL (alternative)
CRLs are static files rebuilt hourly and immediately on revocation. Download and reload them every 30-60 minutes when using proxies that lack OCSP support (HAProxy, Envoy, Traefik, Caddy).
curl -sk https://controller:8443/api/v1/pki/ca.crl -o /etc/proxy/ssl/ca.crl && nginx -s reload
Proxy matrix
| Proxy | OCSP | CRL | Notes |
|---|---|---|---|
| Nginx | yes | yes | OCSP requires http:// responder. |
| HAProxy | no | yes | Refresh CRL manually. |
| Envoy | no | yes | Refresh CRL manually. |
| Traefik | no | no | Rely on controller-side checks. |
| Caddy | no | no | Rely on controller-side checks. |
See each per-proxy guide for detailed configuration examples: Traefik, Caddy, Nginx, Nginx Proxy Manager, Envoy, HAProxy.
CA Rotation and PKI Address Changes
- Changing
--pki-addrrequires CA rotation because the URLs are embedded in the CA certificate. - Rotate the CA via
POST /api/v1/settings/rotate-caor Web UI to generate new AIA/CDP URLs. - The controller broadcasts
CaBundleUpdatedandRequestCertRenewalmessages to connected agents. - Offline agents refresh the bundle when they reconnect, using the
ca_bundle_hashfield. - Proxies should re-download the CA certificate after rotation (
GET /api/v1/pki/ca.crt).
Per-Proxy Deployment Guides
- Traefik -- passthrough vs L7, header forwarding, OCSP/CRL notes.
- Caddy -- PEM headers and TLS backend trust.
- Nginx -- header definitions, OCSP responder wiring, CRL refresh cron sample.
- Nginx Proxy Manager -- GUI configuration + cert trust.
- Envoy and HAProxy -- raw header examples, CRL refresh tips.