fix(links): redact credential-shaped opts by pattern, not by allowlist (CON-877) - #200
Open
howethomas wants to merge 1 commit into
Open
howethomas wants to merge 1 commit into
howethomas wants to merge 1 commit into
Conversation
Links copy their `opts` into `analysis[].vendor_schema` and into log lines, each with its own hand-kept list of names to drop. A provider key added later is not on any of those lists, so it was written verbatim into every transcribed vCon and stored downstream. Match on the option name instead: anything containing key, token, secret, password, credential or proxy_url is dropped, so an unknown credential fails closed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
Links copy their
optsintoanalysis[].vendor_schema(and into log lines), each with its own hand-kept list of option names to drop. Any credential option added later is not on any of those lists, so it is written verbatim into every vCon the link touches, stored in Postgres and delivered to every downstream storage. That is how an OpenAI-compatible provider key (LITELLM_MASTER_KEY) ended up in transcribed vCons. Nine links had the same shape of bug.This replaces the nine allowlists with one shared redactor,
common/lib/redaction.py, that drops options by name pattern (key,token,secret,password,passwd,credential,proxy_url) plus the internal usage-reporting endpoint by exact name. An unknown credential now fails closed. Public metadata such aspolicy_urlis kept.Links changed:
analyze,analyze_and_label,analyze_vcon,check_and_tag,deepgram_link,detect_engagement,groq_whisper,hugging_face_whisper,openai_transcribe. Thelinks.transcribedispatcher delegates to these modules, so it is covered.Tests
common/tests/test_redaction.py: credential-shaped names dropped, unknown credential dropped, public URL kept, empty input.openai_transcribeunit test now runs the link withLITELLM_MASTER_KEYand asserts it is absent from the stored analysis.Fixes CON-877.
🤖 Generated with Claude Code