[Low] ate-api-server accepts client certificates chained to system roots when --pod-identity-ca-certs is unset
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
調査の方向性
cmd/ateapi/main.go の buildServerTLSConfig(631–643行)から始め、caCertsPath が空の場合の分岐でクライアント証明書がどのように設定されるかを確認してください。issue に記載された Go の TLS クライアント認証の動作を読み、関連する ate-api-server のテストを実行してください。空のパスを指定した設定で、システムルートを使ったクライアント証明書の認証が行われず、テストでその動作が確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
When --pod-identity-ca-certs is omitted (empty caCertsPath), cmd/ateapi/main.go:buildServerTLSConfig returns a tls.Config with ClientAuth: tls.VerifyClientCertIfGiven and ClientCAs: nil. Under Go's crypto/tls implementation, a nil ClientCAs causes client certificate verification to fall back to the host system root CAs, allowing any client certificate trusted by a system root containing a SPIFFE URI SAN to authenticate as an mTLS principal.
Details
In cmd/ateapi/main.go:631-643:
func buildServerTLSConfig(ctx context.Context, credBundlePath, caCertsPath string) (*tls.Config, error) {
serverCert := credbundle.Loader(credBundlePath)
const clientAuth = tls.VerifyClientCertIfGiven
if caCertsPath == "" {
return &tls.Config{
GetCertificate: serverCert,
ClientAuth: clientAuth,
}, nil
}
When caCertsPath == "", ClientCAs is left nil. In Go's crypto/tls/handshake_server.go:
opts := x509.VerifyOptions{
Roots: c.config.ClientCAs,
CurrentTime: c.config.time(),
Intermediates: x509.NewCertPool(),
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
}
When opts.Roots is nil, x509.Certificate.Verify defaults to the host's system root CAs. If a client certificate verified by any system CA includes a URI SAN, apiauthn.UnaryServerInterceptor extracts the URI SAN via mtlsPeerIdentity and treats the caller as an authenticated mTLS principal without inspecting or requiring bearer token authentication.
Impact
Low: in standard deployments (manifests/ate-install/ate-api-server.yaml:180), --pod-identity-ca-certs is always provided. The fallback occurs only when --pod-identity-ca-certs is omitted. In standard deployments (manifests/ate-install/ate-api-server.yaml:180), --pod-identity-ca-certs is always provided, pointing to /run/podidentity.podcert.ate.dev/trust-bundle.pem. The fallback occurs only in non-standard or standalone deployments where --pod-identity-ca-certs is deliberately omitted. Furthermore, obtaining a publicly-trusted certificate containing a URI SAN (e.g., spiffe://...) with the clientAuth EKU is non-trivial under standard Web PKI CA baseline requirements. NetworkPolicies on ate-api-server also restrict ingress on port 443 to control plane pods or namespaces labeled ate.dev/api-access=true.
Suggested fix
When caCertsPath == "", explicitly disable client certificate verification by setting ClientAuth: tls.NoClientCert in the returned tls.Config:
if caCertsPath == "" {
return &tls.Config{
GetCertificate: serverCert,
ClientAuth: tls.NoClientCert,
}, nil
}
Related
No existing duplicate issues or PRs found.
- 主要言語
- Go
- スター
- 5.7k
- フォーク
- 612
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 571
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
agent-substrate/substrate のほかの issue
-
[Low] CSI plugin builds staging directories from storage_volume_id without a containment check対応中かも @ericcurtin が今日担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
agent-substrate/substrate#2935 ·
メンテナーはふだん 1 日以内に返信
-
[Low] CleanupSandboxState joins an unchecked id into paths it RemoveAll()s対応中かも @ericcurtin が 1 日前に担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
agent-substrate/substrate#2932 ·
メンテナーはふだん 1 日以内に返信
-
[Low] guestVolumeSource can map host paths containing ".." outside the microVM guest share対応中かも @jiayimeow が 4 日前に担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
agent-substrate/substrate#2920 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Low] setupImageVolumes builds host mount paths from vol.Name without a containment check対応中かも @abhisheksharma2411 が 3 日前に担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
agent-substrate/substrate#2919 ·
メンテナーはふだん 1 日以内に返信
-
Cloud SQL backend: document (and optionally provision) Private Service Connect for ATE_API_POSTGRES_CLOUDSQL_IP_TYPE=psc対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea/dev-infra kind/docs kind/feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
agent-substrate/substrate#2875 ·
メンテナーはふだん 1 日以内に返信
agent-substrate/substrate の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
JakeChampion/lang#13132 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] deploy.restart_policy without condition drops the restart policy対応中かも @akshat-lakhera が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
docker/compose#14383 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
Azure/azure-storage-fuse#2429 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
AvengeMedia/dank-greeter#39 · コメント 1 件 ·
-
bug: dataplane client ignores SERVER_BASEPATH, so create/delete topic miss the subpath対応中かも @bhataprameya が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
redpanda-data/console#2693 ·
メンテナーはふだん 2 日以内に返信