cscli allows decisions on CIDR ranges, but nftables sets do not have the `interval` flag
TLDR: nftables sets created/managed by cs-firewall-bouncer are missing the
interval
flag, causing incorrect elements to be added for subnets.
Today I manually added a decision to ban an IPv6 subnet, which cscli reported as successful, but then I noticed that traffic from IPs in the subnet was still getting past the crowdsec6 table's chains. I dug deeper and realized that it's because the banned subnet wasn't added correctly to the crowdsec6-blacklists-cscli
set; it appears to have been added as a single IP.
2a06:4880::
is not equivalent to 2a06:4880::/32
, as seen below:
5 Replies
Important Information
Thank you for getting in touch with your support request. To expedite a swift resolution, could you kindly provide the following information? Rest assured, we will respond promptly, and we greatly appreciate your patience. While you wait, please check the links below to see if this issue has been previously addressed. If you have managed to resolve it, please use run the command
/resolve
or press the green resolve button below.Log Files
If you possess any log files that you believe could be beneficial, please include them at this time. By default, CrowdSec logs to /var/log/, where you will discover a corresponding log file for each component.
Guide Followed (CrowdSec Official)
If you have diligently followed one of our guides and hit a roadblock, please share the guide with us. This will help us assess if any adjustments are necessary to assist you further.
Screenshots
Please forward any screenshots depicting errors you encounter. Your visuals will provide us with a clear view of the issues you are facing.
© Created By WhyAydan for CrowdSec ❤️
As a test I attempted to manually add the subnet as an element, and I believe the result confirms the root cause, which is that the
interval
flag is missing from the set definition:
I already did some googling & AI-ing, but it seems that currently there is no way to override how these sets are created in cs-firewall-bouncer's configuration to add the interval
flag to the sets (it's also missing from the IPv4 crowdsec-blacklists-cscli
set).
I would love to be wrong here and find out that there is actually a way to configure cs-firewall-bouncer to create the sets with flags timeout,interval
. Or that I'm overlooking some other simple solution. Ideally, I'd like to keep the tables fully managed and not have to resort to managing them myself; I'm not even sure if it would work if I configured cs-firewall-bouncer as set-only, since the sets would likely be recreated (incorrectly) on every restart.
Any advice?That looks more like a bug report for github
2a06:4880::/32 is a LOT of addresses, I know... probably for the best that it didn't work 😂
But still... the sets are missing a key attribute needed to support an existing cscli capability.

GH issue created: https://github.com/crowdsecurity/cs-firewall-bouncer/issues/412
GitHub
cscli allows decisions on CIDR ranges, but nftables sets are missin...
What happened? TLDR: nftables sets created/managed by cs-firewall-bouncer are missing the interval flag, causing incorrect elements to be added (IPv6) or total failure to add (IPv4) for subnets. To...