0

I want to test my data-plane application and I want to find out if there is a way using containers.

After I bring up a container with my app in it, can I direct all my machine-generated Internet traffic to the container, process that traffic in my application and send it back down to the host network namespace and out the physical interface (say, eth0)?

Example:

I access Facebook and all traffic (DNS/UDP, HTTPS/TCP) for this should go to my container app in the same machine, get processed by my application and then sent out via eth0. Return traffic from the Internet comes back into my app first and then sent to the host client (browser here).

1 Answer 1

0

For the non-DNS TCP traffic - tell your app that the IP address of facebook is the ip address of your container. On your container run a TLS MITM proxy (previously this was called sslbump in squid but the current implementation is called peek-n-splice).

Unless you are happy to click through the certificate warnings then you'll also need to establish your own certificate authority and install the CA cert in the CA certs database on the host where the client is running.

You'll need to set up your own DNS server and configure the zones to fake the DNS (I suspect this may be possible with pihole) or just override the DNS entries in the hosts file.

I suspect you will have a lot of learning to do on your journey to implementing this.

5
  • your own certificate authority, you can also use Let's Encrypt of ZeroSSL Commented Mar 9, 2022 at 12:25
  • erm, no. They won't issue you a certificate for Facebook. Commented Mar 9, 2022 at 13:28
  • Oops, yeah, didn't think about that Commented Mar 9, 2022 at 13:29
  • Sorry if I was not clear. I don't want to do deep packet inspection. The application really just takes a packet and shoves it back down to go the Internet and vice versa. Commented Mar 10, 2022 at 1:15
  • Packet? Not a stream? Then you probably need to decrypt the stream. I think you really need to explain what you mean by "process that traffic" and how it adds value to the process of accessing a site. Commented Mar 10, 2022 at 13:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.