You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(security): consolidate the two one-off secret-redaction helpers into one shared autobot_shared util #12242
Consolidation opportunity — one shared secret-redaction util (surfaced during #11302)
The SLM backend now has two independent, one-off secret-redaction implementations with different coverage, and there is no shared redactor in autobot_shared:
Drift/coverage risk (security): a redactor is a security control. Two copies with different pattern sets means a secret redacted in one path can leak in the other; hardening must be applied in N places.
Reuse: both backends emit logs/telemetry that should be redacted consistently; a shared util (line-level + kv/dict-level) belongs in autobot_shared (e.g. autobot_shared/security/redaction.py) alongside the existing secret-file helpers.
Proposed
Add autobot_shared/security/redaction.py with redact_text(str) -> str (line/text) and redact_mapping(dict) -> dict (kv), sharing ONE canonical secret-key/pattern set.
Replace _redact_app_log_line and _mask_secret_extra_vars with calls into it (behaviour-preserving; add tests for both shapes).
Audit other ad-hoc masking (sed 's/password/***/' etc.) to adopt it.
Discovered during #11302 (SLM application-log viewer). No behaviour change intended — DRY + consistent coverage of a security control.
Resolved by #12332 (squash-merged). The two SLM-backend one-off redactors (monitoring._redact_app_log_line + code_sync._mask_secret_extra_vars) consolidated into canonical autobot_shared/security/redaction.py (redact_text/redact_mapping); union of rules preserved (behavior-preserving), both call sites delegate, 29+38 tests. Minor pre-existing client_secret text-regex gap tracked as #12333.
Activity
refactor(security): consolidate SLM secret-redaction into one autobot…
mrveiss commentedon Jul 24, 2026
Resolved by #12332 (squash-merged). The two SLM-backend one-off redactors (monitoring._redact_app_log_line + code_sync._mask_secret_extra_vars) consolidated into canonical autobot_shared/security/redaction.py (redact_text/redact_mapping); union of rules preserved (behavior-preserving), both call sites delegate, 29+38 tests. Minor pre-existing client_secret text-regex gap tracked as #12333.
refactor(redaction): name the redaction boundary and pin the concept …
refactor(redaction): name the redaction boundary and pin the concept …
refactor(redaction): name the redaction boundary and pin the concept …
refactor(redaction): name the redaction boundary and pin the concept …
refactor(redaction): name the redaction boundary and pin the concept …
refactor(redaction): name the redaction boundary and pin the concept …