Security: git access token is printed into pod logs by the Argo Workflows executor
評価
調査の方向性
cmd/argoworkflow/main.go の 157 行目あたりから始め、アンマーシャルされた pluginOption が出力される箇所を確認し、e.option.Token が --token フラグから設定される場所を追ってください。デバッグ出力を削除するか、option に Token をマスクする String()/MarshalJSON を実装し、HTTP ハンドラの 329 行目にある fmt.Println(string(body)) も確認してください。完了とは、これらの経路から認証情報が stdout に到達せず、プラグインが引き続きオプションを正しくデコードできることを意味します。
索引モデルが issue の本文から書いたものです。
説明
Description
cmd/argoworkflow/main.go:157 prints the whole option struct to stdout:
opt := &pluginOption{Option: e.option}
if err = json.Unmarshal(p, opt); err != nil {
return
}
fmt.Println("option is", *opt.Option)
option has no custom String() method and contains the Token field (fed from --token, in the documented deployment stored in the sidecar ConfigMap). This means the git personal access token is written into pod logs in plaintext, visible to anyone with log read access (and shipped to any log aggregation).
For comparison, fmt.Println("send status", repo) on line 204 is safe only because pkg.RepoInformation happens to implement String() returning the repo path.
While fixing this, please also review the other debug prints in the HTTP handler (fmt.Println(string(body)) on line 329 dumps the full request payload).
Suggested fix
- Remove the debug prints, or redact: implement a
String()onoptionthat masksToken(e.g. keep first/last 2 chars). - Consider a lint rule / review checklist item against printing structs that carry credentials.
- 主要言語
- Go
- スター
- 19
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LinuxSuRen/gogit のほかの issue
-
Docs: replace the real-looking access token in README examples and fix build status help texts対応中かも @linuxsuren-fs が 7 日前に担当しました。 オープンdocumentation good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
LinuxSuRen/gogit#90 ·
-
Bug: --token file://… content is not trimmed, trailing newline breaks authentication対応中かも @linuxsuren-fs が 7 日前に担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
LinuxSuRen/gogit#87 ·
-
Bug: gogit checkout robustness: remotes[0] panic, wrong error message, empty version output, non-idempotent 0444 writes対応中かも @linuxsuren-fs が 7 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LinuxSuRen/gogit#86 ·
-
Bug: gogit checkout fails on repositories whose default branch is not master対応中かも @linuxsuren-fs が 7 日前に担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
LinuxSuRen/gogit#85 ·
-
Bug: DingTalk notification builds JSON by string concatenation, echoes the token, leaks resp.Body and swallows errors対応中かも @linuxsuren-fs が 7 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
LinuxSuRen/gogit#84 ·
LinuxSuRen/gogit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
VictoriaMetrics/VictoriaLogs#1965 ·
メンテナーはふだん 1 日以内に返信
-
Sign-off cards drift between formats; write down one card format対応中かも @keyxmakerx が今日担当しました。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
keyxmakerx/Chronicle#2795 ·
メンテナーはふだん 1 日以内に返信
-
bug ElasticSearch
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aliyun/terraform-provider-alicloud#11614 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信