Repository navigation
Description
Ready: implementation plan (refined 2026-10-17 at 3dd7fa6)
This section supersedes any text below that conflicts with it.
Decisions
- Key question 1 (classification): accept the stdlib classes. Every valid, specified address falls into exactly one class. It is documentation if it is in the documentation constant below. It is public if
is_global and not is_reserved and not is_multicastholds and it is not in the 192.88.99.0/24 constant below. Every other address is local, and the unspecified addresses stay rejected as today. The RFC tables atsrc/devops_cli/security/reference_extractor.py:45-74are deleted. With today's tables, an address in no class falls throughcheck_threat_intelto the Cloudflare Radar domain lookup. Measured at 3dd7fa6:224.0.0.1,239.1.2.3andff02::1are neither public, local nor example, soCloudflareRadarClient.check_domainsends them to/domain/<ip>(src/devops_cli/security/vulnerability_lookup.py:537-549,:458). Without a partition,100.64.0.1would join them. - The documentation constant: one closed tuple of
ipaddress.ip_networkobjects,CONST_DOCUMENTATION_IP_NETWORKS, insrc/devops_cli/config/constants.py, with each RFC cited. It holds 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 (RFC 5737); 2001:db8::/32 (RFC 3849); 3fff::/20 (RFC 9637); 198.18.0.0/15 (RFC 2544); and 2001:2::/48 (RFC 5180). The stdlib folds these intois_private, so no library tells a documentation address from an RFC 1918 one.ipaddressobjects, not strings, are the form feat(ci): hand-rolled URL and address parsing failsdevops ci, AGENTS.md makes the library the rule, and reviews stop discarding the findings #1107's rules accept. - RFC 9637 (3fff::/20): it is in the documentation constant, so
3fff::1is reported as a documented example, like2001:db8::1. Today it is reported as local. Python 3.14.7 already reads it as private and not global, so it was never public; RFC 9637 reserves it for documentation, and IANA lists it as "Documentation". - 192.88.99.0/24: it stays non-public and is reported as local, through a second one-entry constant,
CONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBAL, insrc/devops_cli/config/constants.py, which cites RFC 7526 and RFC 6751. A test pins thatipaddress.ip_address("192.88.99.2").is_globalis still True, so the constant is deleted when CPython follows IANA. IANA's IPv4 special-purpose registry lists the /24 as "Deprecated (6to4 Relay Anycast)" with no reachability values, and its one live entry, 192.88.99.2/32 (RFC 6751), as "Globally Reachable: False". Python 3.14.7 still reads the whole block as global. Sending it to Shodan would rest on a stdlib gap, so the stricter answer wins. - The other blocks that become public: 192.0.0.9, 192.0.0.10, 2001:1::1, 2001:1::2, 2001:3::/32, 2001:4:112::/48, 2001:20::/28 and 2001:30::/28. They are accepted as public, so Shodan may look them up. IANA marks each one "Globally Reachable: True", and none carries an internal address. A cross-check of both IANA special-purpose registries (CSV, fetched 2026-10-17) against this rule on Python 3.14.7 disagrees in the public direction only for 192.88.99.0/24 and 192.88.99.2/32. The other differences (64:ff9b::/96, 2001:1::3/128) make an address local, which is the safe side.
is_example_or_reserved_ip: deleted, with its export insrc/devops_cli/security/__init__.py. Its callers useis_example_ip.is_private_or_local_ipbecomes "specified, not documentation and not public". Reserved space is now local, not "example", so the two-predicate split has nothing left to carry. Pre-1.0, so there is no alias.- What shifts (the changelog fragment lists it): 0.0.0.0/8, 100.64/10, 192.0.0/24 (except .9 and .10), 192.88.99/24, 240/4, 255.255.255.255, 100::/64, 2002::/16 and the rest of 2001::/23 (Teredo 2001::/32 and the deprecated ORCHID 2001:10::/28 among them; 2001:2::/48 stays documentation) move from "Documented Example" to local. 192.0.0.9, 192.0.0.10, 2001:1::1, 2001:1::2, 2001:3::/32, 2001:4:112::/48, 2001:20::/28 and 2001:30::/28 move from "Documented Example" to public. 3fff::/20 moves from local to "Documented Example". Multicast moves from no class (sent to Radar) to local.
- The message at
src/devops_cli/ai/tools/builtin_tools.py:461-463names exactly whatis_example_or_invalid_network_targetexcludes: example domains (RFC 2606, RFC 6761), documentation addresses (RFC 5737, RFC 3849, RFC 9637) and benchmarking addresses (RFC 2544, RFC 5180). RFC 6890 is dropped from it. - Key question 2,
host.docker.internal: it is refused in_validate_local_whitelist_item(src/devops_cli/sandbox/models.py:155), beforeis_loopback_or_private_host. The message asks for the IP or CIDR that the cluster reaches the host on. The name is a newCONST_DOCKER_HOST_GATEWAY_HOSTNAMEinsrc/devops_cli/config/constants.py, compared withdns.name.from_textequality, which ignores case and the trailing dot. A host that dnspython cannot parse is not that name, so it falls through to the existing checks. That followsCONST_CLOUD_METADATA_DNS_HOSTNAMES(constants.py:2235, compared atcore/validation.py:65-66and:142), so there is no hand-rolledlower().rstrip("."). Refusing at validation means the name never reachesgetaddrinfo, even after fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 lets names with no public suffix throughis_loopback_or_private_host. On the workstation the name resolves to the container runtime's gateway (169.254.1.2 under rootless Podman), which a cluster pod cannot reach. - Key question 2,
localhost, and with it every loopback entry: a loopback entry emits no egress rule at all. That covers the namelocalhostand any loopback address or network, such as127.0.0.1or::1/128._resolve_local_hostreturns[]for it, usingis_loopback_host(core/validation.py:70) for names and addresses andip_network(...).is_loopbackfor CIDRs._build_whitelist_egressskips any entry whose resolution is empty. NetworkPolicy never polices pod loopback, so an ipBlock for it is a no-op. A rule withto: []would allow every destination on that port. The guard sits in the one function that builds the rules, so no resolver can ever produceto: []. - No DNS lookup is added to the policy builder. Loopback entries and
host.docker.internalare settled before_resolve_local_dns. - The two RFC 1918 fixture addresses this PR touches in
tests/test_sandbox_networking.py(:48-49, and the expected rules at:250-251) become RFC 5737 addresses (192.0.2.50and198.51.100.5), which the stdlib also classes private. AGENTS.md keeps RFC 1918 literals out of tests.
Delivery
-
PR 1 (M): the classification, both constants, the message, the whitelist changes, the test updates and
changelog.d/1174.md. Closes fix(security): reference_extractor classifies addresses with ipaddress, and the sandbox local whitelist stops mapping host.docker.internal to pod loopback #1174. Tests first:- a parametrised address-to-class table asserting that exactly one of
is_example_ip,is_public_ipandis_private_or_local_ipis True for each specified address. It covers8.8.8.8and2606:4700::1(public);192.0.2.1,198.18.0.1,2001:db8::1,2001:2::1and3fff::1(documentation); the RFC 1918 addresses already used attests/test_reference_extractor.py:21-23,100.64.0.1,192.0.0.1,192.88.99.1,240.0.0.1,255.255.255.255,224.0.0.1,ff02::1,100::1,2001::1and2002:a00:1::1(local);192.0.0.9,2001:1::1and2001:4:112::1(public); and the pitfall addresses64:ff9b::a00:1,4000::1and5f00::1(local, because reserved); ipaddress.ip_address("192.88.99.2").is_global is True(the guard for the gap constant);check_threat_intelfor224.0.0.1,100.64.0.1and192.88.99.1making no HTTP request, with the Shodan and Radar clients'_client.getpatched to fail;- the new message text;
local_whitelist=["host.docker.internal"]and["HOST.DOCKER.INTERNAL."]raising the refusal at model validation, withsocket.getaddrinfopatched to fail;local_whitelist=["http://localhost:11434"],["127.0.0.1"]and["[::1]:8080"]each producing an egress list of only the kube-dns rule;_build_whitelist_egress(["example.com"], lambda host: [])returning only the kube-dns rule;- every rule in every whitelist policy in
_WHITELIST_POLICIEShaving a non-emptyto.
Files:
src/devops_cli/config/constants.py,src/devops_cli/security/reference_extractor.py,src/devops_cli/security/vulnerability_lookup.py,src/devops_cli/security/__init__.py,src/devops_cli/ai/tools/builtin_tools.py,src/devops_cli/sandbox/models.py,tests/test_reference_extractor.py,tests/test_vulnerability_lookup.py,tests/test_builtin_tools.py,tests/test_sandbox_networking.py,changelog.d/1174.md, and a new task filedocs/agent/tasks/task-1174-address-classes-and-local-whitelist.md(**Status**: Done). - a parametrised address-to-class table asserting that exactly one of
Acceptance criteria
-
src/devops_cli/security/reference_extractor.pyholds no RFC tables.CONST_DOCUMENTATION_IP_NETWORKSandCONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBALinsrc/devops_cli/config/constants.pyare the only address constants the classification reads, both asipaddressobjects with their RFCs cited. -
is_public_ipisis_global and not is_reserved and not is_multicast, outside 192.88.99.0/24 and outside the documentation constant. - Every specified address in the test table is in exactly one class. Multicast, 100.64.0.0/10 and 192.88.99.0/24 are local, and none of them reaches Shodan or Cloudflare Radar.
-
3fff::1is reported as "Documented Example".is_example_or_reserved_ipno longer exists insrcortests. - The message at
ai/tools/builtin_tools.py:461-463names RFC 2606, 6761, 5737, 3849, 9637, 2544 and 5180, and not RFC 6890. -
host.docker.internal, in any case and with or without a trailing dot, is refused atSandboxNetworkConfigvalidation with a message asking for an IP or CIDR, and no DNS lookup happens. - Loopback entries (
localhost,127.0.0.1,[::1]) produce no egress rule. No generated NetworkPolicy rule has an empty or missingto. Neither name maps to127.0.0.1/32. - Offline: every address in the new tests is a literal, and every test touching
host.docker.internalorlocalhostpatchessocket.getaddrinfoto fail. -
uv run devops cipasses within the 5-minute budget.changelog.d/1174.mdlists the report-class shifts above and the newhost.docker.internaland loopback handling; CHANGELOG.md and docs/ROADMAP.md are not edited.
Current references
- RFC tables:
src/devops_cli/security/reference_extractor.py:45-74;is_example_ip:102-111;is_example_or_reserved_ip:114-125;is_example_or_invalid_network_target:168-195;is_public_ip:198-215;is_private_or_local_ip:218-229;_is_url_local_host:444-450;_extract_url_referenceexample tag:481;_extract_ip_reference:504-545(example tag:517, public:520, local:531);_TLD_EXTRACTOR(which fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 replaces):37 - Exports:
src/devops_cli/security/__init__.py:22-29and:74-82 - Shodan gate and summary:
src/devops_cli/security/vulnerability_lookup.py:314-319; Radar gates:354-361,:531-541; Radar HTTP request:458 - Threat-intel message and Shodan branch:
src/devops_cli/ai/tools/builtin_tools.py:459-466 - Local whitelist tuple:
src/devops_cli/sandbox/models.py:162-165(in_validate_local_whitelist_item:155-168);localhost/host.docker.internal→127.0.0.1/32mapping:268-269(in_resolve_local_host:266-280);_build_whitelist_egress:283-299;_resolve_local_dns:242-263 is_loopback_host:src/devops_cli/core/validation.py:70;is_loopback_or_private_host::255; thedns.namecomparison pattern:65-66,:142;CONST_CLOUD_METADATA_DNS_HOSTNAMES:src/devops_cli/config/constants.py:2235- Tests:
tests/test_reference_extractor.py:17-24and:857-995(special IPs:918-930, filtered benchmark:992);tests/test_sandbox_networking.py:44-52(fixture withhost.docker.internal),:240-254(expected loopback ipBlocks at:249and:252),:636(127.0.0.1/32on 11434);tests/test_builtin_tools.py:257-261
Dependencies and order
- fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 and fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431: closed.
- fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 (v0.2.37, assigned to the Gemini agent): it touches two files that this item also touches.
- In
src/devops_cli/sandbox/models.py, both items edit_validate_local_whitelist_item(:155-168), where fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 deletes the same tuple (:162-165). - In
src/devops_cli/security/reference_extractor.py, fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 replaces_TLD_EXTRACTOR(:37), while this item rewrites the IP tables and predicates (:45-229). These regions do not overlap. - Order: this item lands first. fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887's own body already defers the tuple to "fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897's second PR" (this item), and the
host.docker.internalmapping stays here. After this item, fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 finds no tuple to delete. It must keep thehost.docker.internalrefusal ahead ofis_loopback_or_private_host, and this item's test enforces that. - If fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887 merges first, this item rebases and puts its refusal ahead of fix(security): local names come from the public suffix list, and domains match on DNS labels, not string suffixes #887's rewritten check.
- In
- feat(cli): sandbox enforcement audit declared vs engine vs enforced (
devops sandbox audit) #698's PR 1 and PR 3 editSandboxPolicyinsrc/devops_cli/sandbox/models.py(:408-438). The regions do not overlap; this item lands first, and feat(cli): sandbox enforcement audit declared vs engine vs enforced (devops sandbox audit) #698 rebases. - feat(ci): hand-rolled URL and address parsing fails
devops ci, AGENTS.md makes the library the rule, and reviews stop discarding the findings #1107's gate: neither new constant trips its rules, because both holdipaddressobjects. Thedns.namecomparison adds nonet-*construct.
Problem
Split from #897 (owner decision, 2026-10-04: one issue = one PR). This is #897's former PR2 scope: two hand-rolled constructs whose fix changes output and behaviour, so each needs an owner decision. Lines cited at b61e5a0 (release/v0.2.26) unless stated.
- RFC tables.
security/reference_extractor.pywas rewritten by fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431 (merged, v0.2.26). Its RFC tables are at:45-74. They are read byis_example_or_reserved_ip(:115),is_public_ip(:199) andis_private_or_local_ip(:219). - A wrong host-gateway mapping.
sandbox/models.py:213-214mapshost.docker.internal(andlocalhost) to127.0.0.1/32, and:129-132accepts both names in the local whitelist.- The host gateway is not the pod's loopback.
- A
127.0.0.1/32ipBlock does nothing, because NetworkPolicy never polices pod loopback. - Resolving the name on the workstation is no fix either: in a rootless Podman container,
/etc/hostsmaps it to 169.254.1.2, a link-local address the metadata guard refuses.
- Pitfall (measured in fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897).
is_globaldoes not implynot is_reservedornot is_multicast.64:ff9b::a00:1(the NAT64 form of an RFC 1918 address) and4000::1are global and reserved, and224.0.0.1is global and multicast.is_public_ipgates Shodan InternetDB lookups (security/vulnerability_lookup.py:315,ai/tools/builtin_tools.py:460). Dropping those terms would send wrapped internal addresses to a third party.
Acceptance criteria
- The reference_extractor RFC tables (
security/reference_extractor.py:45-74) are replaced as key question 1 decides.is_public_ipkeepsnot is_reservedandnot is_multicast. - The RFC list in the message at
ai/tools/builtin_tools.py:456matches the new classes. -
host.docker.internalandlocalhostin the sandbox local whitelist (sandbox/models.py:129-132,:213-214) are handled as key question 2 decides. Neither name maps to127.0.0.1/32, and no DNS lookup is added to the policy builder. - Tests updated: tests/test_sandbox_networking.py:174-197 and tests/test_reference_extractor.py:1019-1031 and
:1093(cited at dcafadf; re-check when refined, since fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431 rewrote the module). - Offline: every address is a literal, and no test makes an unpatched non-numeric lookup.
-
uv run devops cipasses within the 5-minute budget. Achangelog.dfragment named for this issue lists the report-class changes and the newhost.docker.internalhandling. CHANGELOG.md and docs/ROADMAP.md are not edited.
Key questions
- What about reference_extractor's classification shift? (was fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 key question 4; owner decision when this item is refined) Proposed:
- Accept the stdlib classes, keeping
not is_reservedandnot is_multicastinis_public_ip. - Keep one closed constant of
ip_networkobjects for the documentation and benchmarking ranges (RFC 5737, RFC 3849, RFC 9637, RFC 2544, RFC 5180), with the RFCs cited. The stdlib folds these ranges intois_private, and no library tells a documentation address from an RFC 1918 one. This is the one address constant the item would keep, so it is weighed against the rule decided in fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897's key question 1 (reputable libraries, never literal address sets). - What shifts: without the tables, 0.0.0.0/8, 100.64/10, 192.0.0/24, 198.18/15, 240/4, 255.255.255.255, 100::/64, 2002::/16 and parts of 2001::/23 change report class. The RFC list in the message at
ai/tools/builtin_tools.py:456changes with them.
- Accept the stdlib classes, keeping
- What happens to
host.docker.internalandlocalhostin the local whitelist? (was fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 key question 5; owner decision when this item is refined) Proposed:- Refuse
host.docker.internalwith a message asking for an IP or CIDR. localhostemits no ipBlock, because pod loopback is never policed.- No DNS lookup is added to the policy builder.
- Refuse
Dependencies
- After fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897: it lands the address predicates in
core/validation.pyand editssandbox/models.pyfirst. - fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431 is merged; it rewrote
reference_extractor.py.
Strategic alignment
- Priority P1. It finishes fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897's removal of hand-rolled IP constructs and removes a sandbox whitelist entry that emits a no-op ipBlock for the host gateway.
- Milestone: none here; the roadmap tooling places it.
- Size: medium. Two source modules plus one message string, and two test files. One PR.
- Related: fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897, fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431, feat(telemetry): sandbox egress port scoping, collector lane & in-container trace context #702, fix(security): URL and host:port reads use the sending client's parser, so key trust, crawls, probes and settings act on the host actually dialled #1112 (
sandbox/models.py:62-82).
Update 2026-10-08: refinement
Both defects stand; #897 landed. Test lines moved: tests/test_reference_extractor.py:918-930 and :992; tests/test_sandbox_networking.py:174-197 is unchanged. Whichever of this item and #887 lands second drops sandbox/models.py:129-132. Both key questions wait for the owner.
Proposed design
Problem statement
The security reference extractor uses hand-rolled RFC tables that are inconsistent with standard IP classification libraries. Additionally, the sandbox local whitelist incorrectly maps host.docker.internal to pod loopback, which is not a valid network policy action.
Acceptance criteria
- Criterion 1: The reference_extractor RFC tables are replaced with standard library classes while maintaining is_public_ip's gate of not is_reserved and not is_multicast.
Verification: Verify that security/reference_extractor.py uses ipaddress module classes instead of hand-rolled tables, and that is_public_ip still excludes reserved and multicast addresses. - Criterion 2: The RFC list in the message at ai/tools/builtin_tools.py:456 matches the new IP address classifications.
Verification: Check that ai/tools/builtin_tools.py contains an updated RFC list reflecting the new classification rules from reference_extractor. - Criterion 3: host.docker.internal and localhost are handled correctly in the sandbox local whitelist without mapping to 127.0.0.1/32.
Verification: Ensure sandbox/models.py does not map host.docker.internal or localhost to 127.0.0.1/32, and no DNS lookup is added to the policy builder. - Criterion 4: Tests are updated to reflect the new behavior of reference_extractor and sandbox local whitelist.
Verification: Run tests/test_sandbox_networking.py:174-197 and tests/test_reference_extractor.py:1019-1031 to verify they pass with updated expectations. - Criterion 5: No network lookups are performed during testing, ensuring offline execution.
Verification: Confirm that no unpatched DNS or IP resolution occurs in test environments by checking for literal addresses only.
Key questions
- What about reference_extractor's classification shift? (was fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 key question 4; owner decision when this item is refined): Accept the stdlib classes, keeping not is_reserved and not is_multicast in is_public_ip. Keep one closed constant of ip_network objects for documentation and benchmarking ranges (RFC 5737, RFC 3849, RFC 9637, RFC 2544, RFC 5180), with the RFCs cited. The stdlib folds these ranges into is_private, and no library tells a documentation address from an RFC 1918 one. (proposed) [sources: src/devops_cli/security/reference_extractor.py:45-74]
- What happens to host.docker.internal and localhost in the local whitelist? (was fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897 key question 5; owner decision when this item is refined): Refuse host.docker.internal with a message asking for an IP or CIDR. localhost emits no ipBlock, because pod loopback is never policed. No DNS lookup is added to the policy builder. (proposed) [sources: src/devops_cli/sandbox/models.py:129-132]
Open questions
- Accept the stdlib classes, keeping
not is_reservedandnot is_multicastinis_public_ip. - Keep one closed constant of
ip_networkobjects for the documentation and benchmarking ranges (RFC 5737, RFC 3849, RFC 9637, RFC 2544, RFC 5180), with the RFCs cited. The stdlib folds these ranges intois_private, and no library tells a documentation address from an RFC 1918 one. This is the one address constant the item would keep, so it is weighed against the rule decided in fix(security): egress guards refuse cloud metadata in every numeric, NAT64 and provider form, classified by ipaddress and one maintained library #897's key question 1 (reputable libraries, never literal address sets). - What shifts: without the tables, 0.0.0.0/8, 100.64/10, 192.0.0/24, 198.18/15, 240/4, 255.255.255.255, 100::/64, 2002::/16 and parts of 2001::/23 change report class. The RFC list in the message at
ai/tools/builtin_tools.py:456changes with them. - Refuse
host.docker.internalwith a message asking for an IP or CIDR. localhostemits no ipBlock, because pod loopback is never policed.- No DNS lookup is added to the policy builder.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 17, 2026
Readiness check for v0.2.37, against
release/v0.2.36at 22d8748. Line numbers are at that commit.Status: ready after a reference refresh, once the owner signs off the two decisions in the body. One pull request (M).
Today
src/devops_cli/security/reference_extractor.py:45-74.is_example_ip(:103, uncited);is_example_or_reserved_ip(:115);is_public_ip(:199);is_private_or_local_ip(:219).src/devops_cli/sandbox/models.py:161-166accepts both names, and:268-269maps them to127.0.0.1/32.References that moved
models.py:129-132→:161-166, and:213-214→:267-269src/devops_cli/ai/tools/builtin_tools.py:456→:462, and:460→:466src/devops_cli/security/vulnerability_lookup.py:315→:314tests/test_sandbox_networking.py:174-197→:236-252. The fixture at:45-52and:636also changes.Dependencies: #897 and #431 are closed. #887 (open) edits the same tuple (
models.py:161-166); whichever lands second deletes it. #698's seccomp slice also editssandbox/models.py.Gaps in the body
_build_whitelist_egress(:283-298), given an empty list, producesto: [], which allows every destination on that port. The rule must be dropped entirely, and a test must assert that.host.docker.internalrefusal belongs in_validate_local_whitelist_item(:155). Anywhere later, it falls through togetaddrinfo.192.88.99.0/24is in today's table, but the standard library saysis_global=Truefor it. Without the table it becomes public and is sent to Shodan. The body's "what shifts" list doesn't mention this.3fff::/20) is not in today's tables.Plan, tests first
192.88.99.1and100.64.0.1;getaddrinfopatched.reference_extractor.py, the message atbuiltin_tools.py:462andmodels.py, and addchangelog.d/1174.md.fix(security): addresses are classified with ipaddress, and the sandb…
dan-petty commentedon Oct 18, 2026
What changed
#1622, merged into
release/v0.2.37as 25e2cda.17 file(s) changed.
How it was verified
Check runs at 305071e:
Acceptance Criteria of
docs/agent/tasks/task-1174-address-classes-and-local-whitelist.md:security/reference_extractor.pyholds no RFC tables;CONST_DOCUMENTATION_IP_NETWORKSandCONST_NON_GLOBAL_NETWORKS_STDLIB_READS_GLOBALare the only address constants the classification reads (test_every_specified_address_is_in_exactly_one_class).is_public_ipisis_global and not is_reserved and not is_multicast, outside 192.88.99.0/24, fec0::/10 and the documentation constant;test_the_stdlib_still_reads_each_non_global_network_as_globalreports when CPython follows IANA and a network of the second constant can go.::ffff:192.88.99.2is local and::ffff:192.0.2.1a documented example (test_every_specified_address_is_in_exactly_one_class).0.0.0.0,::andhttp://0.0.0.0:8000without a request (test_check_threat_intel_asks_no_service_about_a_local_address,test_shodan_answers_a_documentation_or_local_address_without_a_request,test_cloudflare_radar_answers_a_documentation_or_local_address_without_a_request).3fff::1is reported as "Documented Example" (test_a_report_tags_documentation_space_as_an_example_and_reserved_space_as_local), andis_example_or_reserved_ipno longer exists insrcortests.check_threat_intel's reply names RFC 2606, 6761, 5737, 3849, 9637, 2544, 5180, 1122 and 4291 and fictional phone numbers, and not RFC 6890, for3fff::1,555-0100,0.0.0.0,::,http://0.0.0.0:8000and3221225985(192.0.2.1) alike (test_check_threat_intel_names_the_rfcs_of_every_target_it_excludes).host:portorinet_atonspelling names the address a resolver dials, with no lookup (test_an_address_is_classed_without_the_punctuation_prose_leaves_after_it,test_a_network_target_names_the_address_a_resolver_would_dial).100.64.0.1.,224.0.0.1,,10.0.0.1.,2130706433andhttp://100.64.0.1./v1reach neither Shodan nor Radar, bycheck_threat_intel,CloudflareRadarClient.check_domainor its batch path;check_threat_intelreplies that the target is a local address and no service was asked, and a public address with a trailing mark goes to Shodan as the bare address (test_check_threat_intel_asks_no_service_about_a_local_address,test_check_threat_intel_asks_shodan_about_the_address_the_target_names,test_cloudflare_radar_answers_a_documentation_or_local_address_without_a_request,test_cloudflare_radar_batch_sends_no_local_address).test_shodan_answers_a_documentation_or_local_address_without_a_request,test_cloudflare_radar_answers_a_documentation_or_local_address_without_a_request).host.docker.internal, in any case and with or without a trailing dot, is refused at validation with aSandboxValidationErrorand nogetaddrinfocall, even when the private-host check would admit it (test_the_host_gateway_name_is_refused_in_the_local_whitelist_without_a_lookup).to, and neither name maps to127.0.0.1/32(test_a_loopback_entry_opens_no_egress_rule,test_a_loopback_host_or_network_resolves_to_no_address,test_an_entry_that_resolves_to_no_address_adds_no_rule,test_every_whitelist_rule_names_a_destination).host.docker.internalorlocalhostpatchsocket.getaddrinfoto fail.changelog.d/1174.mdlists the report-class shifts and thehost.docker.internaland loopback handling;CHANGELOG.mdanddocs/ROADMAP.mdare not edited.feat(release): v0.2.37 (#1720)