Repository navigation
#3832: multilingual credential names and PII region packs - #3852
Merged
Merged
Conversation
The hardcoded-secrets signature knew only English credential names, and the PII leak hunter only the US SSN. - security/credential_lexicon.py: a leaf lexicon of credential names (de, pt, es, fr, nl, sv, no, da, fi, pl beside the unchanged English core), in both the identifier form and the COBOL data-name form. security_lens builds the hardcoded_secrets regex from it; the shape guards (16+ char literal, COBOL VALUE clause) are unchanged. - pii_leak_hunter: national identifiers in region packs (us SSN, iban, uk NINO, in Aadhaar, br CPF, nl BSN), all on by default, narrowed with --regions. Every pack a bare number could imitate carries a checksum validator (IBAN mod-97, Aadhaar Verhoeff, CPF mod-11, BSN 11-proof plus a label on the line); each is masked to its last four characters. Closes #3832 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018whc9Ptg89vdP8tCsHGVhP
…s-globe-hs3tmf-3832 # Conflicts: # gitgalaxy/security/security_lens.py
Contributor
…t Sentinel read the docstring's senha assignment as a hardcoded credential Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3832
What changed
Credential names (
security_lens.hardcoded_secrets). The signature only knew English names (password|secret|token|api_key…and the COBOLPASSWORD|SECRET|TOKEN|KEY|CREDENTIALS). The names now come from a new leaf module,gitgalaxy/security/credential_lexicon.py, which imports onlyre, so it can't create an import cycle:passwort/kennwort, Portuguesesenha, Spanishcontraseña/contrasena/clave, Frenchmot_de_passe(COBOLMOT-DE-PASSE), Dutchwachtwoord, Swedishlösenord/losenord, Norwegianpassord, Danishadgangskode, Finnishsalasana, Polishhasło/haslo.The shape guards are unchanged: a 16+ character literal for the identifier form, and a
VALUEliteral for the COBOL form. Soclavel = "…"andsenha = "short"still don't fire.The literal gate still derives.
hasłois spelled as two whole words rather thanhas(?:l|ł)oso the gate doesn't pick up the near-universal literalhas. The gate tests (one-sided, gated == ungated) pass.PII region packs (
pii_leak_hunter). The hunter only knew the US SSN. National identifiers now come in region packs (PII_REGION_PACKS), all on by default and narrowed with--regions us,iban,…. Cards and AWS keys are always on.usibanukinbrnlBSN/burgerservicenummer/sofinummeron the lineA pattern hit counts only when its validator accepts it. Each identifier is masked to its last four characters (
IBAN-MASKED-3000,CPF-MASKED-4725, …). The clean-scan message now names the new categories. The tool README and the wiki page are updated.Verification
pytest tests/): 12198 passed, 34 skipped, 9 xfailed, 3 xpassed.tests/tools/crucible_check.py: PASS in both modes, no golden-master change. Nothing needed re-blessing: no crucible file uses a new credential name in a secret shape.tests/ruff_audit.py --ci,tests/mypy_audit.py --ci: no new findings.tests/tools/unicode_gauntlet.py --corpus keyword-rosetta --ci: exit 0 (557/934 cells, no regression against the baseline).--regionsselection, rejection of an unknown pack, and a linear-time check on pathological lines.Environment note: tiktoken's
cl100k_basefile was loaded from a local cache so the full-precision venv could run. The cache was seeded from thetiktoken-offlinewheel and checked against tiktoken's pinned SHA-256, because the sandbox proxy blocksopenaipublic.blob.core.windows.net.Not in scope: the per-language baseline rules in
ada.py/yaml.pystill carry the English-only list.🤖 Generated with Claude Code
https://claude.ai/code/session_018whc9Ptg89vdP8tCsHGVhP
Generated by Claude Code