For a bit of context, I read about the dns-rebinding vulnerbility, which allows attackers to potentially compromise services binding to local IP addresses (e.g. docker or 127.0.0.1) through a malicious or compromised website. Long story short, this attack requires an attacker to access the local web service with a hostname that he controls, which resolves to the local IP address. The best way (to my knowledge) to prevent this is to enforce using a correct hostname (that cannot be registered by an attacker) to access the services. I have a couple of local services running in docker. More info about the vulnerability here.
Therefore, I would like these local services to be only reachable through a reverse proxy using the correct hostname and HTTPS.
My current setup is to use a traefik container as the reverse proxy. This works, however, I have not found a way to isolate the container from my host system, i.e. I can still reach the containers outside of the reverse proxy by specifying the internal IP address. I have tried connecting them to an internal docker network, but this also breaks connectivity to the internet for the containers, which breaks functionality. I am running on a Linux (Ubuntu) client system, which I also use for browsing the web, hence the potential vulnerability.
Is there a way to isolate a docker network from the host system without breaking internet connectivity for the containers?