- **Version:** 1.108.79 — Structured credential-file classifier (#351 broad redesign, deferred from .78). Clean-room build in our idiom, validated against the reporter's 85-case oracle ([[feedback_clean_room_innovation]] — NOT the prototype dropped in). New `secret_classifier.py`: pure `classify_secret_file(path, *, disabled_groups, extra_secret_path_patterns, allow_patterns) -> SecretFileDecision(is_secret, reason, group, matched_pattern, confidence, normalized_path)`. `security.is_secret_file` stays the boolean public API, delegates + translates the `exclude_secret_patterns` config (group-slug→disable group; legacy `*secret*`→disable broad+store; other glob→per-pattern allow). **Groups (precedence):** path_specific_credentials (`.aws/credentials`/`.kube/config`/`.docker/config.json`/gcloud-ADC/azure/cargo/gem/composer — a PATH not a basename) → exact_credential_names (expanded: client_secret*/oauth2*/ADC/firebase-adminsdk/token.json/*.agekey) → key_material_directories (private-key ext under keys/certs/ssl/tls/pki — NOT public certs) → credential_extensions (+`*.p8`/`*.ppk`) → secret_store_data (segments expanded to credential/credentials/creds/vault; compound suffixes `*.tfstate.backup`/`*.tfvars.json`/`*.auto.tfvars`) → broad_secret_basename (**token-boundary** `(^|[._-])secrets?($|[._-])` → `prod-secrets.yaml` matches, `secretariat.csv`/`prodsecret.yaml`/`mysecretstuff.csv` do NOT; source+doc+template exempt). **Behavior corrections (all safe-direction):** public SSH keys (`*.pub`) + public certs (`*.crt`/`*.cer`/`*.der`, even under secrets/) NO LONGER secret; template/example/sample/tmpl/dist fixtures exempt; substring-`secret` data files no longer skipped; path-specific cred stores now caught. **Reconciled `tests/test_security.py`:** `id_rsa.pub`→not-secret, `k8s/secrets/tls.crt`→not-secret (public cert), substring cases→not-secret; dropped the unused `SECRET_PATTERNS` import. New `tests/test_secret_classifier.py` (82, oracle-mirrored). `SECURITY.md` rewritten for the group model. Full suite **4930 passed/7 skipped**. **#351 now fully resolved** (core in .78 + broad classifier here). Files: new `secret_classifier.py`; `security.py` (delegates, old `SECRET_PATTERNS`/`_SECRET_*` constants removed), `tests/test_security.py`, `SECURITY.md`.
0 commit comments