Skip to content

security: reconstruct special-purpose IP policy on current main - #173

Closed
seonghobae wants to merge 20 commits into
mainfrom
security/reconstruct-special-purpose-50a84d
Closed

security: reconstruct special-purpose IP policy on current main#173
seonghobae wants to merge 20 commits into
mainfrom
security/reconstruct-special-purpose-50a84d

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Purpose

Reconstruct issue #95 / historical PR #96 directly on the current protected main. Historical #96 checks, reviews, approvals, base identity and mergeability do not transfer.

Exact current identity

  • protected/live base: 1d2e19049354115776804c66b9366fad2ea5b6c5;
  • exact current head: 74211307bf83d8089ca0c935a8a6664ca897ffce;
  • ancestry: 23 commits ahead / 0 behind protected main;
  • state: open / Draft / mergeable;
  • current-tree refresh: merged protected main without force-push or destructive rebase.

Security boundary

The reviewed compatibility overlay keeps known special-purpose ranges fail-closed across supported Python ipaddress metadata while preserving explicit current globally reachable exceptions, local-development semantics, normalized authority, DNS pinning/revalidation, generic denial errors, dependencies, credentials, workflows, release authority, and public API. No runtime registry download is used.

Exact current-head local proof

On unchanged 74211307bf83d8089ca0c935a8a6664ca897ffce:

  • Python 3.14: 955 passed;
  • production coverage: 100% (1719/1719 statements, 586/586 branches);
  • Ruff, hourly product guard self-test, and Python compilation all pass;
  • CodeGraph was synchronized after the current-main integration.

Keep Draft pending fresh hosted current-head review/security evidence and the separately governed dependency-review prerequisite. Aggregate Security Scan success is not dependency-review acceptance while the actual pinned action is skipped. Do not self-approve, Admin-merge, bypass, or auto-merge.

Progresses #95; intended to supersede #96 only after current-tree proof preserves its unique work.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eeaf8462-ccba-47e2-bc0b-53d44e40b273

📥 Commits

Reviewing files that changed from the base of the PR and between 1b7be98 and 7421130.

📒 Files selected for processing (1)
  • CHANGELOG.md
📝 Walkthrough

Walkthrough

CPython 버전별 특수 목적 주소 분류 차이를 보정하는 정적 오버레이를 추가했습니다. 원격 주소 검증은 오버레이 범위를 먼저 적용합니다. 관련 정책 문서, 변경 기록, 호환성 테스트 및 문서 일치성 테스트를 추가했습니다.

Changes

특수 목적 주소 호환성

Layer / File(s) Summary
주소 분류 정책 및 문서
docs/research/special-purpose-address-classification.md, docs/research/README.md, CHANGELOG.md
CPython 및 IANA 분류 차이를 보정하는 정적 정책과 전역 예외, 비전역 범위, 유지보수 절차를 문서화했습니다.
검증 오버레이 구현
src/egressweave/validation.py
검토된 비전역 범위는 거부하고 전역 예외 범위는 허용하도록 원격 주소 검증 순서를 확장했습니다. IPv4-mapped IPv6 주소는 매핑된 IPv4 정책으로 재검사합니다.
호환성 및 문서 회귀 검증
tests/test_special_address_registry_compatibility.py, tests/test_special_address_registry_documentation.py
CPython 분류 차이, IPv4-mapped IPv6 주소, allow_local 제한 및 문서와 구현의 주소 대역 일치를 검증합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RemoteHost as 원격 호스트
  participant Validation as validation.py
  participant Overlay as 특수 목적 주소 오버레이
  participant Ipaddress as ipaddress
  RemoteHost->>Validation: 원격 주소 전달
  Validation->>Overlay: 검토된 범위 확인
  Overlay-->>Validation: 허용, 거부 또는 미일치 결과
  Validation->>Ipaddress: 미일치 주소 분류
  Ipaddress-->>Validation: 런타임 분류 결과
  Validation-->>RemoteHost: EgressWeave 접근 판정
Loading

Possibly related issues

Possibly related PRs

  • ContextualWisdomLab/EgressWeave#141: 자율 제품 스케줄러의 저장소 쓰기 게시자와 시간별 자동 병합 동작 제거와 관련된 변경을 포함합니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 현재 main에 특수 목적 IP 정책 호환성 오버레이를 재구성하는 변경의 핵심 내용을 명확하게 요약합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/reconstruct-special-purpose-50a84d

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
seonghobae marked this pull request as ready for review August 11, 2026 06:56

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the unchanged exact current head 45a0a4fbb1a2e8d552af506e3329b540fa31ff6b against live main c1a6ee1e437b44a9f8c06adb0fc91d4f1be9ff68. Focus on the reviewed special-purpose IP compatibility overlay, explicit globally reachable exceptions, local-development semantics, fail-closed DNS/address behavior, tests, and directly affected documentation. Report only current-head actionable findings. The skipped organization dependency-review action remains a separate blocked gate.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

