Closed diox closed 1 week ago
it should just be a /64 or /128 to be safe, but OTOH most providers will give their users a /56 or /48, so for a restriction to be effective, maybe it should be at least a /56.
Looking at other IP ban implementations out there the consensus seems to be /64 strikes the best balance between effectiveness and potential side effects. This is only for this particular scanner action anyway, and it can be changed by admins if necessary.
Description
For extreme cases, we have a scanner action that can be triggered automatically that not only prevents auto-approval of the add-on but also restricts all the associated IP addresses, preventing them from submitting (
Delay auto-approval indefinitely and add restrictions to future approvals
).Because IP restrictions are made for an entire network, we have the following code:
This is an ugly shortcut, but it works for IPv4 as
/32
will be a network made of that single IP. For IPv6 though, it's doubly wrong:has host bits set
ValueError
when thestrict=False
argument it omitted - we consider that as invalid when an admin is trying to submit such a restriction)/32
is too wideWhat netmask we should use is an interesting question - since this is an automated action, perhaps it should just be a /64.
Acceptance Criteria
Checks
┆Issue is synchronized with this Jira Task