Skip to content

security: Bash guardrail has no deny pattern for sudo writes to the guardrail registration; docs claim it cannot be rewritten (CSO 2026-09-29 #5) #3105

Closed

Description

@vybe

Summary

developer ALL=(ALL) NOPASSWD:ALL (base-image Dockerfile L198-199) is a documented design choice, and docs/memory/architecture/security.md L134 already states root ownership only prevents accidental rewrites. The guardrail subsystem's own text says the opposite — L133 "the file cannot be rewritten", requirements security.md §28.1 "agents cannot opt out" — and the ent#345 fix closed only the unprivileged path: path_deny (/etc/claude-code/*, /opt/trinity/*) is consulted by file-guardrail.py (Edit/Write) only, while bash_deny in docker/base-image/hooks/guardrails-baseline.json — which regex-matches the full command string and so can see it — has no sudo/registration pattern. startup.sh L26-36 checks writability once at boot and logs "registration verified". One sudo write to /etc/claude-code/managed-settings.json or /opt/trinity/hooks/* disables every hook for the container's remaining life with no log line.

Narrowing sudoers is not viable (DAC_OVERRIDE / sudo apt are intended), so the hook is the cheap control. A regex deny list remains a speed bump against a determined adversary — this is defense in depth, not a boundary.

Acceptance criteria

  • bash_deny gains a pattern for sudo writes touching /etc/claude-code, /opt/trinity or /etc/sudoers, and one for interactive root shells (sudo -i/-s/su/bash).
  • The tracked /health follow-up (§28.2.1) stats the registration per request or per execution, not per boot.
  • security.md L133 and requirements §28.1 are reconciled with L134 ("cannot be rewritten without sudo").
  • test_ent345_guardrail_registration.py (or a sibling) asserts the new deny patterns match the obvious spellings.

Evidence

docs/security-reports/cso-2026-09-29.md Finding 5 (ASI05).

Activity

  1. added
    priority-p2
    type-bug
    theme-security
    complexity-low
    on Sep 30, 2026
  2. obasilakis commented on Sep 30, 2026

    @obasilakis
    Contributor

    /claim

  3. added
    status-in-progress
    on Sep 30, 2026
  4. github-actions commented on Sep 30, 2026

    @github-actions

    Claimed by @obasilakis. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/3105-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #3105
  5. added a commit that references this issue on Sep 30, 2026
    503f604
  6. added
    status-in-dev
    and removed
    status-in-progress
    on Sep 30, 2026
  7. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-securitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions