-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance: add allowlists support #387
Comments
@couloum: Thanks for opening an issue, it is currently awaiting triage. In the meantime, you can:
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
@couloum: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
/kind enhancement |
If you add a whitelist within CrowdSec then a decision will not be made on those addresses and will not end up in the firewall list: https://docs.crowdsec.net/u/getting_started/post_installation/whitelists If the address is classified as malicious and is given out via a blocklist then you can specify a CAPI whitelist: https://docs.crowdsec.net/docs/next/whitelist/create_capi So it is impossible from the firewall configuration, but not impossible from CrowdSec itself if you define the above items.
Yes this is true, if the IP is malicious or in the blocklist take away from the above whitelisting issue do you want them to be able to contact any ports? there is a case where you may want them to access HTTP to get a captcha? however, you can configure a captcha remediation: https://docs.crowdsec.net/docs/next/profiles/captcha_profile And these remediations do not get taken into effect when the firewall is processing the decisions since the remediation is If it more you never want to block these ports then you can add a postrun rule to the systemd unit of the firewall remediation (yes it is hacky workaround) EG:
We wouldnt want the remediation to be the one to ignore decisions, you can configure CrowdSec to whitelist those instead so they would never end up in the LAPI decisions table. |
Moving issue across to remediation repository. |
@couloum: Thanks for opening an issue, it is currently awaiting triage. In the meantime, you can:
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
Thank you for providing this as I completely missed it. If I may, I would still argue that having a central place for whitelist would be a better UX rather than defining same IP address in multiple locations (both in the enricher and in the central API).
We deploy crowdsec on front load balancers that receive traffic for multiple services. In our use case we want to filter everything that is HTTP/HTTPS but not SMTP as we rely on other mechanisms to block IP addresses, like RBL and other stuff. Also we want logging to be visible in our SMTP server when an IP is blocked. That's why we would like to exclude port TCP/25 from the ports being controlled by crowdsec.
We'll probably do that, but I opened this enhancement request to provide a valid use-case where change in product would be nice. |
We are working on this: we are going to add a dedicated allowlist feature in LAPI that will handle both content from CAPI (community blocklist and 3rd party blocklists) and local decisions, so you won't have to handle allowlists in a lot of different places.
For this situation, I'd suggest to use the |
Good to know. I guess that answers 50% of my request, which is already good.
That's true. We initially were afraid of that because we observed a change in recent crowdsec release where it created multiple ipset as all IP addresses could not fit in 1 single. And we thought we would have to identify how many ipset were used by crowdsec first. But after more tests, it seems that only 1 ipset is used when we're in |
This change was made in order to add support for usage metrics (and here): as we need to track dropped packets or bytes per decision origin, we have to create multiple sets, it's not related to the maximum size of a set. This change was not really documented, as we consider the way we manage the rules in managed mode to be an internal implementation detail (and we don't want people to rely on the chains/rules/sets we may or may not create), but we should probably at least mention it in the documentation. |
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 rulesignore_ports
: array of TCP/UDP ports ports to be ignore by crowdsec firewall rulesFor iptables, the bounce could create rules in
CROWDSEC_CHAIN
before its blocking rule, with an actionRETURN
if source IP address match an ip fromignore_addresses
or if destination port match a port inignore_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.The text was updated successfully, but these errors were encountered: