firewall: do not allow internal docker IPs
This commit is contained in:
@@ -85,6 +85,10 @@ async function setBlocklist(blocklist, auditSource) {
|
||||
} else {
|
||||
if (ipaddr.includes(rangeOrIP, auditSource.ip)) throw new BoxError(BoxError.BAD_FIELD, `range ${rangeOrIP} includes client IP. Cannot block yourself`);
|
||||
}
|
||||
|
||||
// this won't work in cases where it's a bigger subnet
|
||||
if (rangeOrIP.startsWith('172.18.') || rangeOrIP.toLowerCase().startsWith('fd00:c107:d509:')) throw new BoxError(BoxError.BAD_FIELD, `${rangeOrIP} includes internal docker network. This cannot be blocked`);
|
||||
|
||||
++count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user