Repository navigation
Runtime TLS configuration with xDS #1817
Description
Activity
/cc @howardjohn @Stevenjin8 @ilrudie
IMO, if we're going to solve this, we need to solve runtime mesh settings in ztunnel more generally, including things like trustdomain (/cc @krinkinmu @grnmeira)
I agree with @keithmattix and also that we should probably be very hesitant to do this. I would imagine that the primary goal here is for compliance which would make dynamic configuration more annoying than useful. Especially FIPS for example where the goal is generally to handle it at compile time.
IMO, if we're going to solve this, we need to solve runtime mesh settings in ztunnel more generally, including things like trustdomain
@keithmattix In that case we should also add the possibility to query current config for debugging purposes, similar to what Envoy provides via its config dump.
we should probably be very hesitant to do this
@howardjohn Indeed. I think that Ztunnel being so minimalistic is one of its strengths. Thinking hard about adding new features in general is the key to keeping it that way.
I would imagine that the primary goal here is for compliance which would make dynamic configuration more annoying than useful. Especially FIPS for example where the goal is generally to handle it at compile time.
I see at least two benefits in adding this xDS configuration:
First is, as you mentioned, compliance. FIPS is one thing, but all of the cipher suites and kx groups ztunnel offers are FIPS compliant (except the PQC kx group, which is disabled by default). So in general, users who aim to be FIPS compliant can just go with the defaults (+ use FIPS validated crypto lib). However, PQC is becoming more important every year, so I think this could be more important for users who want to use specific crypto (such as the PQC) rather than the defaults.
Second is transparency. When global mesh options are set via istiod, I see it as more transparent if these settings are also applied to ztunnel, which is part of the mesh too. It is also probably easier for users to configure the whole mesh at once than to set env vars for ztunnel DaemonSets (or using operators to do that for them).
Per @keithmattix's comment I searched through what could be a good candidates for xDS configuration in ztunnel:
- Trust Domain
- Trust Domain Aliases
Cluster Domain.
Do you see any other candidates?
I think this is something we should probably discuss in a design doc or working group meeting. ztunnel has gotten pretty far with just env var/static config; I'm not sure PQC is enough justification for dynamic config. All of the candidate values seem to be things that wouldn't change during the lifetime of a ztunnel
Sure, that makes sense. I can start writing the design doc then.
FWIW my initial impression was aligned with Keith's that this seems possibly more complex than the benefits it brings
Reacted by Zuzana MiklánkováThe design doc is published now.
Currently, ztunnel TLS settings are configurable via environment variables (
TLS12_ENABLED,COMPLIANCE_POLICY=pqc).This RFC proposes a possibility for ztunnel to receive TLS configuration (protocol versions, cipher suites, key exchange groups) via the Workload API, allowing runtime updates without pod restarts.
I am interested in your opinion on this and I can follow up with a PR with implementation.
Alignment with meshMTLS
Istio's
MeshConfig.meshMTLSalready providesminProtocolVersion,cipherSuites, andecdhCurvesfields (theecdhCurvesbeing in progress, tracked in Issue #52290, PR being here).Proposal
Workload API Extension
Add a
TlsProfilemessage to the Workload API:ztunnel Changes
TlsProfilefrom Workload APIIstiod Changes
MeshConfig.meshMTLSwhich already hasminProtocolVersion,cipherSuites, andecdhCurvesfieldsTlsProfilemessage to the Workload API protobuf definitionsTlsProfilefrommeshMTLSwhen generating xDS responses for ztunnelConfiguration Priority
TlsProfileTLS12_ENABLED,COMPLIANCE_POLICY)Backward Compatibility
Fully backward compatible. Missing or empty
TlsProfileuses current environment variable behavior.Known Limitations
Open Questions