ufw

nf_conntrack warnings in log

Bug #1782969 reported by Dominic Raferd
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
ufw
In Progress
High
Jamie Strandboge

Bug Description

With Ubuntu 18.04 (unlike 16.04) a default setting for nf_conntrack_helper has changed:
$ cat /proc/sys/net/netfilter/nf_conntrack_helper
0
(in Ubuntu 16.04: 1)

This means that when using ufw I start seeing frequent messages like this in syslog:

kernel:[ 2796.374300] nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based firewall rule not found. Use the iptables CT target to attach helpers instead.

I believe (but can't prove) that these are caused by iptables rules set by ufw - checking with 'iptables -nL' shows there are several in ufw chains involving 'ctstate' (and no rules in other chains that have this). A workaround is to restore the previous setting of /proc/sys/net/netfilter/nf_conntrack_helper but this is apparently insecure? (see https://www.raspberrypi.org/forums/viewtopic.php?t=195736). Anyway it looks to me like a ufw bug...

ufw version: 0.35
Ubuntu 18.04

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is known when you have IPT_MODULES set in /etc/default/ufw, which is the default in Ubuntu. You can get rid of the messages by using this in /etc/default/ufw:

IPT_MODULES=

I'm working on a new ufw update that will do this by default and add additional functionality to properly use netfilter helpers rather than the deprecated method currently used by ufw. Note, by unsetting IPT_MODULES, you may break connection tracking when using protocols that require them.

Changed in ufw:
status: New → Triaged
status: Triaged → In Progress
importance: Undecided → High
assignee: nobody → Jamie Strandboge (jdstrand)
Revision history for this message
Jim MacKenzie (jim-photojim) wrote :

Any updates on this (e.g. what "additional functionality" do we need to make up for the lost connection tracking)?

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

In Ubuntu 20.04, IPT_MODULES defaults to empty so the message will be gone in default installs. It also includes some documentation (see CONNECTION HELPERS in http://manpages.ubuntu.com/manpages/focal/man8/ufw-framework.8.html) that should point you in the right direction. Work has started for adding 'ufw' syntax for making working with connection helpers easier, but it isn't yet in a released version of ufw.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.