Skip to content

fix(tests): close the UDP, DNS and git gaps of the network floor #4711

Closed

Description

@dan-petty

Problem or Motivation

The network guard (tests/conftest.py:346-384) patches only connect, connect_ex, bind, listen and getaddrinfo. Probes passed with a UDP sendto, with socket.gethostbyname and with git ls-remote https://..., because git is an allowed program (tests/conftest.py:432-433) (measured). docs/TESTING.md:69 and :242 say that all network and DNS access is blocked.

GIT_ALLOW_PROTOCOL in os.environ does not get to the git children that devops-cli starts, because build_subprocess_env removes it (measured).

Saving: None in time. It closes 3 egress gaps.

Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.

Proposed Solution & Architectural Design

  • Write protocol.allow=never and protocol.file.allow=always into the git config of the isolated test HOME (the control of git itself, AGENTS.md rule 3).
  • In _install_network_guard, patch sendto and sendmsg for addresses that are not loopback, and gethostbyname, gethostbyname_ex, gethostbyaddr and getnameinfo.

Risk: A test that has a loopback UDP server needs an allow rule for loopback.

Target Subsystem

Security & Vulnerability Scanners (tests/conftest.py, docs/TESTING.md).

Existing Tool Considered

git protocol.allow covers the git part. pytest-socket blocks socket creation, but product code can catch its error. The floor fails a test also when the code catches the error, so extend the floor. Cost: about 20,000 tokens and 2 hours.

Acceptance Criteria

  • The three probes fail with 'network edge reached without a fake'.
  • git with an https remote fails at once.
  • The full suite passes.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/tests
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/tests. The (tests) scope of the title gives the scope.
    • Priority: P2-Medium. A known egress gap found by audit undermines the test isolation guarantee but has no active exploit.
    • Value: Medium. Closes three egress paths that let tests bypass the network guard, restoring the documented guarantee.
    • Effort: Low. Patching a few socket and DNS methods plus one git config line, estimated at about 2 hours.
    • Related: test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310, which asks for a different change. Both work on the hermetic test floor in tests/conftest.py, but #1310 is the umbrella for all isolation gaps while this candidate closes only the UDP, DNS, and git egress gaps.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 11, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 15:46 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/testssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions