Skip to content

v2.0.0

Choose a tag to compare

@cyyever cyyever released this 20 Feb 04:21
· 474 commits to main since this release
775ddcc

This release brings Crust from v1.1.0 to v2.0.0 with major new features, a significantly hardened blocking layer, and broad multi-platform support.
Go blocking layer β€” rule engine & evasion detection

Command extraction engine overhauled:

Expanded command database to 190+ commands: compilers, package managers, disk/filesystem tools, media converters, encryption tools, macOS-specific tools, systemd, user management, and Windows LOLBAS entries
PowerShell-aware extraction: detects 60+ PS cmdlets/aliases (Get-Content, Invoke-WebRequest, Invoke-Expression, etc.) with PS-specific flag parsing (-Path, -LiteralPath, -FilePath)
PowerShell evasion detection: recursively parses -Command "..." and pwsh -c "..." inner commands; decodes -EncodedCommand base64 UTF-16LE payloads and flags them as evasive
Windows path support: backslash path normalization and PS variable expansion ($env:APPDATA, $HOME)
Subprocess isolation for shell parsing β€” panics in the mvdan.cc/sh AST library crash a worker subprocess instead of the main proxy process

Bypass detection hardened:

Pipe-to-shell bypass: detects echo 'rm -rf /' | sh and similar shell-injection patterns
Pipe-to-xargs bypass: detects find . -name ".env" | xargs cat and stdin-arg wrapper patterns
strace / wget / exec bypasses resolved via shell parser improvements
Symlink-aware path matching: rules tested against both the pre-resolved and real path (e.g. /etc/passwd matches even when /etc β†’ /private/etc on macOS)
Download-to-file detection: wget -O <path> and curl -o <path> mapped to OpWrite so file-protection rules trigger on download attacks

New built-in rules (17 total):

protect-system-auth: /etc/passwd, /etc/shadow, /etc/master.passwd, /etc/sudoers
/proc process memory access (/proc/self/environ, /proc/<pid>/cmdline, etc.)
Shell history, browser data, package manager tokens
MCP content-only rules matching raw JSON of any tool call including plugins
Network action added to credential protection rules

Proxy self-protection:

Self-protection regex blocks agent attempts to reach the management API via curl --unix-socket, socat, or similar tools
Management socket path added to generated protection rules

Proxy reliability fixes

5 SSE/streaming bugs fixed: buffer overflow recovery, multi-data-line concatenation per SSE spec, missing WriteHeader for buffered 2xx, gzip decompression error handling, RFC 7230 Connection hop-by-hop header parsing
Race condition fixed in GetInterceptionConfig() β€” RLock/RUnlock added
Response size limits: 100 MB cap on response body, 1 MB cap on error body via LimitReader
Hop-by-hop header typo fixed ("Trailers" β†’ "Trailer" per RFC 7230 Β§4.1.2)
Streaming path no longer leaks Connection/Upgrade headers to upstream

Concurrent sessions dashboard

crust status --live β€” Sessions tab alongside the Overview tab
Split-pane layout: session list (left) + per-session blocked/allowed event log (right)
Session status dots (all-blocked / mixed / clean), last-seen timestamps, model label
Navigate with ↑↓, switch tabs with 1/2/tab, quit with q

Management API over Unix domain sockets

Replaced TCP management API with Unix domain sockets (~/.crust/crust-api-{port}.sock)
Kernel-enforced access control (chmod 0600), invisible to port scanners
Supports multiple concurrent Crust instances on different ports
Stale-socket detection with flock-based liveness check; auto-cleanup on restart
Windows: named pipes via go-winio

Telemetry reliability

Fixed SQLite WAL mode and concurrency for multi-goroutine writes
New API endpoints: GET /api/telemetry/sessions and /api/telemetry/sessions/:id/events
Per-session stats isolated from global Overview metrics

Agent compatibility

Tool name support for Codex CLI, Cline, OpenClaw, and OpenCode in the extraction engine
MessageRole enum and named API protocol constants replace raw strings
--auto mode: clients bring their own auth, provider resolved from model name

Config & UX

Config.Validate() with user-friendly multi-error reporting
Default config path ~/.crust/config.yaml; --config flag to override
New TUI startup flow with advanced options tab (telemetry, retention, ports)
Animated CRUST banner on startup; optional TUI via build tags for headless environments

Platform & distribution

Formal Windows support:

Native Windows daemon with PID file locking (LockFileEx) and named pipe management API
PowerShell command extraction and Windows-specific LOLBAS command database entries
Windows path normalization (backslash, drive letters, %APPDATA%/$env: variables)
install.ps1 installer and pre-built windows/amd64 binary

Formal FreeBSD support:

Unix socket management API and flock-based liveness checks work on FreeBSD
Build tags (unix) cover FreeBSD alongside Linux and macOS

Multi-platform binaries via GoReleaser:

Linux: amd64, arm64
macOS: amd64, arm64
Windows: amd64
Updated install.sh and install.ps1

Testing

Comprehensive evasion test suite (tests/agents/test_evasion.py) covering pipe injection, xargs, symlinks, PowerShell, and encoding bypasses
OpenClaw integration tests with real agent traffic
Fuzz targets for shell parsing, rule matching, SSE parsing, and pattern conversion