fix(security): surface immutable symlink hardening status#1499
fix(security): surface immutable symlink hardening status#149913ernkastel wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdded symlink validation and conditional hardening to the startup script ( Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Init as Startup Script
participant Validator as validate_openclaw_symlinks()
participant FS as /sandbox/.openclaw (filesystem)
participant Hardener as harden_openclaw_symlinks()
participant Chattr as `chattr` binary
Init->>Validator: invoke (non-root & root paths)
Validator->>FS: read symlinks (readlink -f)
FS-->>Validator: resolved targets
Validator-->>Init: success/fail (return 0/1)
alt hardening available
Init->>Hardener: invoke (root path)
Hardener->>Chattr: check availability (command -v)
Chattr-->>Hardener: exists
Hardener->>FS: apply chattr +i to files/dirs
FS-->>Hardener: success/failure per path
Hardener-->>Init: log counts, return 0 (tolerant)
else chattr missing
Hardener->>Chattr: not found
Hardener-->>Init: log and return 0 (skip hardening)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2842c2f to
d1c4baa
Compare
|
Maintainers: this PR has been rebased onto current |
Summary
This follow-up builds on #1137 and improves the observability around immutable symlink hardening without changing the underlying defense-in-depth approach.
What Changed
.openclawsymlink validation into a reusable helper so both startup paths use the same validation logicchattris unavailablechattris missing from the image, so the mitigation cannot silently disappearWhy
The original immutable-hardening fix is directionally strong, but the
chattrpath is intentionally best-effort and currently silent. That makes the mitigation harder to trust and harder to debug because:chattrbinary looks the same as successful hardeningchattr +ifailures are suppressed with no visibilitychattrwithout CI catching itThese changes make the mitigation easier to audit while staying compatible with the current layered hardening model.
Validation
bash -n scripts/nemoclaw-start.shbash -n test/e2e-gateway-isolation.shgit diff --checktest/e2e-gateway-isolation.sh(dockeris not installed in this environment)Relationship To #1137
This is a repost of the follow-up originally opened as
latenighthackathon/NemoClaw#1, now targeted atNVIDIA/NemoClawas requested.Note
This replaces
#1467, which GitHub auto-closed because the repository's contributor open-PR limit was hit at the time.Signed-off-by: 13ernkastel LennonCMJ@live.com
Summary by CodeRabbit
Chores
Tests