Version: v0.1
Updated: 2026-03-12
The architecture must satisfy five constraints:
- Cross-platform delivery on macOS, Windows, and Linux
- Shared detection and remediation logic across CLI commands
- Safe, auditable remediation with backup and rollback
- Fast response to new OpenClaw disclosures through ruleset updates
- English-first product and engineering workflow with optional Chinese localization
- Core language: Rust
- CLI shell: Rust binary
- Core serialization:
serdeandserde_json - Rules parsing: signed JSON packs plus plain-text local overrides
- Reporting: HTML templates plus PDF export
- Localization: locale-aware report templates and documentation bundles
Clawguard should be organized into one shared engine and one shell:
-
Shared Core
- Asset discovery
- Detection orchestration
- Rules evaluation
- Risk scoring
- Remediation planning
- Remediation execution
- Backup and rollback
- Report generation
-
CLI Shell
- Non-interactive automation
- CI and scripting support
- JSON-first output mode
- Localized interactive operator flow with a global locale switch
Responsibilities:
- Scan orchestration
- Rule loading
- Finding normalization
- Risk scoring
- Task cancellation and progress reporting
Suggested detector families:
- Local installation detector
- Process and port detector
- Reverse-proxy detector
- Version detector
- Configuration parser
- Permission-chain detector
- Secrets detector
- Skills and provenance detector
- Exposure reachability detector
Responsibilities:
- Build remediation plans from findings
- Validate whether remediation is safe to apply
- Write backups before changes
- Apply changes
- Roll back on failure
- Emit structured remediation records
Responsibilities:
- Load signed rules packs
- Validate version compatibility and Ed25519 signatures
- Evaluate findings against advisories, baselines, and IOC rules
- Support local custom rules layered on top of vendor rules
- Persist imported packs in a local rules store
- Track the active rules version and rollback history
Responsibilities:
- Generate structured report models
- Render interactive UI views
- Export HTML, PDF, and JSON
- Render localized report strings
Responsibilities:
- Abstract filesystem and permission differences
- Support platform-specific process enumeration
- Support platform-specific firewall or networking checks
- Handle platform-specific packaging specifics
- User selects local scan or target input
- Core engine resolves the scan context
- Detectors run in parallel where safe
- Raw observations are normalized into findings
- Rules runtime enriches findings with severity, explanation, and remediation metadata
- Risk scoring computes host and scan-level posture
- Reporting builds the interactive and exportable report model
- User selects recommended fixes
- Core engine composes a remediation plan
- Remediators validate prerequisites
- System creates timestamped backups
- System applies changes in a controlled sequence
- Post-remediation verification reruns the affected checks
- Report captures before and after status
- Rollback remains available if verification fails or the user cancels
- Client fetches or imports a signed rules pack
- Signature and version compatibility are verified before import
- Rules are stored under a versioned local rules-store path
- The active ruleset pointer is updated explicitly by activation
- Previous ruleset remains available for rollback
Core entities should include:
AssetScanTargetObservationFindingFindingEvidenceRuleRemediationPlanRemediationActionBackupRecordRollbackRecordReportRulesetVersionLocalizationBundle
Each finding should be normalized to a common schema:
idcategoryseveritytitlesummaryevidenceaffected_componentpermission_impactexposure_impactrecommended_fixauto_fix_supportedreferences
Rules should be designed to support:
- Version windows
- Config predicates
- Environment predicates
- Platform predicates
- Detection evidence requirements
- Remediation metadata
This keeps the product extensible when new CVEs follow known mechanisms.
Because the user explicitly called out permission vulnerabilities, this area needs a dedicated model.
The permission-chain subsystem should evaluate:
- Who can trigger an action
- Which policy decides whether it is allowed
- What the user sees before approval
- What command or action is actually executed
- Whether normalization differs between approval and execution stages
- Whether webhooks or external triggers can bypass intended approval
This subsystem should produce both:
- A technical finding for engineers
- A plain-language explanation for operators
The project should be English-first:
- Product copy authored in English
- Code comments in English only
- Engineering docs in English only
- Chinese provided as an optional report locale and optional translated docs set
Implementation expectations:
- Report templates and interactive CLI strings rendered from localized message bundles
- Global locale flags override environment-based locale detection
- Missing translations fall back to English
Documentation should be treated as a product subsystem, not an afterthought.
Required document classes:
- Security insights
- Product requirements
- Solution architecture
- System design
- Vulnerability tracker
- ADRs for major decisions
- Release notes
Update rules:
- New vulnerability disclosure updates the tracker first
- If product scope changes, update requirements
- If implementation approach changes, update design
- If a major technical choice changes, add an ADR
The product should feel precise and high-trust rather than noisy or "hacker themed".
Recommended UX principles:
- Lead with posture summary, not raw logs
- Separate "critical now" from "important later"
- Treat remediation as a controlled workflow, not a blind button
- Make evidence visible but collapsible
- Make report exports presentation-ready
Phase 2 recommendation:
- Build the Rust core as the source of truth
- Expose the engine through a stable CLI
- Treat rules packs as versioned signed content
- Implement localization from day one
- Design the report system as a first-class output, not a post-processing layer