How lingyang15359/defenseclaw works
DefenseClaw is an OpenClaw security-governance system: operators configure it through a CLI, while a Go daemon scans and admits installed agent components, enforces policy, inspects runtime traffic, and records outcomes. A TypeScript plugin connects OpenClaw hooks to the daemon; a separate gateway proxy inspects LLM messages. The graph retains documented scanning, CodeGuard, sandbox, inventory, alerting, and SIEM capabilities. Edges are limited to README statements and sampled source/index references; unsampled subsystem links are omitted where evidence is insufficient.
Main entry points: commands CLI commands · router.go Event router · store.go Audit store · watcher.go Install watcher
Components 24
Operator CLI
- Python CLI
cli/defenseclaw/main.py - CLI commands
cli/defenseclaw/commands - CodeGuard
cli/defenseclaw/codeguard_skill.py - Go CLI
internal/cli
Scanning and admission
- Install watcher
internal/watcher/watcher.go - Component scanners
internal/scanner - CodeGuard scanner
internal/scanner/codeguard.go - Admission gate
cli/defenseclaw/enforce/admission.py - Policy engine
internal/policy/engine.go
Runtime governance
- OpenClaw plugin
extensions/defenseclaw/src/index.ts - Plugin API client
extensions/defenseclaw/src/client.ts - Go daemon
internal/daemon/daemon.go - Event router
internal/gateway/router.go - Tool inspection
internal/gateway/inspect.go - Guardrail proxy
internal/gateway/proxy.go - LLM providers
internal/gateway/provider.go - Sandbox controls
internal/sandbox
State and operations
- Audit store
internal/audit/store.go - SIEM export
internal/audit/splunk.go - Telemetry
internal/telemetry - Agent inventory
cli/defenseclaw/inventory/claw_inventory.py - TUI dashboard
internal/tui/app.go
Other components
- Operator
- OpenClaw
Connections 25
- Operator → Python CLI: runs commands
README.md - Python CLI → CLI commands: dispatches
cli/defenseclaw/main.py - CLI commands → Component scanners: requests scans
cli/defenseclaw/commands/cmd_skill.py - CLI commands → Admission gate: submits findings
cli/defenseclaw/commands/cmd_skill.py - CLI commands → CodeGuard: runs standalone
cli/defenseclaw/commands/cmd_codeguard.py - Install watcher → Policy engine: evaluates admission
internal/watcher/watcher.go - Install watcher → Component scanners: scans installs
internal/watcher/watcher.go - Install watcher → Audit store: logs outcomes
internal/watcher/watcher.go - Component scanners → CodeGuard scanner: includes code checks
- Admission gate → Audit store: records decisions
README.md - Operator → Go CLI: runs commands
README.md - OpenClaw plugin → Plugin API client: calls API
README.md - OpenClaw plugin → OpenClaw: hooks tool calls
README.md - Plugin API client → Go daemon: sends REST requests
README.md - OpenClaw → Event router: sends WebSocket events
README.md - Go daemon → Event router: routes events
internal/gateway/router.go - Event router → Audit store: logs actions
internal/gateway/router.go - Event router → Telemetry: records spans
internal/gateway/router.go - Event router → Tool inspection: inspects tool events
- OpenClaw → Guardrail proxy: routes LLM calls
README.md - Guardrail proxy → LLM providers: forwards requests
- Go daemon → Sandbox controls: manages isolation
- Audit store → SIEM export: forwards audit events
README.md - Audit store → TUI dashboard: supplies dashboard data
internal/tui/app.go - CLI commands → Agent inventory: generates bill of materials
cli/defenseclaw/commands/cmd_aibom.py