-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[WIP] p2p: asmap, avoid inbound connections from a specific AS #26938
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsNo conflicts as of last run. |
Would it make sense to instead offer this feature as an extension of the banning functionality (through |
I'm testing different approaches and I think makes sense to expand |
Apparently I even opened an issue about that once: #19129 |
@sipa, adding it to the |
@brunoerg Why would you only want to avoid inbound? And if so, maybe that's generally useful as a feature for banmap? |
An example: an attacker is using AWS to create multiple nodes and connect with me, I want to avoid it. However, it doesn't mean all the nodes from there are malicious, even I can have another node hosted there. |
@brunoerg For that I think it suffices to just have an asmap loaded that treats all or most of AWS as the same ASN (which I believe is the case). The inbound connection logic already prioritizes connections from diverse networks (evicting connections from groups with many networks if a new incoming connection appears from a different one). Still, it doesn't seem unreasonable to have a way to just ban for just inbound connections, but I feel like that applies equally to other IP ranges, so perhaps it is better to add that as an orthogonal feature to banman? |
I think this feature should be called something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also think it would make more sense to broaden this to a ban type. If you want to connect to peers in the AS but not accept inbound connections (which IMO is weird), why wouldn't that possibly also be the case for (eg) a subnet ban?
Closing it for now. I agree on moving it to |
Fixes #26353
For privacy/security reasons (discussed in #26353 - e.g. malicious nodes on a particular AS), we could avoid connections from particular AS (discussed in #26353). This PR adds a flag
-avoidas
, which can be specified multiple times, where you pass an ASN you want to avoid inbound connections from.e.g.