fix(security): warn when Landlock may silently degrade#868
fix(security): warn when Landlock may silently degrade#868ericksoa merged 3 commits intoNVIDIA:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change adds a post-sandbox-creation diagnostic check that probes host kernel versions to detect Landlock support. On macOS it uses Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
cv
left a comment
There was a problem hiding this comment.
The underlying issue is real — best_effort silently dropping Landlock is worth surfacing. The Linux host kernel check is straightforward and correct since Docker shares the host kernel.
The macOS path is weak though: it warns every macOS user unconditionally when it could just check the Docker VM's actual kernel version via docker info --format '{{.KernelVersion}}'. That gives you the VM kernel without even spinning up a container. If that's ≥ 5.13, there's nothing to warn about.
As-is, the macOS warning is noisy without being actionable — it tells the user "depends on the Docker VM kernel" but doesn't do the one thing that would answer the question.
|
FYI — OpenShell is already tracking this upstream:
Once that lands, OpenShell itself will report whether Landlock enforcement actually stuck, which makes the host-side kernel guessing here unnecessary. |
e06072c to
93db763
Compare
- Check Docker VM kernel version on macOS via docker info (actionable, not unconditional) - Check host kernel version on Linux via uname -r - Warn only when kernel < 5.13 (Landlock minimum) - Warning only — never blocks sandbox creation (wrapped in try/catch) Made-with: Cursor
93db763 to
3d2d2bf
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@bin/lib/onboard.js`:
- Around line 2283-2294: The macOS branch currently only prints the Landlock
warning when the Docker VM kernel parses as <5.13; change it so macOS always
emits the Landlock warning to match the PR/test plan: keep the existing
runCapture("docker info...") and parsing of vmKernel but always log a general
macOS Landlock warning (using process.platform === "darwin"), and if vmKernel is
present and parses to a version <5.13 add the existing specific message about
lack of Landlock support; if vmKernel is unparsable still emit the general
warning (and optionally include the raw vmKernel value) so the security signal
is never silently skipped.
🪄 Autofix (Beta)
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: Pro
Run ID: 598da946-0617-4fc1-8498-b067424d8b1c
📒 Files selected for processing (1)
bin/lib/onboard.js
|
@cv Addressed — macOS path now checks the Docker VM kernel via Also noting this is an interim measure until openshell#599 lands upstream. |
|
I attempted to port this branch across the JS→TS migration and merge the latest Please start with: git fetch origin
git merge origin/main
npx tsx scripts/ts-migration-assist.ts --base origin/main --write
npm run build:cli
npm run typecheck:cli
npm run lint
npm test |
…ion-warn Signed-off-by: Test User <test@example.com>
Summary
landlock: compatibility: best_effortwhich silently drops filesystem restrictions on unsupported kernels (CWE-440, NVBUG 6002804)createSandbox()that warns on macOS hosts and Linux kernels < 5.13Test plan
nemoclaw onboardon macOS → see⚠ Landlock: macOS hostwarning after sandbox creationnemoclaw onboardon Linux ≥ 5.13 → no warningnemoclaw onboardon Linux < 5.13 → see⚠ Landlock: Kernel X.Y does not support Landlockwarninguname -rfails for any reason → no crash, no warning (try/catch)Summary by CodeRabbit