Skip to content

Commit 88ae4de

Browse files
fix(kubernetes): allowlist kernelModules keys, loosen the schematic guard
Review B3. `^[0-9a-f]{64}$` on the effective schematic encoded the public factory's naming as the only legal one, but the chart supports more: talos.imageFactoryURL documents a self-hosted factory, a caching mirror or an internal HTTP file server, and talos.installerRepository documents mirrored registries. On those the operator picks the path, and a readable name is the obvious choice. Verified against the merge base: values with schematicID `talos-gpu-nvidia-open` and an internal factory URL render on main and failed on this branch, so the guard stopped a cluster reconciling on a field its operator never touched. Replace it with `^[A-Za-z0-9._:-]+$`, which is the injection guard the comment claimed to be: it rejects $, backticks, quotes and whitespace, keeps the cluster-wide path closed, and leaves mirror naming alone. A wrong ID still 404s at the factory, visibly, on the DataVolume. Review B4. The validator walked .name and .parameters but the emit was toYaml over the raw user dict, so any other key was copied into the heredoc verbatim: `- {name: dummy, evil: "$(touch /tmp/pwned)"}` reached it in both charts. Nothing upstream prunes it either — `items` in values.schema.json has no additionalProperties: false, and the aggregated apiserver wires that schema into defaulting only, with no validation on Create or Update. Rebuild the emitted list from validated fields instead, so unvalidated input cannot reach the output by construction rather than by enumeration. Rendering for valid input is byte-identical. Review B5. Drop the review-iteration reference from the test comments; the next reader has no access to that thread. Also: pin mirror-style naming as accepted in both charts so B3 cannot regress, replace the now-legitimate not-64-hex case with one the class actually rejects, add the extra-key case in both charts, and document that the automatic NVIDIA set keys on the resource prefix alone with no cross-check against the effective schematic. Refs: #3563 Assisted-By: Claude <[email protected]> Signed-off-by: Mattia Eleuteri <[email protected]>
1 parent c6444ab commit 88ae4de

16 files changed

Lines changed: 343 additions & 127 deletions

File tree

‎api/apps/v1alpha1/kubernetes/types.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/kubernetesnodes/types.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)