zeroclaw/src/security
Argenis a606f308f5
fix(security): respect allowed_roots in tool-level path pre-checks (#3434)
When workspace_only=true and allowed_roots is configured, several tools
(file_read, content_search, glob_search) rejected absolute paths before
the allowed_roots allowlist was consulted. Additionally, tilde paths
(~/...) passed is_path_allowed but were then incorrectly joined with
workspace_dir as literal relative paths.

Changes:
- Add SecurityPolicy::resolve_tool_path() to properly expand tilde
  paths and handle absolute vs relative path resolution for tools
- Add SecurityPolicy::is_under_allowed_root() for tool pre-checks to
  consult the allowed_roots allowlist before rejecting absolute paths
- Update file_read to use resolve_tool_path instead of workspace_dir.join
- Update content_search and glob_search absolute-path pre-checks to
  allow paths under allowed_roots
- Add tests covering workspace_only + allowed_roots scenarios

Closes #3082
2026-03-13 16:15:30 -04:00
..
audit.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
bubblewrap.rs readd tests, remove markdown files 2026-02-18 14:42:39 +08:00
detect.rs fix(channels): execute tool calls in channel runtime (#302) 2026-02-16 05:07:01 -05:00
docker.rs readd tests, remove markdown files 2026-02-18 14:42:39 +08:00
domain_matcher.rs feat(security): add otp and estop phase-1 foundation 2026-02-21 23:19:36 +08:00
estop.rs feat(security): add otp and estop phase-1 foundation 2026-02-21 23:19:36 +08:00
firejail.rs readd tests, remove markdown files 2026-02-18 14:42:39 +08:00
landlock.rs readd tests, remove markdown files 2026-02-18 14:42:39 +08:00
leak_detector.rs fix(security): strip URLs before high-entropy token extraction (#3064) (#3321) 2026-03-12 13:53:38 +00:00
mod.rs fix(onboard): use provider-aware env var hint in quick setup next steps 2026-02-24 16:03:01 +08:00
otp.rs feat(security): add otp and estop phase-1 foundation 2026-02-21 23:19:36 +08:00
pairing.rs feat(gateway): add --new flag to get-paircode for non-disruptive pairing code generation 2026-03-11 04:30:58 -04:00
policy.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
prompt_guard.rs fix(ci): address strict-delta clippy blockers 2026-02-24 16:03:01 +08:00
secrets.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
traits.rs docs(code): expand doc comments on security, observability, runtime, and peripheral traits 2026-02-19 13:19:46 -08:00