Skip to content

Blacklists are empty after filter sync #102

@psalecker

Description

@psalecker

I'm using CrowdSec on pfSense Plus 24.03 and noticed that the crowdsec_blacklists and crowdsec6_blacklists PF tables are often empty, while the crowdsec-firewall-bouncer is working as it should. I narrowed the problem down to the filter_configure_sync function of pfSense.

The easiest way to reproduce it is to call /etc/rc.filter_configure_sync:

# /sbin/pfctl -t crowdsec_blacklists -T show | wc -l
   56019
# /etc/rc.filter_configure_sync
755 addresses deleted.
56019 addresses deleted.
# /sbin/pfctl -t crowdsec_blacklists -T show | wc -l
       0

In practice I saw two use-cases where this happens:

  1. When having have two pfSense instances and Configuration Synchronization configured, every time you save a change on the primary instance, it reloads everything on the secondary instance, causing the tables to get cleared on the secondary.
  2. When using Time Based Rules, pfSense adds a line to the /etc/crontab, that is clearing the tables every 15 minutes:
    0,15,30,45 * * * * root /etc/rc.filter_configure_sync

Ideally the CrowdSec package would hook into the filter_configure_sync function and either prevents that the entries get removed or adds them back immediately.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions