kubernetes-nodes: talos-reconcile builds the TalosConfigTemplate from an unquoted heredoc

オープン
#5,391 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
helm, kubernetes, shell, yaml

調査の方向性

Start by reading packages/apps/kubernetes-nodes/templates/talos-reconcile-job.yaml and the INVARIANT comment above the cat <<EOF block, then compare it with the Kairos reconcile Job and its ConfigMap in the same chart (referenced via #4911) to see the target pattern. Check which values the Job looks up at runtime — the Service ClusterIP and CA material — since only those should stay as marker substitutions. Done means the heredoc is gone, the spec lives in a ConfigMap, and the existing escape tests still pass as a regression check.

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

説明

triage/needs-triage

The Talos reconcile Job writes the worker template through an unquoted heredoc, so its safety depends on every value being escaped by hand. Today every field it renders is escaped or pattern-checked, and I know of no way to exploit it.

The problem is the next field. The Job in packages/apps/kubernetes-nodes/templates/talos-reconcile-job.yaml writes the TalosConfigTemplate spec with cat <<EOF. Any value the chart puts there, including values from a pool or its WorkerClass, is expanded by the shell unless it goes through the backslash, dollar and backtick escape the INVARIANT comment asks for. One interpolation that skips the escape turns tenant text into shell in a Job that runs with the pool's RBAC, and nothing catches it.

The Kairos reconcile Job in the same chart does not have this problem (see #4911). It mounts the template spec as data from a ConfigMap. It replaces only two reserved markers, and only after checking that the values are IP addresses. No tenant value becomes script text.

I suggest moving talos-reconcile to the same pattern. The spec would be rendered into a ConfigMap, and the Job would fill in only the runtime values it looks up, the Service ClusterIP and the CA material. The current escape tests can stay as a regression check until the heredoc is gone.

主要言語
Go
スター
2.2k
フォーク
209
平均マージ
4日 14時間
マージ済み PR(30日)
140

環境構築

はじめの一歩

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

cozystack/cozystack のほかの issue

cozystack/cozystack の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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