-
-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsmasq should have requests from the vm filtered, but all requests are allowed and they aren't shown in the UI #482
Comments
mmh, are the firewall rules added after resume?
What's the last line written to the log? Also, just for testing purposes, rename the name of the rules so they don't have spaces not punctuations. |
Also take a look at the journal log to see if there's any error related to us: |
I didn't see any obviously related entries in the journal log. The issue is reproducing constantly even after reboots so it seems like I have it configured wrong. But firefox and qbittorrent rules are running as expected. It seems that right now it is just the dnsmasq rules that aren't working as expected. This is the iptables output:
The last line of the opensnitchd log:
Attached are all the rules loaded in case I have a mistake in there somewhere. |
ok, everything seems to be fine as far as I can tell. I'll try to reproduce it but it seems to be a bit tricky, I'll need your help. As long as the other rules are working and you get prompted to allow other binaries ( The next time you reproduce it, please, do the following:
If they are, delete the rule if it exists, add it again and see if it starts working:
Note: If you flush the OUTPUT table, after a few seconds the daemon should add the rules again.
By the way, what process monitor method are you using? |
My laptop running opensnitch and virt-manager is working as expected so I put those rules on my main pc and the problem still reproduced. OpenSnitch did invoke the rule dialog when a program without a rule wanted access. Below is what the mangle table looks like while in repro state. I also ran the flush command and then what I think is the add command, but my version of iptables doesn't have the
The
How should I delete and re-add the rule? I'm pretty new to networking stuff at this level and I haven't been using |
oopsie, sorry for that, it's
That's probably because the daemon re-added them. There should be a log entry like this one: |
In OpenSnitch settings, ebpf is set for process monitor method. I ran the iptables commands to refresh the mangle table, re-ran the scenario to invoke a request to a blocked site on the vm and there was no change in behavior. I looked in the system log and and didn't see any entries related to opensnitch. The opensnitch log didn't have any record of the vm hitting the site. Then I ran through the following steps: Uninstalled opensnitch
The mangle table after install
I deleted the opensnitch log and then executed opensnitch install;
Mangle table check
I set opensnitch log level to debug in the ui and Invoked a page load in the vm (that had been running through the uninstall/install) to msn.com and it loaded as did yahoo.com, neither are in the exception list. Below is the opensnitch log from performing those steps.
|
I've replicated your setup and so far is working as expected. I'll keep an eye on it. |
@Techtonictools the rules.gz seems to be empty, could you reupload it or post the file with the exception list? |
rules.zip Let me know if that doesn't go through. I had checked the rules.gz prior to uploading by extracting it and checking for the rules in the folder. I'm not sure what went wrong there. |
thank you @Techtonictools , now it's correct. [edited] nothing to see here, it was a typo... |
The rule |
That is definately a mistake on my part. I changed the rule in the UI to use the |
That's really weird. Do you see connections in DEBUG log level in /var/log/opensnitchd.log? like You should see them regardless of the rules and the proc monitor method being used. If there're no entries of "new connection..." then the mangle rule is not added or it's being bypassed. While you're reproducing this issue:
I've realized that after coming back from hibernation our DNS rule is not in the first place of the filter table, and instead is one of the libvirt. Also check it, and if it's not in the first place, delete it and re-add it:
I'm using your ruleset now, but it's working fine for now. What's the NIC configuration of the VM? NAT and virtio? |
Yeah, it is weird as if I broke something. I need to come back to it a few days, but I'll try those things and post back then. The first scenario I have tried the other day and posted in this issue log. It is the post that includes the uninstall/install steps (but not limited to) and the terminal and og outputs. |
Sorry, that comment on the issue 481 was supposed to be for this one. I reproduced a similar behaviour where the daemon starts to behave in a wrong manner, it can be firewall rules monitor stop working for no reason, rules list getting corrupted, etc...
Change it please to |
I changed the method to I reinstalled virt-manager and after booting the vm, I tried to load a website and it didn't load. Looking in the Events tab of the UI there were two events logged (illustrated below). Rules:
|
Thank you @Techtonictools . Could you upload the file with the exceptions? |
I just reproduced it with a clean exception list attached. Only debian.org should load but yahoo.com loaded using that same list. |
hi! a lot has changed since v1.4.0. Please, could you test it with latest v1.6.0rc5 version https://github.com/evilsocket/opensnitch/releases/tag/v1.6.0-rc.5 ? |
I'm using virt-manager on a debian host to run Win10 and OpenSnitch to filter network requests that origninate from the vm. I had OpenSnitch setup so all requests from the vm (and host) are denied unless the host is in an exception list associated with the binary making the request. It was working yesterday and a few days before that, but today after resuming from S4 from yesterdays work, all requests from the vm were granted and none of the requests from the vm were being shown in the UI.
There was a previous instance where the same behavior occurred and I rebuilt the rules, did stop/starts and it started working. But today I removed the dnsmasq rules, invoked a request and did not get a prompt from OpenSnitch to add a rule. There weren't any rules for dnsmasq in the UI or in a .json file. Stop/start and close/open and then re-invoking a page load/request in the vm didn't work around the issue to get the pop up to create a new rule and there were no related events in the event tab.
To Reproduce
Install debian bullseye
Install virt-manager
Install OpenSnitch on host
Create rules pictured below and replace the vm client ip in 001-dnsmasq allow with the IP you should get for your vm
Create an exception list and put a domain name in it and save it to the exception list path
Create a vm and install win10 in it
After Win10 install completes, invoke a request in the vm that is not in the exception list. Windows will be trying to make requests by default, but to be sure launch IE and let it try to go to the pre-loaded default sites on launch (like install edge, msn, show news, etc)
Post error logs:
There is no record of any request from the vm in the log with the loglevel set to debug when in repro state.
Expected behavior
A record of the rule that was used for the request from the vm in the event tab in the UI with the status allow or deny.
A blocked request.
OS:
Additional context
If the steps to reproduce yield a successful block and the vm requests are showing in the events tab, try
systemctl hibernate
, power on and re-test a request from the vm.It isn't a 100% repro and I'm not sure of the exact steps to reproduce the problem on demand. What I'm doing to reproduce the issue is to use the vm and host machine daily through the work week and at EOD, hibernate. Sometimes hibernate fails and a clean boot is performed instead but today resume from hibernate succeeded and that is when the problem reproduced.
The text was updated successfully, but these errors were encountered: