Skip to content

[SECURITY] Audit logs writable by sandbox user — agent can modify its own audit trail #799

Closed as not planned

Description

@h-network

Problem Statement

NemoClaw sandbox logs are accessible via nemoclaw <name> logs. However, the log files reside within the sandbox's writable filesystem. The agent (or a compromised agent) can:

  1. Modify log entries to hide malicious actions
  2. Delete log files entirely
  3. Inject false log entries to create misleading audit trails

Impact

For enterprise deployments requiring compliance (SOC 2, ISO 27001, HIPAA), audit logs must be:

  • Append-only: entries cannot be modified after writing
  • Agent-proof: the agent cannot access or modify the log store
  • Tamper-evident: modifications are detectable

Current implementation satisfies none of these requirements.

Proposed Design

  1. Separate log store: Write audit events to a location outside the sandbox's writable filesystem (e.g., OpenShell host-level log collector)
  2. Append-only enforcement: Use chattr +a on log files or write to a dedicated append-only volume
  3. Cryptographic chaining: Each log entry includes a hash of the previous entry, creating a tamper-evident chain:
import hashlib, json, time

def append_audit(log_file, event: dict, prev_hash: str) -> str:
    event["timestamp"] = time.time()
    event["prev_hash"] = prev_hash
    payload = json.dumps(event, sort_keys=True).encode()
    event["hash"] = hashlib.sha256(payload).hexdigest()
    with open(log_file, "a") as f:
        f.write(json.dumps(event) + "\n")
    return event["hash"]
  1. Remote shipping: Forward audit events to an external SIEM (Splunk, Elastic) in real-time via syslog or webhook

References

  • SOC 2 Type II CC7.2: "The entity monitors system components for anomalies"
  • ISO 27001 A.12.4.2: "Logging facilities and log information shall be protected against tampering"

Alternatives Considered

No response

Category

enhancement: feature

Checklist

  • I searched existing issues and this is not a duplicate
  • This is a design proposal, not a "please build this" request

Activity

  1. added
    enhancement
    on Mar 24, 2026
  2. wscurran commented on Mar 25, 2026

    @wscurran
    Contributor

    ✨ Thanks for submitting this issue with a detailed explanation, it addresses a security concern that could compromise the integrity of the audit trail, which could improve the security of NemoClaw.


    Possibly related open PRs:
    #871 security: enforce process limit to prevent fork bombs in sandbox,
    #654 harden sandbox against agent config tampering (defense-in-depth),
    #611 security: remove telegram and discord from baseline sandbox policy

  3. added and removed
    enhancement
    on Mar 25, 2026
  4. added
    enhancement
    and removed on Jun 3, 2026
  5. self-assigned this
    on Jun 3, 2026
  6. wscurran commented on Jun 3, 2026

    @wscurran
    Contributor

    Thanks for the detailed security report, @h-network.

    We reviewed this with the team, and the core concern is valid: sandbox-local logs that an agent can modify should not be treated as authoritative security or audit evidence.

    After discussing the implementation options, we’ve decided not to pursue the local log-hardening path for this issue. Making sandbox-local logs agent-proof adds a lot of filesystem, startup, and policy complexity, and still leaves awkward edge cases around treating local sandbox state as a security boundary.

    Instead, we’re going to focus this area on telemetry: the authoritative security/audit signal should come from a telemetry path outside the agent’s write surface, rather than relying on sandbox-local logs as the source of truth.

    Closing this QA blocker as not planned for the local audit-log hardening approach. Thanks again for raising it — this helped clarify the right product direction.

  7. added theissue type on Jun 8, 2026
  8. changed the issue type fromtoon Jun 8, 2026
  9. removed
    enhancement
    on Jun 8, 2026
  10. added
    area: observability
    area: security
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: observabilityarea: security

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions