Crowdsec: A Fail2Ban alternative written in Go
github.com
github.com
My immediate thought is "Fail2ban works. I don't need or want communication with a 3rd party right now."
I haven't looked at the source, but it should be easy to turn the crowdfiltering off or self-host if you have your own larger enterprise, no ?
It also depends on what exactly is transmitted. Transmitting all IP addresses in the clear might be bad, sending out hashes might be better ?
I think it's actually a good idea to try to detect those IP at scale. On your own individual server, you just see a million login attempts from a million different nodes on a botnet. But if you have millions of servers report the bad IPs and aggregate, you can see patterns and hopefully catch whole botnets.
DMARC isn't a crowdsourced spam signal. And from my memories chatting with people running mail servers—the crowdsourced spam filtering is fairly controversial.
But most email providers build spamfilters using 'crowdsourced' techniques between their users (if enough users mark a sender spam it might be marked spam for all users).
And while that may be controversial, it's also highly effective.
How many IP adresses are valid? Can't you hash them all and compare them with the hash you receive?
2^32 IPs is 4GB * 4 Bytes (1 IP) + 4GB * size of the hash should be the needed space I think.
2) I won't be using any "security" tool that automatically shares details on active mitigation efforts.
> I think it's actually a good idea to try to detect those IP at scale.
It is! But not with my machines.
Yet at the same time I think setting up a long running reputation weighted reputation clearing house would be amazing. (And if nothing else at least something like this could emerge from all the crypto-staking-reputation research. See Polkadot and Ethereum's plans about keeping folks honest with bounties (reverse staking?) for example.)
So basically anyone joining the network for the next year sits in limbo, the network is not capable of catching more "bad IPs" for that year, because any report by new members requires cross-verification by the original nodes/honeypots.
This seems pleasantly conservative. Also, is there a way for nodes to lose trust rank? (How will the network find out if a TR1 node is reporting false negatives?)
I don’t see why we need to replace fail2ban, but I find the idea of a global repository of bad IPs and reputation very interesting.
Hasn’t pass the pylint,?futurize, or 2to3 by much.
But if the maintainers are willing, I can do those things.
I saw your issue[1] on GitHub, and that's just a misunderstanding of how fail2ban was ported to Python 3. fail2ban uses the use_2to3 feature of setuptools.setup to do automatic translation upon installation.[2] While I do wish the code runs under Python 3 as is, what users actually run is totally working code.
[0] https://packages.ubuntu.com/xenial/amd64/fail2ban
[1] https://github.com/fail2ban/fail2ban/issues/2853
[2] https://github.com/fail2ban/fail2ban/blob/960e30cfcdae7e2c81...
But it wasn’t written cleanly as many tools would attest.
I'd love to see integration with Caddy here, I'm sure many people would appreciate a Caddy plugin that can do what they'd typically use fail2ban for.
1/ You don't have to communicate. If you don't, you get a modern, fast, decoupled fail2ban with many various remediations (instead of just drop) and observability. What you don't get though are the IPs spotted by the crowd and curated by us. You don't contribute, you don't get them, fair. If you contribute, only offending IP / timestamp / scenario triggered are sent back to us to establish what we call a consensus (to avoid false positives and poisoning)
2/ We are super vigilant and sensitive about privacy. We made the architecture and many other crucial points compatible with GDPR (EU Law framework regarding private data handling)
3/ IP sent: We could hash it, but it's very easy to reverse. Maybe have a public/private key encryption, quite a good point, I'll tell the team, thx.
4/ You can contribute scenario in YAML or data source connectors in Grok. We are not hardcore for or against any language, but Go allows portability (we'll release Win & Macos binaries) and is container friendly, plus super fast, easy to read and scalable. Ever since we released, tons of proposal were made to port it to a 'real' language, sorry we are fine with that choice, no intent to change, no intent to convert anyone either ;)
5/ Herd immunity is what we want to create indeed. We tried to explain the combination of Behavior + Reputation by using an analogy with Waze. It worked but is less accurate. I prefer the one with Immune system.
We are available for direct dialog on gitter. allow just some delays depending on your time zone, we are based in France, so CEST. (https://gitter.im/crowdsec-project/community) we answer in French & English.
Try it, it's free, MIT licensed and stable: https://github.com/crowdsecurity/crowdsec
Thanks,
Philippe.
We monetize the aggregated, curated data and the features we offer that cost us infrastructure to run.
This question gets posted on every single "X written in Y", and I can't help but think it's an effortless way to broadcast some strange form of superiority (namely: by showing my exasperation with Go enthusiasts, I place myself in the category of people unimpressed by Go. Bonus points for mentioning Rust or Haskell.)
This feeling is at odds with open source culture, where the ability to understand the code you're running is absolutely central. If you value Open Source, it should be pretty easy to understand how "written in language X" is a valuable piece of information.
Come on, now...
I think it's safe to say that one should check these (obvious) things before posting a snarky comment. It seems to me that this is part of the HN community ethos.
There have been numerous source-available but proprietary github projects posted to HN.
Tell me a game engine is written in Python or Go and i can infer a lot about the intended audience or runtime performance characteristics.
The HN crowd seems to be so annoyed by language recently, but to me they just scream of missing the point entirely. /shrug
"Written in Go" signifies to me that it can be faster and more resource-efficient than Fail2Ban: a good reason to check it out.
Maybe I should start logging attempted pubkeys as a side project just to see what pops up.
https://netslovers.com/2018/02/28/port-knocking-server-secur...
1 line in your iptables config
Joke apart, the trend to rewrite any single thing in Go/Rust is scary: why take something that is working and standard, and make it new? People have tried this hundreds of times as per hackernews history, and it's mostly not worth it.
However, it is a good training, tutorial for Go.
Many useful projects get abandoned just because someone made a more popular alternative.
In 2-3 years the rewrite in go/rust fad will fade and both the new and the old projects end up abandoned.
I'll be downvoted to hell for this: jumping on fads harms the FLOSS ecosystem.
Additions: also, static liking and embedding many dependencies harms Linux distributions.
> Crowdsec is in BETA version. It shouldn't, and didn't crash any production so far we know, but some features might be missing or undergo evolutions. IP Blocklists are limited to very-safe-to-ban IPs only (~5% of the global database so far, will grow soon)
How does it fare in terms of performance compared to fail2ban? as far as I can see, fail2ban can chrun for quite a bit of cpu digesting logs. Is crowdsec faster/lighter?
another question regarding backwards compatibility... eg porting fail2ban configs, action scripts, jails etc. I guess it’s not going to be a drop in replacement, but are there any porting efforts, recipes, scripts, docs to help with the transition?
sorry for the crappy formatting, but using my mobile atm and couldn’t wait to ask :)
A bot is unlikely to reconfigure the host's network stack to grab or rotate additional IPv6 addresses. That type of behaviour would be very easy to detect by endpoint protection systems and shut down.
When scanning, scraping, and/or brute forcing service passwords they're likely to remain using the same IPv6 address either permanently or on a daily rotation, most likely this will be mostly impacted by OS defaults on privacy addresses as I don't actually expect many normal users to know and/or care about them.
So if you're attacked on IPv6, you'll likely be equally protected by fail2ban as you are on IPv4.