Commit 9f6ec86
committed
fix(manifests): set explicit runAsUser/runAsGroup on init container
Copilot's HIGH-severity review flagged two related concerns on the init
container's securityContext. OMNI verification (deep mode, embedded
diff only) confirmed:
- Claim 1 (change readOnlyRootFilesystem to false): REJECTED. OCI
runtime creates mount-point directories before applying the
readonly rootfs remount (runc mountToRootfs runs before the
readonly remount). The emptyDir at /nvml-libs is a separate volume
mounted on top of the rootfs; writes to it are unaffected by the
rootfs read-only restriction. Weakening the securityContext here
trades real protection for a non-issue.
- Claim 2 (add runAsUser/runAsGroup: 0): ACCEPTED. busybox:1.36.1 has
no USER directive and runs as UID 0 today, but adding explicit
runAsUser/runAsGroup makes the intent unambiguous and is robust to
a future image change (e.g. if someone swaps busybox for a
distroless image with USER 65534, root-owned 700 driver files
would become unreadable). The existing kepler main container also
uses runAsNonRoot: false without runAsUser, so this PR is just
hardening the init container ahead of the curve.
Also dropped the redundant quotes around [ALL] in the Helm template
for consistency with the raw manifest (commit fedaef7 fixed the raw
manifest; the Helm template's drop: ["ALL"] was missed). The Helm
template is excluded from yamllint-strict in .pre-commit-config.yaml
so this didn't break CI, but consistency is better.
Signed-off-by: Himanshu Verma <himnshuverma10152006@gmail.com>1 parent 372e255 commit 9f6ec86
2 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
0 commit comments