Open jemrobinson opened 1 year ago
Our Ansible roles for configuring our EC2 proxy VMs are open-source: https://github.com/hic-infra/shared-services-ansible-roles/
We're in the process of open-sourcing the Terraform for deploying the EC2 instances and everything else for our shared services, though at some point we may switch to containerising everything.
That looks very nice,
If you're writing your own Ansible role you might be able to copy/fork https://github.com/hic-infra/shared-services-ansible-roles/tree/main/squid
It looks like getting Squid to work with HTTPS is complicated (see e.g. https://dev.to/suntong/squid-proxy-and-ssl-interception-1oa4) and is likely to involve installing a self-signed certificate on all resources that need to make HTTPS connections. I don't think this will work with calls from Dockerised services.
HTTPS in general is tricky. Can't use the simple cert verification challenges if you have no internet access. Can't reach cert authorities to check certs with no internet access.
HTTPS inside would be nice to have. I don't have much experience with self-signed certs. I think a lot of programs reject or raise warnings about them. It might be difficult to add and trust the certs everywhere they are needed.
This is less about accessing e.g. https://gitea.<my sre>.com
inside the environment but more about accessing https://login.microsoftonline.com
for user authentication.
In both cases do you get the problem of, the squid server doesn't have a valid cert for the domain you are requesting. It would look like a MITM attack.
I mean, it is a MITM attack. The proxy is essentially unwrapping an HTTPS request to find its destination, deciding whether or not to forward it on, making a new request, getting the result of that request and sending it back to the original client.
But the way we propose it is a friendly attack :smile:.
HSTS might also make it difficult to do in a browser. The browser will know certain sites should always be served over HTTPS.
NB. Azure Firewall does this by resolving FQDNs to a list of IP addresses every 15 seconds (https://learn.microsoft.com/en-us/azure/firewall/fqdn-filtering-network-rules#how-it-works). Could be a way forward if we're happy to write some code to do that?
:white_check_mark: Checklist
:strawberry: Suggested change
The Azure Firewall is moderately expensive (~£200/month) and we're only using basic filtering capabilities. We should look at alternatives.
:steam_locomotive: How could this be done?
We should look into replacing this with a Squid Proxy - @manics might be able to give some advice on how TREEHOOSE do this.