Skip to content

[Security] Remove OTP and transcription sensitive data from logs #24

@SeanGau

Description

@SeanGau

背景

目前存在敏感資訊輸出:

  • OTP 明文列印(live_server/app/__init__.py:513
  • 轉錄資料/內容在高頻路徑 print(例如 live_server/app/__init__.py:903, live_server/app/__init__.py:1135

風險

  • OTP 洩漏可導致帳號接管
  • 轉錄內容可能包含個資/敏感資訊
  • 增加法遵與審計風險

目標

移除敏感資料 log,改為結構化且可遮罩的安全日志。

實作建議

  • 刪除 OTP print,保留事件級 logger(不含 OTP)
  • 轉錄 log 僅記錄 metadata(sid/hash、segment count、latency)
  • 對 email、secret_key 等欄位做 masking/redaction
  • 明確區分 debug 與 production log level

驗收條件

  • 程式碼中無 OTP 明文輸出
  • 程式碼中無完整轉錄文字輸出(production path)
  • 日志仍可排障(含必要 metadata)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions