Skip to content

fix(deploy): set runAsNonRoot on the portal Job and CronJob containers - #629

Merged
devantler merged 1 commit into
mainfrom
claude/deploy-container-nonroot
Nov 16, 2026
Merged

devantler merged 1 commit into
mainfrom
claude/deploy-container-nonroot

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

The site has stopped deploying: since the latest release, the cluster refuses the portal's schema migration job because its security setting is declared only for the whole pod, while the cluster's rule checks each container. Until this lands, no business-site release reaches production.

What

The portal's migration job and its daily retention job now state the non-root setting on their container too, so the cluster accepts them and deploys resume. Nothing else about the jobs changes.

No issue: trivial fix.

The cluster's pod-security policy reads runAsNonRoot per container and
does not fall back to the pod-level setting, so it refused the portal
migration Job and blocked every business-site deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Checked against the live policy, k8s/bases/infrastructure/cluster-policies/best-practices/validate-pod-security.yaml on platform main. This is not a bot review; it doesn't replace the review gate.

The rejection comes from its per-container rule. For every container, init and ephemeral included, it requires:

  • securityContext.allowPrivilegeEscalation == false;
  • privileged false or unset;
  • securityContext.runAsNonRoot == true, at container level (the pod-level value doesn't count);
  • capabilities.drop non-empty and only ALL.

At cc381c9 both workloads pass: migrate (Job) and purge (CronJob) are each the only container, there are no init containers, and the pod-level seccompProfile: RuntimeDefault satisfies the seccomp rule. No findings.

Production impact: business-site/business-site is Ready=False (ReconciliationFailed) since the v3.9.0 re-pin (devantler-tech/platform#6384). That holds back platform deploy health, so this should go out as its own patch release and re-pin, ahead of the portal switch-on.

@github-actions

Copy link
Copy Markdown

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 0.97s
✅ CSS stylelint 1 0 0 0 2.14s
✅ GO golangci-lint yes yes no no 122.64s
✅ GO revive 185 0 0 0.88s
✅ HTML djlint 5 0 0 1.52s
✅ HTML htmlhint 5 0 0 0.31s
✅ JSON jsonlint 2 0 0 0.08s
✅ JSON prettier 2 0 0 0 0.39s
✅ JSON v8r 2 0 0 0.8s
✅ MARKDOWN markdownlint 17 0 0 0 1.5s
✅ MARKDOWN markdown-table-formatter 17 0 0 0 0.26s
✅ REPOSITORY betterleaks yes no no 0.82s
✅ REPOSITORY checkov yes no no 15.77s
✅ REPOSITORY git_diff yes no no 0.13s
✅ REPOSITORY grype yes no no 188.53s
✅ REPOSITORY osv-scanner yes no no 148.13s
✅ REPOSITORY secretlint yes no no 1.08s
✅ REPOSITORY syft yes no no 2.72s
✅ REPOSITORY trivy yes no no 9.44s
✅ REPOSITORY trivy-sbom yes no no 0.24s
✅ REPOSITORY trufflehog yes no no 3.41s
✅ SPELL cspell 212 0 0 5.97s
✅ SPELL lychee 24 0 0 134.66s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.2.0 --custom-flavor-setup --custom-flavor-linters COPYPASTE_JSCPD,CSS_STYLELINT,GO_GOLANGCI_LINT,GO_REVIVE,HTML_DJLINT,HTML_HTMLHINT,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,SPELL_LYCHEE

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Heads-up for this PR's owner: #630 makes the same two container-level runAsNonRoot fixes, adds a test that mirrors validate-pod-security for every package pod, and is set to land once CI and Codex are clean. Unless you need something here that #630 lacks, this one can be closed once #630 merges.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T02:20:28.524284Z cc381c9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: cc381c916b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Readiness at cc381c916b152fc8e3910780816736f1f6da718e:

  • CI: all checks green (22 success, 18 skipped), including the tenant package test (164 pass locally too).
  • Review: Codex finding-free at this head; CodeRabbit is rate-limited until about 03:07Z.
  • Tried against the real admission rule: evaluated the cluster's live validate-pod-security policy with the Kyverno CLI. The Job and CronJob from main both fail with the same message production reports; this head's Job and CronJob both pass.
  • Live breakage: the business-site Kustomization is failing on exactly that denial, so every release is blocked until this lands. Deploy verification follows the merge.

@devantler
devantler marked this pull request as ready for review November 16, 2026 02:24
@devantler
devantler requested a review from a team as a code owner November 16, 2026 02:24
@devantler
devantler merged commit 70d39f6 into main Nov 16, 2026
40 checks passed
@devantler
devantler deleted the claude/deploy-container-nonroot branch November 16, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant