Skip to content

enhance: add allowlists support #387

@couloum

Description

@couloum

What would you like to be added?

/kind enhancement

Context
Firewall bouncer is responsible for creating firewall rules (iptables, nftables or pf).

Issue
It is currently impossible to add an allowlist to prevent some IP addresses to be blocked by firewall rules.
It is also impossible to specify a TCP/UDP port on which we don't want to block any connection.

Proposition
Add support for 2 new configuration parameters:

  • ignore_addresses: array of IP addresses or network ranges to be ignored by crowdsec firewall rules
  • ignore_ports: array of TCP/UDP ports ports to be ignore by crowdsec firewall rules

For iptables, the bounce could create rules in CROWDSEC_CHAIN before its blocking rule, with an action RETURN if source IP address match an ip from ignore_addresses or if destination port match a port in ignore_ports.

Why is this needed?

When an IP address is present in Crowdsec CTI, it is currently impossible to not block it.
If we want to not use crowdsec for some traffic, we cannot change the firewall rules to apply to some specific ports only or to exclude some ports.
Crowdsec bouncer recreate its iptables CHAIN at every restart, so we cannot properly insert exceptions (maybe we could add a script launched by systemd after crowdsec start, but it's very hacky).

A workarround would be to use ipset mode only and create firewall rules manually. However, crowdsec creates multiple ipsets and its not possible in advance to know how many there will be.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions