Comments (27)
@rochdev yeah, I'm actively working on it... next week at the latest.
from envoy.
Any news as to how implementation is progressing?
from envoy.
In addition to SNI for HTTPS, it would be nice to have support for TCP proxy clusters. Potential setups:
- Communication with cluster is done via HTTP (TLS termination)
- Communication with cluster is done via HTTPS (reencryption)
- Communication with cluster is done via TCP (TLS terminated TCP proxy)
- Communication with cluster is done via TCP with TLS (TCP proxy with reencryption, not pictured)
- Communication with cluster is done via raw TCP passthrough (TCP passthrough)
from envoy.
@mattklein123 Sure.
from envoy.
@PiotrSikora I'm going to leave this ticket resolved, as we have other tickets on fully supporting multiple filter chains.
from envoy.
That will certainly work. I'll extend the schema to have a list of certificates for a ssl_context and then do all of the work in SslContext instead of ContextManager.
from envoy.
Support for SNI and multiple certificates would be required before we could consider using Envoy as an edge load balancer for North-South traffic in Cloud Foundry. Wildcard certs are not allowed in many regulated industries, and SAN certificates are so painful to manage that operators end up refusing to support custom domains.
Given the current config structure, I would find it most intuitive if certs were configured within the ssl_context
for each listener, though for our current needs we don't need more than one TLS listener per instance. Suggestion; replace cert_chain_file
and private_key_file
with something like pems
which takes an array of certificate chains in the PEM format.
from envoy.
OK I just synced offline with @PiotrSikora. I agree with him that my suggestion above of not doing multiple ssl_context is not a good idea and roughly the original design that @mattwoodyard proposed is a better idea. The goal here will be to optionally have a map of SNI names to ssl_context configurations in the v1 configuration (along with the current default context). All of this code should then be usable in the new v2 API.
@PiotrSikora do you want to take on ^ ?
from envoy.
SNI support is scheduled for Istio 0.3 (end of November) but is blocked by this. Will support in Envoy land before then?
from envoy.
Can you expand a bit more? How would the different certificates be chosen? SNI? We don't currently support SNI server side either.
from envoy.
Yep, SNI, for TLS terminaison.
The idea is to be able to drop a key/cert file in a folder, for a new or to replace an existing certificate, and have them reloaded without the need of changing command line arguments or restart envoy.
from envoy.
We won't support automatic reloading when certs change, and we probably will not support loading an entire folder of certs (since certs need to be matched to their SNI identifier), but we will support server side SNI eventually. Patches would definitely be welcome on this one.
from envoy.
@PiotrSikora - are you actively working on this?
from envoy.
@mattwoodyard nope, I didn't want to touch it before LDS is finalized, since it's most likely going to result in significant changes to the design.
from envoy.
I need this for some internal migration support. Here's my proposal:
- Allow configuration which can specify an array of ssl_context.
- ServerContextPtr becomes shared_ptr
- A std::unordered_map is added to ContextManager which maps (listen_address, hostnames) to contexts.
- ContextManager gets an added function to return a context given a hostname and listener.
- When loading the listener the first context initialized is attached to the current ssl_context_ and used as the default for non SNI based connections.
- The tlsext_server_name callback will use the ContextManager name map to find the 'real context'.
- the default case of a single cert in a context can be noop'd by not binding the tlsext_server_name callback.
Any problems with this approach?
from envoy.
@mattwoodyard I would much prefer that we have a single logical SslContext, and just handle SNI inside of it via multiple certs, etc. Why do we need multiple contexts? I think just doing it inside the existing context object is much simpler.
from envoy.
This feature is not hard to add. Someone just needs to do it. So whoever wants to firmly sign up just say so.
from envoy.
@mattwoodyard are you working on this actively? If not I'm probably just going to get this done as I'm getting tired of people asking for it. :)
from envoy.
@mattklein123 - I've not got anything ready to commit, and I won't have the time to dedicate to tests and polish for a few weeks.
from envoy.
@mattwoodyard alright let me see where I get with this. Let me know before you spend a bunch of time doing more work.
from envoy.
I would much prefer that we have a single logical SslContext, and just handle SNI inside of it via multiple certs, etc. Why do we need multiple contexts? I think just doing it inside the existing context object is much simpler.
@mattklein123: v2 API uses multiple FilterChain
, so we're going to have multiple contexts per listener in v2 anyway.
Also, it's a bit unfortunate that we're discussing implementation details here, instead of focusing on the use cases, since proper SNI support doesn't stop at simply serving different certificates based on the SNI (which is what's been discussed here so far), but it should change filters, routing rules, cluster selection, etc., otherwise it's kind of pointless.
from envoy.
Also, it's a bit unfortunate that we're discussing implementation details here, instead of focusing on the use cases, since proper SNI support doesn't stop at simply serving different certificates based on the SNI (which is what's been discussed here so far), but it should change filters, routing rules, cluster selection, etc., otherwise it's kind of pointless.
I don't really agree with this. 95%+ of the use cases for SNI are already supported if we just do the TLS part. Basically, cert per domain, and then virtual hosts per domain in a single listener. I would recommend starting there. Agree there is a lot more that can be done later.
from envoy.
v2 API uses multiple FilterChain, so we're going to have multiple contexts per listener in v2 anyway.
Maybe, maybe not. This needs more thinking/design. For example, will we route to logical listeners based on SNI? If so we still have a single SSL context before filter stack routing happens, right?
from envoy.
Although an SNI hostname could be used to make a routing decision based on a domain name, this is not why we need SNI. The primary use case is reducing the burden on the operator for certificate management and secondarily, improved security from not exposing unexpected domain names in a cert.
As our users can construct routing rules based on more complex HTTP attributes than hostname (e.g. context path), we have to decrypt the request to get at the HTTP payload anyway.
from envoy.
@mattklein123 sure, but single SSL context means that client certificate verification settings would apply to everything on a particular listener, making it all or nothing for a particular listening port.
from envoy.
@PiotrSikora ok that make sense. I guess we could use the original design that @mattwoodyard proposed. I guess really all I mean is that IMO without very much work we can unblock a lot of people / make them happy, so it would be best to do that before looking at all of the more complex cases. If we want to work on multiple ssl_context at the config level and we think that is better, that's fine with me. I was just trying to make it as simple as possible.
(I do think that the "ssl_context" at the config level could be a container for multiple things inside of it, but it's probably not worth doing that vs. just doing an array and if a single object is supplied just make it an array for back-compat).
from envoy.
@PiotrSikora can you potentially update us on progress/timelines? Thank you.
from envoy.
Related Issues (20)
- Newer release available `com_github_gabime_spdlog`: v1.14.1 (current: v1.13.0)
- OpenTelemetry access logs: Missing span ID breaks trace-context correlation HOT 2
- [RFC] Move to month-based (semantic) versioning HOT 6
- IpVersionsClientTypeDeferredProcessing/RateLimitQuotaIntegrationTest.MultiRequestWithTokenBucketThrottling/IPv4_GoogleGrpc_WithDeferredProcessing is flakey HOT 1
- IpVersionsClientTypeDeferredProcessing/ExtProcIntegrationTest.SkipHeaderSendTrailerInBufferedMode/IPv4_EnvoyGrpc_NoDeferredProcessing is flakey HOT 1
- Create a benchmark for the admin clusters endpoint HOT 1
- Query - Regarding custom TLS handshaker to load the certs from the cache. HOT 1
- Support fail_traffic_on_panic for locality_weighted_lb_config
- Add Meta-Data to Build for more accurate Container SBOM generation HOT 3
- Add custom Envoy cluster-specific Prometheus label HOT 2
- x25519kyber768 support HOT 2
- [oauth2] Refresh flow breaks when id token not returned during refresh HOT 3
- Change the upstream port for the HTTP dynamic forward proxy HOT 3
- Newer release available `aspect_bazel_lib`: v2.7.2 (current: v2.7.1)
- allow fixed heap resource monitor's max_heap_size_bytes to be configurable via runtime HOT 1
- `DirectResponseIntegrationTest.DirectResponseBodySizeLarge/IPv6` is flakey in TSAN test
- aws: assert in debug for async credential providers HOT 1
- Fix CVE-2024-33599 HOT 3
- OpenTelemetry metrics sink and access logger - Ability to configure OpenTelemetry Resource via Resource Detectors HOT 2
- Support typed dynamic filter metadata in access loggers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envoy.