Security Model - UnitBuilds-CC/V.E.L.O.C.I.T.Y.-MCP GitHub Wiki
Security Model
15+ defense layers providing enterprise-grade protection.
Defense Layers
| # | Layer | Description |
|---|---|---|
| 1 | Input Validation | Bounds-checked parser, path traversal rejection, injection protection |
| 2 | Capability Sandbox | No network, isolated filesystem, approved interpreters only |
| 3 | Linux Seccomp | Kernel-level syscall filtering (blocks network, fork, mount, ptrace) |
| 4 | Windows Job Objects | Memory cap (256 MB) and process limits |
| 5 | Execution Timeout | 30-second hard deadline with process kill |
| 6 | Output Size Limits | stdout: 1 MB, stderr: 256 KB |
| 7 | Ed25519 Signatures | NDA document authenticity and tamper detection |
| 8 | Merkle Integrity | SHA-256 root verification of NDA content |
| 9 | Rate Limiting | Token bucket: 20 req/sec, burst 100, per-client |
| 10 | Audit Logging | 10K ring buffer, JSON/CSV export |
| 11 | Error Sanitization | Strips paths, truncates at 500 chars |
| 12 | CORS Protection | Configurable origin restrictions |
| 13 | API Key Auth | Timing-safe comparison |
| 14 | Dependency Audit | 0 vulnerabilities (cargo audit) |
| 15 | CI/CD | Build + test + audit on every push/PR |
Sandbox
All execution (shell_exec, execute_nda) runs in a capability-based sandbox:
- No network access by default
- Filesystem isolated to sandbox temp directory
- 6 approved interpreters: python, node, powershell, bash, cmd.exe, dotnet
- 256 MB memory cap via OS-level enforcement
- Violation tracking — all violations logged to audit trail
Platform-Specific Enforcement
| Platform | Mechanism |
|---|---|
| Linux | seccomp-bpf syscall whitelist (blocks socket, fork, mount, ptrace, keyctl) |
| Windows | Job Object memory limits + process isolation |
Path Validation
All file paths validated before execution (cross-platform):
| Check | Rejects |
|---|---|
| Empty path | "" |
| Relative path | "documents/file.nda" |
| Path traversal | "../../etc/passwd" |
| Must be absolute | "./relative/file" |
NDA Document Security
- Ed25519: Sign with
compile_signed(), verify withverify_signature() - Merkle tree: SHA-256 root of all triples, verified on parse
- Status: VERIFIED / UNSIGNED / FAILED (reported by
read_nda)
Testing
284 tests verify security layers:
- 15 adversarial integration tests (path traversal, network blocking, tamper detection)
- 17 property-based fuzz tests (3,400+ random cases)
- Parser bounds checking, sandbox capabilities, signature verification
See also: Built-in-Tools, NDA-Format, Troubleshooting