fix: span への秘匿情報漏洩を防ぎ SIGTERM で観測データを flush する - #240
Merged
Conversation
…能にする game-data-publisher の確立パターンと env の語彙を揃える Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codex レビュー (blocker + should-fix) 対応: - #[tracing::instrument] 3 箇所に skip(self) / skip(repository) を追加。 Debug 経由で MySQL パスワードとキャッシュ済み SQL dump 全体が span 属性としてトレース基盤へ送られていた - 多層防御として MySQL の Debug からパスワードを redact、 GachadataDump の Debug をバイト長のみに変更 - SIGTERM/Ctrl-C の graceful shutdown を追加し、終了前に Pyroscope の stop/shutdown と OTel provider の shutdown へ到達させる (従来は SIGTERM で flush 処理に一切到達しなかった) Co-Authored-By: Claude Fable 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.
背景
#239 で導入した
#[tracing::instrument]は引数を skip しておらず、OTLP endpoint を設定した環境では以下が span 属性としてトレース基盤 (Tempo) へ送信される状態だった(seichi_infra 側のレビューで指摘)。MYSQL_PASSWORDを含む接続情報(MySQLが#[derive(Debug)]で password を露出)GachadataDump(Bytes)の SQL 全文(Bytesの Debug は内容全体を出力するため、漏えいに加えリクエストごとに巨大な span を生成)seichi_infra 側で OTLP endpoint を供給する GiganticMinecraft/seichi_infra#5669 は、本 PR のマージとイメージ更新を待ってからマージする想定。
変更内容
run_gachadata_dump/update_gachadataにskip(self)、handler にskip(repository)を設定し、秘匿情報を含む引数を span に載せないMySQLの Debug を手実装し password を<redacted>に、GachadataDumpの Debug をバイト長のみの出力にする(誤って Debug 出力された場合の保険)PYROSCOPE_APPLICATION_NAMEで上書き可能にする (game-data-publisher と同じ方式)確認
cargo checkパス🤖 Generated with Claude Code