Repository navigation
Description
User Story
I run a self hosted OpenShell gateway (v0.1.4, upgraded to v0.1.11 this week) on one Linux server with the Podman driver and mTLS client certificates. Several automation services each hold their own client certificate, signed by one client CA.
I need to stop the gateway accepting one of those certificates, for example when a service is retired or its key may have been exposed, without touching the others.
Today that is not possible, so a certificate we no longer trust stays valid until it expires.
Problem Statement
The gateway has no way to revoke a single client certificate. The v0.1.11 docs say so directly: "The gateway does not provide per-certificate revocation" (authentication.mdx @ v0.1.11). The only way to stop trusting one certificate is to replace the client CA, reissue every other client certificate under the new CA, change the gateway configuration and restart the gateway.
Impact / Why This Matters
Replacing the CA touches every client of the gateway and needs a gateway restart, so for a single suspect certificate it is rarely worth it. In our case we kept a certificate we would rather have revoked, valid until 2028, because replacing the CA for it was not worth the disruption. We compensate with an external audit that ties each exec on the gateway to the certificate subject that made it and alerts on anything unexpected. That detects misuse after the fact; it does not stop it.
This matters more because any ordinary client certificate can create sandboxes and exec into every sandbox in its workspace (#6172), so one leaked certificate is a lot of reach with no quick way to cut it off.
Proposed Design
The operator names revoked certificates in gateway configuration, and the gateway refuses them at the TLS handshake. Notional:
[openshell.gateway.mtls_auth]
# a PEM CRL issued by the client CA, or a file of SHA-256 certificate fingerprints
revoked_certificates_file = "/etc/openshell/revoked-clients.pem"- The gateway rereads the file when it changes, with no restart.
- Connections already established with a revoked certificate are closed when the list changes, since the docs note that trust changes otherwise apply only to new handshakes.
- A refused handshake writes an OCSF event that names the certificate serial or fingerprint and subject.
- An optional CLI helper, for example
openshell gateway revoked-certs add --fingerprint <sha256>, would be nice but is not required.
Acceptance Criteria
- An operator can revoke one client certificate, and the gateway refuses new connections that present it, while other certificates from the same CA keep working.
- Open connections that used the revoked certificate are closed within a bounded time after the change.
- Revoking a certificate needs no gateway restart and no new client CA.
- Each refusal is visible in the gateway's audit events.
- The authentication docs describe the procedure.
Alternatives Considered
- Replace the client CA. Works, but reissues every certificate and restarts the gateway; this is what the docs imply today.
- Short lived certificates. Limits exposure, but needs an issuing service outside OpenShell, and an already established connection keeps working past expiry until it closes.
- A gateway interceptor that denies a principal. It could refuse RPCs by subject name, but it keys on the subject rather than the certificate, so a reissued certificate with the same subject is refused too, and the TLS handshake still succeeds.
- OIDC instead of mTLS. Token revocation is easier there, but our clients are host services with no identity provider.
Agent Investigation
- Checked the v0.1.5 through v0.1.11 release notes and the v0.1.11 authentication docs; no change on this point.
- Searched open and closed issues for revocation and CRL support and found none for client certificates.
Checklist
- I've reviewed existing issues and the published docs
- This is a design proposal, not a "please build this" request
Note: this content was drafted by Claude, an AI assistant, working on behalf of Brian Bouterse and in collaboration with him. It is AI generated and human reviewed.
Activity