Skip to content

Replace flagged sample credentials with placeholders and synthetic fixtures - #6

Merged
Robert Sim (simra) merged 1 commit into
mainfrom
scrub-example-credentials
Oct 30, 2026
Merged

Robert Sim (simra) merged 1 commit into
mainfrom
scrub-example-credentials

Conversation

@simra

Copy link
Copy Markdown
Contributor

Summary

  • Replace 11 credential/identifier literals across 11 sample files (20 occurrences), including every tracked duplicate of the five reported secrets and the MongoDB/Flask sample from fix: Redact exposed MongoDB credentials in example files #5.
  • Preserve research annotations and surrounding sample code; no environment-variable lookups or sample execution are introduced.
  • Add a standard-library-only post-clone generator that fills placeholders in an ignored dataset copy, with consistent replacements across variants, optional reproducible seeds, legacy API-key formats, and a reserved .invalid MongoDB hostname.
  • Document the setup command, non-overwriting behavior, original-value backup, and the risk that plausible synthetic strings can still trigger secret scanners.

The original literals were backed up locally inside Git metadata before editing, with access restricted to the current Windows user. The backup is not included in this branch or PR.

Validation

  • python -m unittest discover -s tests -v: 5 tests pass.
  • python -m py_compile scripts/generate_synthetic_credentials.py tests/test_synthetic_credentials.py: passes.
  • Ran the generator against the full dataset and verified all 5,168 copied files byte-for-byte, allowing only the 20 intended substitutions.
  • Checked the complete Git index for all 11 backed-up values: none remain.
  • Whitespace checks pass with cr-at-eol, preserving the existing README/sample line-ending convention.

Scope and limitations

This is a targeted cleanup, not a corpus-wide credential audit. It does not rewrite historical commits or revoke third-party credentials. Generated strings are unprovisioned research fixtures and must not be committed. Related to #5; that PR's MongoDB/Flask files are covered here using placeholders rather than environment-variable fallbacks.

Add a post-clone synthetic dataset generator and focused regression tests. Preserve sample annotations and keep original-value backups out of version control.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8011f41c-e888-4e9b-863c-68644bc7423b
@simra
Robert Sim (simra) marked this pull request as ready for review October 30, 2026 18:18
@simra
Robert Sim (simra) merged commit ab88705 into main Oct 30, 2026
3 checks passed
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