feat(security): add security configuration and tool validation

Security Configuration:
- config/security.toml with shell_exec, file_read, file_write, web_fetch, browser, and mcp settings
- Command whitelist/blacklist for shell execution
- Path restrictions for file operations
- SSRF protection for web fetch

Tool Security Implementation:
- ShellSecurityConfig with whitelist/blacklist validation
- ShellExecTool with actual command execution
- Timeout and output size limits
- Security checks before command execution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-24 03:10:32 +08:00
parent 84601776d9
commit e49ba4460b
4 changed files with 334 additions and 9 deletions

View File

@@ -52,6 +52,9 @@ pub enum ZclawError {
#[error("MCP error: {0}")]
McpError(String),
#[error("Security error: {0}")]
SecurityError(String),
}
/// Result type alias for ZCLAW operations