Crowdsec does it by using crowd-sourced blocklists (hence the name). So if an IP triggers a scenario on other machines, that malicious address will be proactively added to your blocklist before it ever gets a chance to impact your machine.
That is the big advantage of crowdsec over reactive-only solutions, like fail2ban.






I didn’t see an obvious link to the source code, so here it is for those interested: https://github.com/Drop-OSS/drop