Block connector limited-broadcast targets

This commit is contained in:
2026-07-21 13:02:29 +02:00
parent b2492b820f
commit 6502775bf7
2 changed files with 17 additions and 2 deletions

View File

@@ -78,7 +78,16 @@ class HttpFetchTests(unittest.TestCase):
policy = outbound_http_policy(
{"APP_ENV": "production", "GOVOPLAN_CONNECTOR_ALLOW_PRIVATE_NETWORKS": "true"}
)
for address in ("0.0.0.0", "169.254.169.254", "224.0.0.1", "::", "fe80::1", "ff02::1"):
for address in (
"0.0.0.0",
"169.254.169.254",
"224.0.0.1",
"255.255.255.255",
"::",
"::ffff:255.255.255.255",
"fe80::1",
"ff02::1",
):
with self.subTest(address=address), patch(
"govoplan_core.security.outbound_http.socket.getaddrinfo",
return_value=[(2, 1, 6, "", (address, 443))],