Closed ne20002 closed 3 weeks ago
@ne20002: Thanks for opening an issue, it is currently awaiting triage.
In the meantime, you can:
@ne20002: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.
/kind feature
/kind enhancement
/kind bug
/kind packaging
I'm now using the new bouncer 0.0.30 in non set-only mode, the created chains and rules can be easily enhanced with the changes proposed above. It even gives more accurate numbers, now the overall count is just counting packets that are incomming on one of the wan interfaces and that really should be checked for filtering. Sadly, the additional rules needs to be applied manually after starting the bouncer process (e.g. after a reboot of the router).
This is how it looks:
I believe the missing crowdsec-blacklists-crowdsec in Ipv6 is due to not have had at least a single match on any of the rules so the set is not created?
Hi @mmetc , @blotus
I have updated the OpenWrt crowdsec-firewall-bouncer package to make use of the new Crowdsec firewall bouncer. I'm happy to see that now the bouncer uses tables and chains if they have been created in advance and then adds its rules to those. With this the rules enhancement as described above can be achieved at least for the OpenWrt package.
/kind enhancement
What would you like to be added?
First of all: I like the ability to collect metrics of the bouncer.
For OpenWrt the rules as created by the bouncer in version 0.0.30 are not ideal. Most OpenWrt devices have limited power and based on the use case, that OpwnWrt (in this case) is a routing device, additional definitions for the created rules are neccessary. Until version 0.0.30 the OpenWrt bouncer package created the rules by itself running the bouncer in set-only mode. With the new approach this is still working (thank you) but lacks the features for the metrics.
I will only use ipv4 here but it's the same for ipv6. Now look at this:
This set of rules is suboptimal, because:
conntrack
. There is a fastpath for all accepted,related packets. But this fastpath only applies to the fw4 table. In the Crowdsec table's chain any packet (not dropped earlier in fw4) if checked again. Adding the accepted/related fastpath to the chains is a must.Even though the set lookup is fast, bypassing it if it is not neccessary is even faster.
As an example I suggest to change the rule creation for
to this:
whereas:
{ wan, wg1 }
) there should be a configuration option and in case it is not set this line should be omitted.Why is this needed?
Needed for proper function of OpenWrt devices.