Skip to content

Harden sandbox against agent config tampering (defense-in-depth) #516

@ericksoa

Description

@ericksoa

Context

#514 locks openclaw.json with filesystem permissions after startup. This issue tracks the remaining defense-in-depth measures to further harden the sandbox against agent self-modification attacks.

Hardening items

1. Tool policy deny list

Add .openclaw/openclaw.json and gateway restart commands (e.g. openclaw gateway run, kill) to SandboxToolPolicy.deny for the write, edit, and exec tools. This provides a software-level control independent of filesystem permissions.

2. Move config outside writable zone

Mount openclaw.json under a read_only path (e.g. /etc/openclaw/) instead of /sandbox/.openclaw/. This ensures the sandbox filesystem policy itself prevents writes, rather than relying on Unix permissions alone.

3. Enforce Landlock (drop best_effort)

Change landlock.compatibility from best_effort to enforce in nemoclaw-blueprint/policies/openclaw-sandbox.yaml. Audit for any functionality that breaks under strict enforcement.

4. Re-evaluate dangerous auth defaults

scripts/nemoclaw-start.sh sets allowInsecureAuth: True and dangerouslyDisableDeviceAuth: True in the gateway config. Evaluate whether these can be removed or scoped more narrowly (e.g. only in local development mode, not when CHAT_UI_URL points to a remote origin).

5. Lock parent directory

After #514's file-level lock, the agent can still delete openclaw.json from the parent directory if /sandbox/.openclaw/ is writable. Consider locking the directory to root:root 555 while keeping subdirectories (e.g. agents/) writable, or restructuring the directory layout.

Priority

Items 1-2 provide the strongest additional protection. Items 3-5 are incremental hardening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: highImportant issue that should be resolved in the next releasesecuritySomething isn't secure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions