fix(security): surface immutable symlink hardening status#1499
fix(security): surface immutable symlink hardening status#1499cv merged 2 commits 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 NVIDIA#1137 and improves the observability around immutable symlink hardening without changing the underlying defense-in-depth approach. ## What Changed - factors `.openclaw` symlink validation into a reusable helper so both startup paths use the same validation logic - adds explicit security logging when immutable hardening succeeds, is partial, or is skipped because `chattr` is unavailable - extends the gateway-isolation E2E to fail if `chattr` is missing from the image, so the mitigation cannot silently disappear ## Why The original immutable-hardening fix is directionally strong, but the `chattr` path is intentionally best-effort and currently silent. That makes the mitigation harder to trust and harder to debug because: - a missing `chattr` binary looks the same as successful hardening - partial `chattr +i` failures are suppressed with no visibility - the image can regress and stop shipping `chattr` without CI catching it These changes make the mitigation easier to audit while staying compatible with the current layered hardening model. ## Validation - `bash -n scripts/nemoclaw-start.sh` - `bash -n test/e2e-gateway-isolation.sh` - `git diff --check` - not run: `test/e2e-gateway-isolation.sh` (`docker` is not installed in this environment) ## Relationship To NVIDIA#1137 This is a repost of the follow-up originally opened as `latenighthackathon#1`, now targeted at `NVIDIA/NemoClaw` as requested. ## Note This replaces `NVIDIA#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> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced startup process validation to ensure system integrity and correct configuration * Improved security hardening mechanisms with comprehensive logging and graceful fallback handling when system features are unavailable * **Tests** * Updated end-to-end integration tests to verify system hardening capabilities and feature availability <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
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