Open LuyaoZhong opened 3 years ago
@LuyaoZhong I think you're missing a chunk of work in your proposed solution: You will need a way to delay the TLS handshake until you have the cert. This will probably involve a custom handshaker, which will have the integration points with your other code that fetches/generates the cert.
@ggreenway We can delay the TLS handshake until we have the cert with current proposal. I give more details about how it work and address your comments in bumping doc.
@ggreenway kindly ping :)
@ggreenway Thanks for your comments. Please have a look at my reply in bumping doc.
@ggreenway Thanks for your comments to help make the design details clear, I reply in bumping doc. Please have a look and let me know if you have other concern about this design.
@ggreenway Thanks for your comments to help make the design details clear, I reply in bumping doc. Please have a look and let me know if you have other concern about this design.
@ggreenway kindly ping :)
I don't have any other comments. I think more will come out as you explore implementation.
@ggreenway Thanks. We will explore implementation based on design clarified in bumping doc.
4 work items were worked out:
We will create issue or PR for these work item, let's we discuss the implementation details there.
cc @mattklein123 @lambdai @soulxu Thanks for your comments.
Hi @LuyaoZhong, thanks for raising this as it is an important security use case. I have a question about the proposal and the intended support - would this work with HTTP CONNECT like you describe in your presentation video (https://events.istio.io/istiocon-2022/sessions/introducing-tls-bumping/) as well?
Hi @LuyaoZhong, thanks for raising this as it is an important security use case. I have a question about the proposal and the intended support - would this work with HTTP CONNECT like you describe in your presentation video (https://events.istio.io/istiocon-2022/sessions/introducing-tls-bumping/) as well?
Yes, making this work with HTTP CONNECT is one of our goals. We are going to utilize internal listener feature to handle HTTP CONNECT. The data flow looks like this: Client -> ListenerA(HCM with CONNECT termination) -> InternalListenerB(TLS Bumping) -> Upstream server.
Would you mind share your use case or scenario? We'd like to know more about requirements from real world.
Forward proxy is the main use case where the user points the browser/system proxy at Envoy. One of things that is not optimal in Envoy is the need for the internal listener for the bumping TLS termination but I guess a new custom filter would be needed which can satisfy both CONNECT termination and the payload TLS termination and mimicking.
Forward proxy is the main use case where the user points the browser/system proxy at Envoy. One of things that is not optimal in Envoy is the need for the internal listener for the bumping TLS termination but I guess a new custom filter would be needed which can satisfy both CONNECT termination and the payload TLS termination and mimicking.
A new custom filter was an alternative, we had https://github.com/envoyproxy/envoy/pull/19346 as PoC before, but this can only work for HTTP/1.0. To support HTTP/2 even QUIC, a complicated network filter is required, and we can predict that we need to copy a lot of logic from HCM to process http protocol, but the filter is just for handling CONNECT eventually. So we need to evaluate if it is worth a new filter.
It's ideal to make CONNECT termination and TLS bumping together, but due to the limitation of envoy framework, it is hard to implement currently. :(
@LuyaoZhong do you know if this implementation will be compatible with the custom handshaker extension ?? I.E. to be able to send some of the relevant server cert information (SANs, CN, etc...) or the certificate itself to a custom handshaker extension??
@amthorn Sorry for late response, I missed your comment. I think the answer is yes, just let the custom handshaker extension to interact with cert provider.
@LuyaoZhong What if my custom handshaker already implemented a cert-provider interface?? Can i disable the envoy one and use the one my handshaker provides?? (We pass the SNI currently which forwards to the cert provider, but with this change we'd forward the SANs/CN into the handshaker instead of the SNI)
@amthorn If you are asking if cert provider can work with custom handshaker in general, Yes, you need to implement a custom handshaker which can fetch certs from a cert provider instance. We can discuss on https://github.com/envoyproxy/envoy/issues/19308 and https://github.com/envoyproxy/envoy/pull/19582
If you are asking if tls bumping can work with custom handshaker, I think it depends on custom handshaker, in our current design we rely on envoy to loading certs and create a default handshaker to select cert based on SNI, when switching custom handshaker, we need to consider implementing similar functionalities to support tls bumping.
I was asking about the latter. You answered my question, I think changes would be required to a handshaker that already does it's own SNI-based certificate lookup (It is not enabled for certificate bumping).
If i understand correctly, the two options we have are that either: 1) The TLS bumping logic could send SNI to custom handshakers to generate the certificate (But would then need to ignore any certificate providers within the TLS bumping logic since that would be provided by the handshaker) which is something that is not implemented in the current plan for TLS bumping. 2) We would need to change the custom handshaker to pull out the certificate provider logic and implement it against envoy's certificate provider interface; decoupling the handshaker from the certificate provider.
I'm not expecting a response, just stating my understanding so that you can correct it if i'm wrong.
I built a poc with xDS and ALS which kind of does what this is supposed to do: https://github.com/epk/envoy-egress-mitm:
There's a suite in e2e
which tests it against top 500 domains.
@LuyaoZhong Are you guys still pursuing this?
Hi @vermajit, @epk , I'm currently considering using Envoy as forward proxy to one of my projects. Is TLS bumping already supported or the only usable code is the POC you provided in the below link: https://github.com/epk/envoy-egress-mitm
Thanks in advance!
Also looking at Envoy as a forward proxy, however, it's unclear to me of TLS Bumping is supported or not.
Also looking at Envoy as a forward proxy, however, it's unclear to me of TLS Bumping is supported or not.
We don't support it today.
hi @LuyaoZhong @soulxu @amthorn @epk and team is there any progress? what is the plan? any alternatives as of may 2024?
TLS Bumping in Envoy Design Doc
2022.10.31
PoC: https://github.com/envoyproxy/envoy/pull/23192 README and configurations are in tls_bumping subdir
2022.07.13 4 work items were worked out.
Certificate Provider instance - LocalMimicCertProvider https://github.com/envoyproxy/envoy/pull/23063
2022.04.24 update
Mimicking certs only based on SNI is probably not enough, we require server real certificate and ensure to copy subject, subject alt name, extensions, knowing about the RSA key strength and many more. Original proposal was to set up client-first secure connection, to meet above requirements we need server-first secure connection.
Therefore, we expect the workflow like this:
Original Proposal
Title: decrypting communications between internal and external services
Description:
Changes (straw man)
Any comments are welcome.