Skip to content
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

1.40rc2 not letting through ICMP #455

Closed
byReqz opened this issue Jul 13, 2021 · 26 comments
Closed

1.40rc2 not letting through ICMP #455

byReqz opened this issue Jul 13, 2021 · 26 comments
Milestone

Comments

@byReqz
Copy link

byReqz commented Jul 13, 2021

Hi,

ive been using the -git version from the AUR for ages but since the update to 1.40rc2 yesterday, no pings are getting through.

To Reproduce:
It stops working as soon as you install 1.40rc2 for me. The "stable" 1.3.6 works fine. Also works when the FW is turned off (obviously).

Post error logs:
The log on debug mode does not mention anything about the connections but shows everything else fine. Nping and Ping ICMP probes just time out on local and on remote hosts without any answers.

Expected behavior (optional)
ICMP not being touched by opensnitch.

Screenshots
no errors present

OS (please complete the following information):

  • OS: Arch Linux
  • Window Manager: KDE Plasma 5.22.3
  • Kernel version: 5.12.15-arch1-1
  • Backend: nftables (iptables-nft, using iptables itself does not change anything)

Additional context
Clean building the Package did not help. /etc/opensnitchd/system-fw.json (which allows ICMP) is present but doesnt seem to be used.

@gustavo-iniguez-goya
Copy link
Collaborator

Backend: nftables (iptables-nft, using iptables itself does not change anything)

Thank you for the detailed information @byReqz ! It really helps to analyze the problems.

I think that opensnitch is using nftables, which was added recently, but the system-fw rules haven't been adapted to work with nftables yet. Could you verify that you have opensnitch firewall ruless added to nftables? nft list ruleset , the should be two nftables tables (opensnitch-filter for ip and ip6).

@byReqz
Copy link
Author

byReqz commented Jul 13, 2021

Hi, yeah there are opensnitch-filter and opensnitch-magle for IPv4 and 6.

@gustavo-iniguez-goya
Copy link
Collaborator

ok, unfortunately nftables system-fw.json feature is not ready yet, finished but it needs more work.

This rule should allow ICMP traffic:
nft insert rule opensnitch-mangle output icmp type { echo-request,echo-reply } accept

@byReqz
Copy link
Author

byReqz commented Jul 14, 2021

Thanks for your answer but it doesn't seem to work.

123

@sonsu
Copy link

sonsu commented Jul 16, 2021

I am having the same issue on
OS: Ubuntu LTS 20.04 Desktop (minimal) install with 1.4.0.rc2
Extra info:
nft command is not installed, tcp/udp works as expected, but ICMP just hangs

x@x-virtual-machine:~$ cat /etc/opensnitchd/system-fw.json 
{
    "SystemRules": [
        {
            "Rule": {
                "Description": "Allow icmp",
                "Table": "mangle",
                "Chain": "OUTPUT",
                "Parameters": "-p icmp",
                "Target": "ACCEPT",
                "TargetParameters": ""
            }
        }
    ]
}

When reverted back to 1.3.6, ICMP works as expected (is allowed through)

@gustavo-iniguez-goya
Copy link
Collaborator

For now if the firewall in use is nftables and the DefaultAction is deny ICMP will be blocked. I'm making progress to allow to configure nftables system firewall so we can allow it and configure other rules.

In your case @sonsu, what's the output of iptables -V?

@pizzadude
Copy link

pizzadude commented Jul 19, 2021

I have the same issue in the latest opensnitch version in Fedora 34. Unless I disable the daemon completely, I can't ping anything.

"nft insert rule opensnitch-mangle output icmp type { echo-request,echo-reply } accept" does not solve the issue, unfortunately.

iptables -V
iptables v1.8.7 (nf_tables)

@vukitoso
Copy link

vukitoso commented Jul 23, 2021

debian 10
1.4.0rc2
ping doesn't work

@Arjdroid
Copy link

Arjdroid commented Jul 26, 2021

Having the same issue here on Arch Linux latest using opensnitch-git from the AUR. I am using iptables-nft.

Output of sudo iptables -V is iptables v1.8.7 (nf_tables)

Output of sudo opensnitchd -version is 1.4.0rc3

All ICMP requests do trigger an alert but even if I click allow the ping response is not there.

Other devices on my LAN are able to ping my IP just fine but my desktop cannot ping any IPs at all (even ::1 or 127.0.0.1 or broadcast IPs like ping 192.168.1.255 -b)

@vukitoso
Copy link

debian 10
Build from source code (26.07.2021)
1.4.0rc3
ping doesn't work

sudo opensnitchd -version
[2021-07-26 11:52:04]  INF  iptables version: [iptables v1.8.2 (nf_tables)
]
[2021-07-26 11:52:04]  WAR  iptables not available: fw, using nftables instead of iptables ([iptables v1.8.2 (nf_tables)
])
1.4.0rc3

gustavo-iniguez-goya added a commit that referenced this issue Aug 8, 2021
Before this change, we tried to determine what firewall to use based on
the version of iptables (if -V legacy -> nftables, otherwise iptables).

