Skip to content

fix(pii): recognize reserved placeholder email domains - #246

Merged
rng1995 merged 3 commits into
mainfrom
naren/fix-placeholder-email-domains
Oct 28, 2026
Merged

rng1995 merged 3 commits into
mainfrom
naren/fix-placeholder-email-domains

Conversation

@rng1995

@rng1995 rng1995 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

PII-only validation flags RFC 2606 fixture addresses as HIGH personal email findings. Exempt reserved domains and their subdomains, mixed case, and trailing prose dots while retaining ordinary/lookalike domain detection and real addresses beside fixtures.

Bound the email local-part start so excluding a long placeholder cannot trigger quadratic rescanning. The review also caught ASCII ellipses being mistaken for domain continuations; the terminal guard now handles those without exempting real suffix domains.

Fixes #244.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes (CHANGELOG.md)
  • Ran make lint
  • Full current-head test suite: CI is rerunning after the review fixes; previous head passed all 17 checks
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

At commit 71a753662065e72967e3b2003a3074a3c00f42c8:

  • 471 passed across the complete security-validator and PII-grouping test files.
  • 77 focused cases passed, including public validation of a 200k-character placeholder followed by an ordinary address, ellipses, mixed case, subdomains, and positive author/body controls.
  • Review regression proof: before the follow-up fix, 20 cases failed and 41 passed; the long-placeholder public scan hit its 30-second subprocess ceiling. All of those cases pass after the fix.
  • The configured-regex scan of the 200k-character input now takes about 5 ms, with the subsequent real address retained.
  • Lint, source/wheel builds, and git diff --check passed. Both actionable inline review findings were fixed; the related threads are resolved.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Earlier verification context

The complete Python 3.12/3.13 suites and all 17 CI checks passed on previous head 153759b. Those results are not presented as current-head CI results. Earlier local environment limitations are retained below for transparency.

Prior-head local full-suite limitations (153759b)

The local full-suite run was interrupted after 22 failed, 14,878 passed, 19 skipped. This is not reported as a local green suite. The isolated PATH accidentally excluded the trusted Docker executable, causing 15 Docker-related failures. Restoring /usr/local/bin in a 20-case control against unchanged Harbor/Tier 3 code produced 17 passes and three failures. The remaining failures reproduce in unchanged code: the streamed-timeout stderr assertion receives an additional Bash termination diagnostic, and two Bedrock configuration probes time out and report unavailable. FIFO CLI startup timeouts from the loaded full run passed in that control.

The Docker-missing control reproduced 19 of the cleanup branch's 20 local failures on unchanged code; the other FIFO case was intermittent. Additional Bedrock failures in the email branch are recorded below. No unrelated production changes were included. The complete CI checks above provide the full-suite verification for the final PR head.

Failures observed in the interrupted local full run
  • tests/test_harbor_local_mode.py::test_streamed_timeout_callback_matches_result_and_contains_descendants
  • tests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_classifies_real_invalid_region_as_fatal
  • tests/test_harbor_secure_docker_environment.py::test_service_stop_and_sidecar_downloads_scrub_main_compose_environment
  • tests/test_harbor_secure_docker_environment.py::test_service_stop_uses_label_scoped_raw_docker_when_compose_model_requires_secret[main]
  • tests/test_harbor_secure_docker_environment.py::test_service_stop_uses_label_scoped_raw_docker_when_compose_model_requires_secret[helper]
  • tests/test_harbor_secure_docker_environment.py::test_service_stop_accepts_service_declared_by_trusted_compose_include
  • tests/test_harbor_secure_docker_environment.py::test_windows_main_downloads_use_scrubbed_docker_env_and_validated_archives
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_removes_output_if_diagnostic_spool_creation_fails
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[11-0-True]
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[0-11-True]
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[6-5-True]
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[6-4-False]
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_timeout_reaps_process_and_removes_partial_output
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_idle_timeout_resets_while_output_progresses
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_growing_output_exceeding_budget_reaps_process
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_total_timeout_reaps_continuously_progressing_process
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_rejects_process_completion_after_total_deadline
  • tests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_rejects_unsafe_bearer_token_characters[bad\x7fvalue]
  • tests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_classifies_malformed_effective_proxy_as_fatal[http://[::1]
  • tests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_classifies_malformed_effective_proxy_as_fatal[http://127.0.0.1:banana]
  • tests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_does_not_blame_proxy_bypassed_by_no_proxy
  • tests/tier3/test_workflow.py::test_fifo_dataset_is_rejected_without_blocking

@rng1995
rng1995 marked this pull request as ready for review October 28, 2026 22:09

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Self-review requested by the repository owner. I reproduced two issues in this diff and am addressing the inline findings before the final review.

Comment thread tests/validators/test_security.py Resolved

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Final personal self-review: both actionable inline findings are fixed in this head and both threads are resolved. The fix bounds local-part matching and preserves placeholder addresses followed by prose ellipses. All 471 tests in the affected security/PII test files pass; lint and source/wheel builds pass. Current-head CI is rerunning. I attempted the requested APPROVE review, but GitHub rejected it because this account authored the PR (HTTP 422: Can not approve your own pull request). This COMMENT review records the completed review; an independent maintainer must provide GitHub approval.

@rng1995
rng1995 merged commit 94f5b03 into main Oct 28, 2026
17 checks passed
@rng1995
rng1995 deleted the naren/fix-placeholder-email-domains branch October 28, 2026 22:58
@rng1995 rng1995 mentioned this pull request Oct 30, 2026
15 of 20 tasks
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
* fix(pii): recognize reserved placeholder email domains
* test(pii): keep detection controls on ordinary domains
* fix(pii): bound placeholder scans and preserve prose punctuation

Signed-off-by: Narendran Raghavan <[email protected]>
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.

PII email scan flags RFC 2606 placeholder domains such as example.invalid and example.net

1 participant