Repository navigation
fix(guardrails): deny sudo routes to the guardrail registration (#3105) - #3113
Merged
Merged
Conversation
…lth re-checks it per request bash_deny gains two patterns: any sudo command naming /etc/claude-code, /opt/trinity or /etc/sudoers (plus visudo), and root shells (sudo -i/-s/ --login/--shell, sudo su, sudo <shell> with no script, bare su). Each sudo option token has one match path so matching stays linear; a hook that outlasts its timeout does not deny. Agent /health reports guardrails_registration (ok/missing/not_root_owned/ writable), stat'd on every request. Docs state the registration cannot be rewritten without sudo, and that the deny patterns are a speed bump. Fixes #3105 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
merge-train: merged. Follow-ups from validation, none of them blocking:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bash_denygets two new patterns:sudocommand naming/etc/claude-code,/opt/trinityor/etc/sudoers, plusvisudosudo -i/-s/--login/--shell,sudo su,sudo <shell>with no script, and baresu/healthreportsguardrails_registration(ok/missing/not_root_owned/writable). It stats the file on every request, and the value is an enum only, likeclone_status.sudo, and that the regexes are a speed bump. This covers architecturesecurity.md, requirements §28.1/§28.2.1, the guardrails feature flow and the user docs.Changes
docker/base-image/hooks/guardrails-baseline.jsondocker/base-image/agent_server/routers/info.pytests/unit/test_3105_sudo_guardrail_deny.pydocs/security-reports/cso-diff-2026-09-30-3105-*auditBehaviour change
sudoreads of those paths are denied too (for examplesudo cat /etc/sudoers). Unchanged and still allowed:sudo apt-get install -s,sudo bash script.sh,sudo sh -c '…',sudo -u postgres psql.Test Plan
cd tests && pytest unit/test_3105_sudo_guardrail_deny.py unit/test_guardrails.py unit/test_ent345_guardrail_registration.py unit/test_1439_clone_status_health.py -qsudo -idenied from chat;/healthshowsguardrails_registration: okFixes #3105
🤖 Generated with Claude Code