This caused problems (#455), and as there's no support yet for nftables
system firewall rules, it can't be configured to workaround these
errors.

Now the default firewall to use will be iptables.
If it's not available (installed), can't be used or the configuration
option is empty/missing, we'll use nftables.
@gustavo-iniguez-goya
Copy link
Collaborator

I changed how the firewall type to use is determined. By default we'll use iptables, that way we can use system-fw.json to add rules (to allow icmp for example).

If someone needs to use nftables, then they can use "Firewall": "nftables" (default-config.json). nftables' system-fw.json is not ready yet.

@molitona
Copy link

Thanks for your answer but it doesn't seem to work.

123

Works, but not persistent. And, here is how I made it persist on Arch too (This is my own solution, many ways discussed with developer before to no avail).

!/bin/bash

IFACE=$1
ACTION=$2

if [[ $ACTION = up ]]; then
if [[ $IFACE = wlp6s0 ]]; then
nft insert rule opensnitch-mangle output icmp type echo-request accept
fi
fi

in

/etc/NetworkManager/dispatcher.d

Then

sudo systemctl restart NetworkManager.service

@andryyy
Copy link

andryyy commented Aug 19, 2021

Still doesn't work for me on a Mint 20.2 with iptables.

My default for iptables is iptables-legacy, if that matters.

When I use nft it fails, too:

[2021-08-19 13:57:46]  WAR  nftables mangle rules not loaded: 0
[2021-08-19 13:57:46]  WAR  Error adding nftables mangle tables:%!(EXTRA *fmt.wrapError=Receive: netlink receive: no such file or directory)
[2021-08-19 13:57:46]  ERR  Error while Running DNS nftables rule: Receive: netlink receive: no such file or directory
[2021-08-19 13:58:16]  WAR  nftables mangle rules not loaded: 0
[2021-08-19 13:58:16]  ERR  Error while Running DNS nftables rule: Receive: netlink receive: no such file or directory
[2021-08-19 13:58:46]  WAR  nftables mangle rules not loaded: 0
[2021-08-19 13:58:46]  ERR  Error while Running DNS nftables rule: Receive: netlink receive: no such file or directory

Probably because of missing tables. I created the mangle table and it only complained about the DNS nftables rule. Is there a default set I should import?

@gustavo-iniguez-goya
Copy link
Collaborator

Be sure that the item "Firewall": "iptables" exists in /etc/opensnitchd/default-config.json , and restart the daemon (service opensntich restart)

@andryyy
Copy link

andryyy commented Aug 19, 2021

I did and also pulled a fresh copy of that file.

I purge everything and will try again tomorrow. :)

@seonwoolee
Copy link

seonwoolee commented Aug 24, 2021

I too am having this problem on Arch Linux, using iptables v1.8.7 (legacy) and opensnitch version 1.4.0.rc3. I put "Firewall": "iptables" in /etc/opensnitchd/default-config.json, restarted opensnitchd, and it still doesn't work.

@gustavo-iniguez-goya
Copy link
Collaborator

hey @seonwoolee , thank you for reporting this.

problem found. Will fix it soon.

@andryyy
Copy link

andryyy commented Aug 24, 2021

In the meantime I forgot to post my test results. They were negative obviously. :)

Thanks for looking into it!

@vukitoso
Copy link

vukitoso commented Aug 24, 2021

@molitona

Works, but not persistent.

what is the name of this console client what is on the screen?

@molitona
Copy link

molitona commented Aug 24, 2021 via email

gustavo-iniguez-goya added a commit that referenced this issue Aug 25, 2021
- The firewall rules defined in /etc/opensnitchd/system-fw.json take
precedence over the interception rules, but we were inserting the
interception rules before the system's ones. With this change #455
should be fixed.

- On the other hand, the DefaultAction was not being applied correctly
  in all cases. As of today the DefaultAction is applied in 2 scenarios:
  * When the daemon is connected to the GUI and the user doesn't answer
    a pop-up.
  * When the daemon is not connected to the GUI.

  However as we don't parse all network protocols, even if the GUI is
  connected we may end up parsing a connection and don't know what to do
  with it. In this case the DefaultAction was always Deny.

  Now in the above scenario, i.e.: when the GUI is connected but we
  can't parse a connection, we'll apply the DefaultAction configured by
  the user.
@gustavo-iniguez-goya
Copy link
Collaborator

@molitona @andryyy @seonwoolee could you test latest change to see if the ICMP works again (i.e.: if the rules defined in /etc/opensnitchd/system-fw.json take precedence over the interception ones).

I've also realized that we're denying connections that we can't parse, unconditionally, ignoring what was defined in the configuration.

@andryyy
Copy link

andryyy commented Aug 25, 2021

Is it possible to create deb packages? I would try and compile if not. :) Sorry...

@gustavo-iniguez-goya
Copy link
Collaborator

Sure, no problem, here you have:
opensnitch_1.4.0~rc4-2_amd64.deb.gz

@andryyy
Copy link

andryyy commented Aug 26, 2021

Can confirm it works. Thanks for providing the package!

@gustavo-iniguez-goya
Copy link
Collaborator

Thank you @andryyy !

@byReqz
Copy link
Author

byReqz commented Aug 26, 2021

After cleanbuilding 1.40rc4 it seems to work fine now, even without adjusting any config files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants