Skip to content

test: add disposable active-discovery network acceptance (#212) - #264

Merged
sodejm merged 1 commit into
mainfrom
codex/issue-212-disposable-network
Oct 11, 2026
Merged

sodejm merged 1 commit into
mainfrom
codex/issue-212-disposable-network

Conversation

@sodejm

@sodejm sodejm commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #212 when merged.

  • Add a reproducible acceptance harness in a loopback-only Linux network namespace with real TCP listeners and a local UDP DNS responder.
  • Pin approved addresses across probes, quarantine changed DNS and ambiguous resume state, and distinguish unreachable from closed connections.
  • Count remediation only when a retest confirms closed; filtered, missing, and otherwise unverified retests remain unverified.
  • Document the contained run, its controls, cleanup, and coverage limits.

Evidence

The Docker run used a cached python:3.12-slim image with --network none, no host ports, and loopback-only destinations. All five cases passed: rate limiting (210.3 ms between probe starts against a 200 ms minimum), unreachable versus closed, DNS shift quarantine after one scanner probe, checkpoint/resume after partial results, and remediated exposure (one closed and one still open). The observed record and exact command are in docs/ACTIVE_DISCOVERY_NETWORK_ACCEPTANCE.md.

Focused simulated tests: 33 passed. The independent issue review found that filtered retests were incorrectly counted as remediated; the final commit corrects that behavior and adds a regression case.

make check passed in the final checkout. The local pre-push gate passed issue coverage, Ruff lint and format, full pytest branch coverage, and pip_audit with no known vulnerabilities. git diff --check origin/main...HEAD and gitleaks also passed.

Limits and review

The contained run exercises Linux loopback TCP connections and a local DNS responder. It does not establish behavior for external networks, production DNS caches, TLS, or a live engagement. Human review of this exact revision is required before merge.

@sodejm
sodejm marked this pull request as ready for review October 11, 2026 15:50
@sodejm
sodejm merged commit f90d1d0 into main Oct 11, 2026
18 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T15:56:02.652392Z ef8df03 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef8df03c4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
# Only a refusal confirms that the previously open port is closed.
# A missing, filtered, or unreachable retest cannot prove remediation.
if curr_a and curr_a.port_state == PortState.CLOSED.value:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep ambiguous imported retests unverified

When a retest comes through import_nmap_xml, states such as closed|filtered fall through the branch at cops/discovery/importer.py:191-193 and are stored as PortState.CLOSED; this condition therefore reports an inconclusive retest as confirmed remediation and can produce a 100% remediation rate. Preserve ambiguous imported states or require evidence of a definitive closed result before adding the exposure to remediated_exposures.

AGENTS.md reference: AGENTS.md:L95-L99

Useful? React with 👍 / 👎.

)
continue

if prior_ip is not None and resolved_ip != prior_ip:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record the new scanner control in the threat model

This commit changes live network trust decisions by pinning DNS resolutions across probes and resumes, quarantining ambiguous checkpoints, and changing socket-error classifications, but it neither updates docs/THREAT_MODEL.md nor records a specific no-impact rationale. Document the control, abuse cases, limitations, ownership, and validation evidence before handoff, as required for changed security-relevant code.

AGENTS.md reference: AGENTS.md:L187-L191

Useful? React with 👍 / 👎.

@sodejm
sodejm deleted the codex/issue-212-disposable-network branch October 18, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add disposable-network acceptance harness for active discovery

1 participant