Security: git access token is printed into pod logs by the Argo Workflows executor

オープン 初心者向け
#83 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@linuxsuren-fs がすでに取り組んでいます。

2026年11月17日 から。

  • #94 @linuxsuren-fs による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
security

調査の方向性

cmd/argoworkflow/main.go の 157 行目あたりから始め、アンマーシャルされた pluginOption が出力される箇所を確認し、e.option.Token が --token フラグから設定される場所を追ってください。デバッグ出力を削除するか、option に Token をマスクする String()/MarshalJSON を実装し、HTTP ハンドラの 329 行目にある fmt.Println(string(body)) も確認してください。完了とは、これらの経路から認証情報が stdout に到達せず、プラグインが引き続きオプションを正しくデコードできることを意味します。

索引モデルが issue の本文から書いたものです。

説明

bug

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() on option that masks Token (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 ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LinuxSuRen/gogit のほかの issue

LinuxSuRen/gogit の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。