fix(e2e): enforce split process security posture - #8633
Conversation
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe E2E security posture checks now validate OpenShell’s split-process architecture. They inspect supervisor and child-supervisor identities through a privileged ChangesOpenShell split-process posture
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SecurityPostureTest
participant assertSecurityPosture
participant Docker
participant OpenShellContainer
participant PythonProbe
SecurityPostureTest->>assertSecurityPosture: Request split-process posture
assertSecurityPosture->>Docker: Find matching OpenShell container
Docker->>OpenShellContainer: Run privileged security probe
OpenShellContainer->>PythonProbe: Inspect bounded /proc data
PythonProbe-->>assertSecurityPosture: Return validated JSON report
assertSecurityPosture-->>SecurityPostureTest: Return supervisor identities
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
test/e2e/fixtures/security-posture.ts (1)
354-362: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDerive the probe literals from the shared TypeScript constants.
The accepted
nemoclaw-startargv forms and the bash executable list exist twice. The Python probe declares them at lines 93-95. This function andSYSTEM_BASH_EXECUTABLESat line 73 declare them again. If one list changes, the census and the validator disagree, and the failure message points at the wrong cause. The probe template already interpolatesMAX_PROC_ENTRIESat line 90, so the same approach works here.♻️ Proposed refactor sketch
Declare the accepted values once near the other constants:
const NEMOCLAW_START_SUPERVISOR_PATHS = ["nemoclaw-start", "/usr/local/bin/nemoclaw-start"] as const; const BASH_ARGV0 = ["bash", "/bin/bash", "/usr/bin/bash"] as const;Then interpolate them into the probe and reuse them here:
function canonicalNemoclawStartSupervisorArgv(argv: string[]): boolean { - const starts = ["nemoclaw-start", "/usr/local/bin/nemoclaw-start"]; + const starts = NEMOCLAW_START_SUPERVISOR_PATHS as readonly string[]; if (argv.length === 1 && starts.includes(argv[0] ?? "")) return true; return ( argv.length === 2 && - ["bash", "/bin/bash", "/usr/bin/bash"].includes(argv[0] ?? "") && + (BASH_ARGV0 as readonly string[]).includes(argv[0] ?? "") && starts.includes(argv[1] ?? "") ); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e/fixtures/security-posture.ts` around lines 354 - 362, Define shared TypeScript constants for the accepted nemoclaw-start paths and bash executable values near the existing constants, then interpolate those constants into the Python probe template and reuse them in canonicalNemoclawStartSupervisorArgv and SYSTEM_BASH_EXECUTABLES. Remove the duplicated literal lists so census and validation always use the same values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/e2e/fixtures/security-posture.ts`:
- Around line 554-573: Update the container discovery command in the
security-posture flow to use the same resolved endpoint as privileged probing,
derived from dockerHost (or validate endpoint equality before discovery).
Preserve the existing managed-by and sandbox-name filters, formatting, and
parseOpenShellContainerId behavior while ensuring docker ps targets the selected
container runtime socket.
In `@test/e2e/support/security-posture.test.ts`:
- Around line 108-141: Update both spawnSync checks in the Python compilation
and isolation tests to assert that the returned result has no error before
checking status, using the respective compiled.error and isolated.error values
so a missing python3 interpreter is reported clearly. Preserve the existing
status and stdout assertions after these guards.
---
Nitpick comments:
In `@test/e2e/fixtures/security-posture.ts`:
- Around line 354-362: Define shared TypeScript constants for the accepted
nemoclaw-start paths and bash executable values near the existing constants,
then interpolate those constants into the Python probe template and reuse them
in canonicalNemoclawStartSupervisorArgv and SYSTEM_BASH_EXECUTABLES. Remove the
duplicated literal lists so census and validation always use the same values.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 23288b73-97d6-4346-9b1b-e98ca5cf4f5a
📒 Files selected for processing (6)
.github/workflows/e2e.yamltest/e2e/fixtures/security-posture.tstest/e2e/support/security-posture-workflow-boundary.test.tstest/e2e/support/security-posture.test.tstools/e2e/cli-artifact-workflow-boundary.mtstools/e2e/security-posture-workflow-boundary.mts
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 3 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite against this exact revision. Recommended E2E: 2 optional E2E recommendations
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Summary
Correct the trusted security-posture E2E assertion to verify OpenShell's split-process model instead of requiring PID 1 to be nonroot. PID 1 now passes only as the exact constrained OpenShell supervisor, while exactly one nonroot, capability-free
nemoclaw-startchild supervisor must be present.Changes
/usr/bin/python3 -I.NoNewPrivsdrift and on any missing, ambiguous, privileged, stopped, or malformednemoclaw-startchild supervisor./procobservations at every intermediate lifecycle instant or immediately after rebuild and rollback; those remain path-owned E2E coverage residuals.The host-side process probe is required because an ordinary sandbox-side command is itself a child process and cannot independently attest the PID 1 boundary.
security-posture.test.ts,security-posture-workflow-boundary.test.ts, andcli-artifact-workflow-boundary.test.tsprotect that contract.Type of Change
Quality Gates
ce36aadc0; no waiver is used.Documentation Writer Review
no-docs-needednemoclaw-startsupervisor.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablece36aadc0: four affected E2E-support contract suites, 96 passed; adjacent privileged-exec, subprocess-environment, portable-lifecycle, and socket-authority suites, 109 passed; OpenShell migration review, 4 passed.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — Not rerun once36aadc0; the focused frozen-head suites above and all path-scoped hooks passed. Authoritative live validation is the post-merge trusted-main security-posture run.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Apurv Kumaria akumaria@nvidia.com
Summary by CodeRabbit
Security Improvements
Bug Fixes
Tests