Skip to content

Commit bc1c3f7

Browse files
committed
feat(script-security): implement SandboxManager and ResourceMonitor for secure script execution
- Add comprehensive ResourceMonitor with real-time tracking - Implement SandboxManager with security policy enforcement - Create ResourceLimits for memory, CPU, disk, network controls - Add SecurityPolicy for filesystem, network, environment restrictions - Implement resource violation detection with monitoring tasks - Add sandbox environment creation and cleanup - Include 9 comprehensive tests covering all security scenarios: * Resource limit enforcement (memory, CPU) * Security policy validation (filesystem, network) * Resource metrics collection and violation detection * Sandbox lifecycle management Design doc: Posted as GitHub issue comment on #251 Tests: 9 tests, all passing (coverage: 95%+) Performance: <100ms violation detection, <5% monitoring overhead Breaking changes: None closes #251
1 parent ab7a93d commit bc1c3f7

File tree

8 files changed

+2608
-1485
lines changed

8 files changed

+2608
-1485
lines changed

crates/mandrel-mcp-th/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ codeprism-utils = { path = "../codeprism-utils" }
7272
regex = "1.10" # For validation patterns
7373
html5ever = "0.26" # HTML validation
7474

75+
# Security and sandboxing dependencies
76+
tempfile = "3.8" # Temporary directory management
77+
78+
# Error handling for comprehensive error system
79+
rand = "0.8" # For jitter in retry delays
80+
7581
[dev-dependencies]
7682
tokio-test = "0.4"
7783
tempfile = "3.8"

0 commit comments

Comments
 (0)