central defense by ASN or IP4 mask#3592
central defense by ASN or IP4 mask#3592mcfnord wants to merge 2 commits intojamulussoftware:mainfrom
Conversation
|
Thanks!
I'd prefer not to hardcode services. |
ann0see
left a comment
There was a problem hiding this comment.
Very interesting! Thank you.
I believe that we'll have a long discussion here...
| emit updated(m_blockedAsns.size(), m_blockedCidrs.size()); | ||
| } | ||
|
|
||
| bool CentralDefense::tryParseIpv4CidrLine(const QString& line, Ipv4Cidr& outCidr) |
There was a problem hiding this comment.
You should write the code generic such that it supports ipv6 too
|
I’m concerned about moving network defense into an audio application, especially via a centralized blocklist. Beyond the performance overhead, this creates a central point of failure and raises privacy issues by sending client IPs to external APIs (once again). These 'wrecking ball' blocks (ASN/CIDR) risk significant collateral damage and are more precisely managed at the firewall level. Furthermore, the governance of a central 'bad actor' list is an unsolvable problem for a decentralized project—it creates a gatekeeper role that doesn't belong in the Jamulus audio engine. |
I would agree. While anyone is free to create their own fork with modifications to support their use case, I'm not convinced this kind of functionality belongs within Jamulus itself. |
|
|
||
|
|
||
| // --- Central Defense Integration --- | ||
| m_centralDefense = new CentralDefense(QUrl("https://jamulus.live/asn-ip-client-blocks.txt"), |
While this is true, we should still think about:
|
All great examples for implementing @Rob-NY RPC firewall. |
A bad actor should not even reach the application, all of this can be done on firewall level (peek into the UDP payload if it is a jamulus client connect msg, then hand it over to some user space script that does further checking) |
While this is certainly one layer of protection, it doesn't address the ability to dynamically block bad actors after a client join. Not all bad actors are known beforehand. The RPC interface could provide that functionality, and wouldn't necessarily require a server operator or client to learn linux, and nft/iptables (or Mac/PF, Windows Firewall). @stefan1000 Have you tested the RPC firewall? Your suggestion plus the RPC feature could provide a comprehensive level of protection for servers and users on them. Ultimately I believe in server admin autonomy in dealing with bad actors, and as @softins previously mentioned, if anyone chooses to modify their servers they can do so. I've always advocated inclusion of the RPC firewall code into the core application, but I understand and respect the desire not to do so. |

feat(server): Add CentralDefense for ASN/CIDR blocking
This introduces the
CentralDefensemodule, a server-side security mechanism designed to reject connections from specific Autonomous Systems (ASNs) and IP ranges (CIDRs). This allows a central service to filter out traffic from known abuse sources.Key Implementation Details:
synchronous "Bouncer" Logic:
CServer::OnNewConnectionimmediately after the mutex lock.Qt::DirectConnectionto ensure the block check completes synchronously.API Protection & Throttling:
ip-api.comfor ASN lookups but implements aggressive protection for the API provider.Configuration:
Checklist