@seonghobae: I will review current head 45a0a4fbb1a2e8d552af506e3329b540fa31ff6b against main c1a6ee1e437b44a9f8c06adb0fc91d4f1be9ff68. I will report only actionable findings in the requested scope. I will exclude the separately blocked dependency-review gate.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/research/special-purpose-address-classification.md`:
- Line 9: Python 문서 버전 참조를 현재 3.14.7로 갱신하십시오.
docs/research/special-purpose-address-classification.md의 9행 검증 근거와 52행 APA 참고문헌을
업데이트하고, tests/test_special_address_registry_documentation.py의 19-29행 테스트 토큰도 동일한
3.14.7 버전을 검증하도록 변경하십시오.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ea0a904b-8d11-45e3-baba-38ce87c332da

📥 Commits

Reviewing files that changed from the base of the PR and between 483c923 and 1fa903e.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • docs/research/README.md
  • docs/research/special-purpose-address-classification.md
  • src/egressweave/validation.py
  • tests/test_special_address_registry_compatibility.py
  • tests/test_special_address_registry_documentation.py

Comment thread docs/research/special-purpose-address-classification.md

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the unchanged exact current head 5f013481d134797497f37c3100610a2adbf9f9ad against live main 483c92329a3e0d45e604601d547cadcfbfde4135. The predecessor-head Python-version finding was rechecked against primary Python sources and resolved as factually inapplicable: the official released-version index and current 3.14 documentation still identify Python 3.14.6 as the released documentation, while PEP 745 lists 3.14.7 only under the expected schedule. Do not transfer predecessor-head review evidence; report only exact-current-head actionable findings.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

@seonghobae I will review exact head 5f013481d134797497f37c3100610a2adbf9f9ad against main 483c92329a3e0d45e604601d547cadcfbfde4135.

I will report only actionable findings on this exact head. I will not use predecessor-head evidence or the resolved Python-version finding.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
seonghobae marked this pull request as draft August 11, 2026 12:08
@seonghobae
seonghobae marked this pull request as ready for review August 11, 2026 13:12

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 2ce54e912cdb6cf267dcacef427dc38893f6fb0d over live protected main 52a5c6a0862e0d035b0698b79a0e8556269e0b00. The published review is anchored to predecessor head 1fa903e8ab991efb43f8c4d813f041cb9b126f57; its only inline thread is resolved and does not transfer. Validate only the unchanged exact current diff.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='52a5c6a0862e0d035b0698b79a0e8556269e0b00'
head='2ce54e912cdb6cf267dcacef427dc38893f6fb0d'

echo '== Commit identity and ancestry =='
git rev-parse HEAD
git cat-file -t "$base"
git cat-file -t "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base-is-ancestor=yes'

echo '== Exact changed files =='
git diff --name-status "$base" "$head"
echo '== Exact diff stat =='
git diff --stat "$base" "$head"

echo '== Validation outline =='
ast-grep outline src/egressweave/validation.py --items all --view expanded || true

echo '== Test outlines =='
fd -t f 'special_address|special-purpose|registry' tests docs src \
  -x sh -c 'echo "== $1 =="; ast-grep outline "$1" --items all --view expanded || true' sh {}

echo '== Exact diff =='
git diff --find-renames --find-copies --unified=80 "$base" "$head" -- \
  src/egressweave/validation.py \
  tests/test_special_address_registry_compatibility.py \
  tests/test_special_address_registry_documentation.py \
  docs/research/README.md \
  docs/research/special-purpose-address-classification.md \
  CHANGELOG.md

Length of output: 52255


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Validation functions and call sites =='
rg -n -C 12 \
  'def (_validate_global_address|_validate_bounded_unique_addresses|_resolve_all_global_addresses_blocking|_revalidate_pinned_egress_url|validate_egress_url_details)|_validate_global_address\s*\(' \
  src tests

echo '== Authority validation and validation entry points =='
sed -n '330,525p' src/egressweave/validation.py

echo '== EgressPolicy outline and relevant source =='
policy_file=$(fd -t f '^policy\.py$' src | head -n 1)
printf 'policy file: %s\n' "$policy_file"
ast-grep outline "$policy_file" --items all --view expanded
rg -n -C 10 \
  'class EgressPolicy|def from_hosts|def is_allowlisted_local_host|def is_allowed|allow_local|allowed_hosts|allowed_ports' \
  "$policy_file"

echo '== Packaging and test configuration =='
fd -t f '^(pyproject\.toml|tox\.ini|setup\.cfg|\.python-version)$' . \
  -x sh -c 'echo "== $1 =="; sed -n "1,260p" "$1"' sh {}

echo '== All references to overlay constants and validation entry points =='
rg -n -C 4 \
  '_SPECIAL_PURPOSE_(GLOBAL_EXCEPTIONS|NON_GLOBAL_NETWORKS)|_special_purpose_global_override|validate_egress_url_details|_revalidate_pinned_egress_url' \
  .

Length of output: 101555


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='52a5c6a0862e0d035b0698b79a0e8556269e0b00'
head='2ce54e912cdb6cf267dcacef427dc38893f6fb0d'

echo '== Diff hygiene =='
git diff --check "$base" "$head"
git diff --numstat "$base" "$head"

echo '== Workflow files and Python matrix references =='
fd -HI -t f .github \
  -x sh -c 'echo "== $1 =="; rg -n -C 5 "(python-version|python-version-file|3\\.10|3\\.11|3\\.12|3\\.13|3\\.14|pytest|coverage)" "$1" || true' sh {}

echo '== Exact current changed-file hashes =='
git diff --no-ext-diff --name-only "$base" "$head" | while IFS= read -r file; do
  printf '%s  ' "$file"
  git show "$head:$file" | sha256sum | cut -d' ' -f1
done

Length of output: 1794


🤖 web_search executed:

Check the current IANA IPv4 and IPv6 Special-Purpose Address Space registries for the globally reachable status of 192.0.0.9/32, 192.0.0.10/32, 2001:1::1/128, 2001:1::2/128, 2001:1::3/128, 2001:3::/32, 2001:4:112::/48, 2001:20::/28, and 2001:30::/28; and the non-global status of 192.0.0.0/24, 64:ff9b:1::/48, 100:0:0:1::/64, 2001::/23, 3fff::/20, and 5f00::/16. Use IANA primary sources.

Length of output: 18685


🤖 web_search executed:

In the current Python 3.14 ipaddress documentation, which special-purpose ranges changed to is_private=True in Python 3.13, and what exceptions are listed inside 192.0.0.0/24 and 2001::/23? Also confirm whether IPv6Address.ipv4_mapped is available in Python 3.10.

Length of output: 13682


@seonghobae I found one actionable finding in the exact current diff.

  • Documentation accuracy — docs/research/special-purpose-address-classification.md, Line 10 and Line 49: The document states that the policy was revalidated on 2026-08-11 against “Python 3.14.6 documentation.” The current Python documentation is published as Python 3.14.7. The new documentation test also requires the obsolete Python 3.14.6 string. Update the cited released documentation version and the test assertion. Alternatively, remove the patch-version assertion and cite the stable Python 3.14 documentation URL. This prevents the shipped security-policy evidence from claiming a stale current source.
    Sources: Python 3.14 ipaddress documentation, CPython ipaddress documentation source.

The exact diff otherwise preserves authority validation, local-development restrictions, DNS validation, pinned-address revalidation, and fail-closed address handling. I did not transfer the resolved predecessor-head thread.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please re-review exact current head 2ce54e912cdb6cf267dcacef427dc38893f6fb0d. The prior review covered only through 1fa903e8ab991efb43f8c4d813f041cb9b126f57.

Also revalidate the resolved Python-version comment against current primary sources rather than the scheduled date alone: PEP 745 lists 3.14.7 as an expected 2026-08-04 bugfix release, while the current Python.org release/documentation listings and latest official 3.14 release announcement still identify 3.14.6 as the released 3.14 line. Do not require a future/unreleased patch number merely because its planned date has passed.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='52a5c6a0862e0d035b0698b79a0e8556269e0b00'
head='2ce54e912cdb6cf267dcacef427dc38893f6fb0d'

echo '== Exact commit verification =='
git rev-parse HEAD
git cat-file -t "$base"
git cat-file -t "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base-is-ancestor=yes'

echo '== Exact changed files =='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"

echo '== Changed-file outlines =='
for file in \
  src/egressweave/validation.py \
  tests/test_special_address_registry_compatibility.py \
  tests/test_special_address_registry_documentation.py; do
  if git cat-file -e "$head:$file" 2>/dev/null; then
    echo "== $file =="
    ast-grep outline "$file" --items all --view expanded || true
  fi
done

echo '== Exact review diff =='
git diff --find-renames --unified=50 "$base" "$head" -- \
  src/egressweave/validation.py \
  tests/test_special_address_registry_compatibility.py \
  tests/test_special_address_registry_documentation.py \
  docs/research/README.md \
  docs/research/special-purpose-address-classification.md \
  CHANGELOG.md

echo '== Validation call paths and policy interfaces =='
rg -n -C 10 \
  'def (_validate_global_address|_validate_bounded_unique_addresses|_resolve_all_global_addresses_blocking|_revalidate_pinned_egress_url|validate_egress_url_details)|_validate_global_address\s*\(|_SPECIAL_PURPOSE_(GLOBAL_EXCEPTIONS|NON_GLOBAL_NETWORKS)|_special_purpose_global_override' \
  src tests

policy_file="$(fd -t f '^policy\.py$' src | head -n 1)"
if [ -n "$policy_file" ]; then
  echo "== $policy_file =="
  rg -n -C 10 \
    'class EgressPolicy|def (from_hosts|is_allowlisted_local_host|is_allowed)|allow_local|allowed_hosts|allowed_ports' \
    "$policy_file"
fi

echo '== Documentation-test assertions =='
rg -n -C 6 \
  '3\.14\.|special-purpose|Special-Purpose|IANA|_SPECIAL_PURPOSE' \
  tests/test_special_address_registry_documentation.py \
  docs/research/special-purpose-address-classification.md \
  docs/research/README.md \
  CHANGELOG.md

Length of output: 114467


🤖 web_search executed:

Use only primary Python sources. What is the latest released Python 3.14 bugfix version as of August 2026? Check the official Python downloads/release index, the official Python 3.14 documentation version selector or page metadata, the latest official Python 3.14 release announcement, and PEP 745. Distinguish released versions from versions that PEP 745 lists as expected or scheduled.

Length of output: 4044


🤖 web_search executed:

Use only IANA primary registries and official Python documentation. For these address ranges, provide the exact current IANA Globally Reachable value and relevant Python 3.14 ipaddress classification documentation: 192.0.0.0/24; 192.0.0.9/32; 192.0.0.10/32; 64:ff9b:1::/48; 100:0:0:1::/64; 2001::/23; 2001:1::1/128; 2001:1::2/128; 2001:1::3/128; 2001:3::/32; 2001:4:112::/48; 2001:20::/28; 2001:30::/28; 2001:2::/48; 2002::/16; 3fff::/20; and 5f00::/16. State whether any value conflicts with the compatibility overlay documented in the PR. Cite the IANA IPv4/IPv6 Special-Purpose Address Space registries and docs.python.org/3.14/library/ipaddress.html.

Length of output: 16767


@seonghobae I found one actionable finding in the exact current diff.

  • [P2] Update the released Python documentation referencedocs/research/special-purpose-address-classification.md, Lines 9, 28, and 52; tests/test_special_address_registry_documentation.py, Line 24: The guide and its contract test identify Python 3.14.6 as the current Python documentation. Python 3.14.7 is released. Official sources list its release date as 2026-08-05. PEP 745 now records that release, rather than only a future schedule entry. Update the reference and test to 3.14.7, or cite the stable https://docs.python.org/3.14/library/ipaddress.html URL without a patch-version assertion. This keeps the policy evidence current.

    Sources: Python 3.14.7 release, Python documentation versions, Python 3.14.7 announcement, PEP 745.

The exact diff otherwise preserves local-development restrictions, authority validation, DNS pinning, and transport revalidation. The current IANA and Python ipaddress policy boundary aligns with the compatibility overlay. I did not execute tests because the review sandbox does not permit repository-code execution.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
seonghobae marked this pull request as draft August 12, 2026 01:10

Copy link
Copy Markdown
Contributor Author

Current-head refresh complete: protected main 1d2e19049354115776804c66b9366fad2ea5b6c5 was merged into 74211307bf83d8089ca0c935a8a6664ca897ffce without force-push. Python 3.14 proof: 955 passed, 100% production statement/branch coverage (1719/1719, 586/586), Ruff, product-guard self-test, compileall, and CodeGraph sync. Draft remains pending fresh hosted evidence and the central fail-closed dependency-review repair; no self/Admin/bypass merge.

@seonghobae
seonghobae marked this pull request as ready for review August 12, 2026 02:30

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

Superseded by #223, which reconstructs the special-purpose registry compatibility boundary directly on exact protected main with hosted RED evidence, a bounded IANA/CPython overlay, IPv4-mapped recursion, local-authority non-widening tests, source-grounded documentation, 1,049 exact-head tests, and 100% production statement/branch coverage. Historical checks, reviews, base identity, and mergeability from this diverged branch are intentionally not transferred.

@seonghobae seonghobae closed this Aug 14, 2026
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.

1 participant