[Backend] Stop writing transcript text to logs, and scrub retained production logs #325
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM (privacy). Found in the August 2026 session lifecycle review (#319).
The defect
audio_service.py:524-528logsstr(data)[:500]of the transcription server's response at INFO. That repr opens with the segments array, so the first 500 characters comfortably carry several utterances of real dialogue together with the speakers' display names.This directly violates the module's own stated invariant at
audio_service.py:24-25:The root logger runs at INFO (
webapp/backend/app/logging_config.py,configure_logging(log_level="INFO")), so the line is live in production.Scope of the exposure
Verified against production: one matching line in the worker's retained logs (
docker compose logs --since 720h worker | grep -c "WhisperX raw response"→ 1; backend → 0). So the current exposure is one session's opening dialogue. The Docker log driver isjson-filewith no rotation limits configured, so retention is effectively unbounded.Small today. Not small once the product is hosting other people's private conversations — at which point this is customer content sitting in operator logs.
Proposed fix
Replace the payload preview with metadata only: response keys, segment count, total character count, and the set of speaker labels count (not the labels themselves, since display names are personal data). Then audit the module for any other line that could carry content, and add a test asserting no logging call in
audio_servicereceives segment text.Scrub the retained production logs for the affected container.
Acceptance criteria
audio_service.py:524-528logs no response body contentaudio_service.pyfinds no logging call taking transcript, summary, or segment textShipped — closing as part of a v3.11.5 bookkeeping sweep. This one has no issue-number citation in the code, so verified on its merits rather than by reference.
"Stop writing transcript text to logs" — done. Grepping every logging call in
webapp/backend/appandbot/questboard_botfor one that emits a transcript value returns nothing. What remains is counts and lengths (segment counts, word counts, kept-seconds), which is the right side of the line."Scrub retained production logs" — moot, and worth saying why rather than just ticking it. Production's backend logs currently reach back only to
2026-08-29T07:06:54, because the container was created at07:06:30during the v4.0.1 deploy. Docker logs are per-container and are discarded on recreate, and the stack has been rebuilt several times since 25 August. Nothing from the period this issue was filed about survives to be scrubbed.That is luck rather than design, though. If retained logs ever need scrubbing again — after a driver change, or on a host shipping logs off-box — the same reasoning will not hold, and the deletion would have to be deliberate.