-
Notifications
You must be signed in to change notification settings - Fork 109
IP & DNS ptr leaked #76
Comments
Thanks for bringing this up @MartinHotmann. It is important to me that my image does what it advertises at the very least. :) To try to narrow down possible causes, can you run a similar test where |
I will try to do and ask them if it then still exposes the IP. But since it is set as " |
It was not reproducable, when the vpnFRA was running already. Just on first creation time. So if you " |
I also encountered potential leaking during testing and traced it back to the killswitch setup procedure, which resolves remotes ony by one, before dropping traffic through the insecure In my case the list of remotes was quite long and dns resolving took a few seconds per remote (for unrelated reasons), so the time period in which other containers were communicating insecurely was as long as a few minutes. I made a fix in a fork here which I'm currently testing. The fix drops all traffic that is not explicitly allowed immediately, before performing the dns lookups. To still allow the lookups to function in any potential container dns configuration (ie. for external dns resolvers), iptables allow rules are added temporarily until the lookups are done. Looks promising so far for what I encountered. Not sure if it addresses your problem @MartinHotmann, but if you want to check it out, you can either build your own image from that code or use the build here. The fix is only implemented for iptables so far. If it proves to solve the issue, I'll open a PR and perhaps look into how to solve it for nftables, too. |
When I read what @MartinHotmann wrote, I had a feeling this was what was going on here. Have you been using it with this change over the past few days? Does it seem to be working as expected? |
@twiebe servus Thomas und danke für den QuickFix! I will perform some tests the next days and will report back if it entirely fixed the problem for me or not. Thanks in advance! |
Yep, it's been running like that for a few days and all manual checks look good so far. However, since I'm traveling at the moment, I have only found little time to do testing. Will do some more on the weekend once I'm back and open the PR, even if just for iptables yet. BTW: This morning I've made a small adjustment to not bind the temporary resolver rules to |
Did some further testing and everything worked as expected. Here's the PR for the iptables fix: #80 Hope that it fixes your issues, too, @MartinHotmann. ✌️ |
Seems like it is fixed. At least I was not able to reproduce it anymore. |
Excellent. Glad it helped! |
Dunno if related to this here, but ATM the container does not start and completely leaks all and everything. It litterally stuck here:
Btw, also found this: Here my composer file:
It does not start properly and also does not throw any error in the docker logs. It allows every connection to be accessed by everyone and also exposed all and everything. Something must be wrong. |
I just tested latest with this Compose file and everything works as expected
|
Thanks for the reply! I will again dig into and see what I can do. |
Unrelated, but given that sysctl, you're using ipv6. Does this image work well with that? |
I just founf out what it was. The OVPN files from the provider have been updated and the the old ones have not been valid anymore. At the next restart of the container no connection was established. For now the problem is fixed by updating the files and then restarting the container. But the container really should not allow any connection without having a VPN connection established. Guess he somewhere fails silently and sallows connected containers to be reached.
No no, my server does have a IPv6, but the |
@MartinHotmann I have something for you to test if you're willing.
I'd like to see how it behaves with the old config and with the new config to see if either leaks. |
Thanks, will test the next days! |
@MartinHotmann were you able to test? |
Sadly not yet, I am super busy ATM. I will report back, as soon as I did it. |
@wfg I just did some tests to validate your fix for #84 and hit following issues:
Except for above (mainly Mullvad specific) errors, seems to work fine to me. Just be aware I only validated VPN is starting and traffic is pushed through the VPN. I didn't validate the fix in regards of IP and DNS ptr leaking due to lack of knowledge on the exact issue. |
I seem to have found the problem after a long time. The environment variables were changed, but I did not update them. I used A VPN without a killswitch doesn't make much sense as a VPN is about security. Without a killswitch, most people would agree that a VPN would be less secure. Please implement the killswitch in the following way: ENV:
VALUES:
This way, all existing containers will behave as expected. This method also ensures that no "wrong" value can be provided, and a killswitch is always enabled until explicitly disabled. A log entry, that clearly states that the killswitch is enabled would be really appreciated. As for now I can't really test it myself. In case of
In case of
In case of
In case of
In case of any ivalid value:
ㅤ ㅤ Thanks for your work and would be nice to have some feedback on this suggestion. |
Just run a bunch of tests with some friends of mine and it turns out they are able to detect and provide me with my DNS ptr on the first boot. At later reboots (docker restart [container]) this does not seem to happen anymore.
The PTR was correct and directly points to my server (ofc it does it is an IP reverse lookup). But this also means they had my servers IP. Apparently I can't say if this is true for IPv6 aswell since I have turned it off for now.
But that is not good. I also can't say if it is a docker core problem or the problem of this image. But what I can expose is my censored docker-compose.yml:
KILL_SWITCH=on
should have prevented ALL IP leaks, but it did not. But what I noticed on the firstdocker-compose up -d
is this:the container
app1
starts first, then the VPN container and thenapp1
. Anyway this should have never had any internet access as it's network_mode (container:vpnFRA) was not fully booted yet?The DNS PTR is automatically detected (if detectable) and I was this multiple times and don't like that others can track my server behind a dockerized VPN container. I am pretty sure I have not seen this before with v2, but since some things changed in the meantime, I can not tell for sure where the culprit is. But at first boot something happens that exposes (or gives the chance of exposing the servers IP!).
Hope to hear back :)
The text was updated successfully, but these errors were encountered: