Files
ruvnet__ruflo/plugins/ruflo-security-audit/README.md
T

70 lines
4.0 KiB
Markdown
Raw Normal View History

feat: add 19 Claude Code native plugins with 64 skills, 25 commands, 21 agents Complete plugin marketplace for Ruflo with validated Claude Code plugin format: - ruflo-core: MCP server, status, doctor, plugin discovery - ruflo-swarm: swarm coordination, Monitor, worktree isolation - ruflo-autopilot: autonomous /loop completion with learning - ruflo-intelligence: SONA neural patterns, trajectory learning, routing - ruflo-agentdb: AgentDB controllers, HNSW vector search, RuVector - ruflo-aidefence: AI safety scanning, PII detection, prompt defense - ruflo-browser: Playwright browser automation, testing, scraping - ruflo-jujutsu: git diff analysis, risk scoring, reviewer recs - ruflo-wasm: sandboxed WASM agents and gallery sharing - ruflo-workflows: workflow templates, orchestration, lifecycle - ruflo-daa: Dynamic Agentic Architecture, cognitive patterns - ruflo-ruvllm: local LLM inference, MicroLoRA, SONA, chat format - ruflo-rvf: RVF portable memory, session persistence, transfer - ruflo-loop-workers: background /loop workers, CronCreate - ruflo-security-audit: CVE scanning, dependency checks - ruflo-rag-memory: simple store/search/recall interface - ruflo-testgen: test gap detection, TDD workflow - ruflo-docs: doc generation, drift detection - ruflo-plugin-creator: scaffold, validate, publish new plugins All 19 pass `claude plugin validate`. Skills auto-discovered from directory structure (not declared in plugin.json). Each skill wires to ruflo MCP tools via allowed-tools frontmatter. Includes: marketplace.json, GitHub Pages storefront, CI validation workflow, minimalist README with USERGUIDE split. Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-27 23:07:33 -04:00
# ruflo-security-audit
Security review, dependency scanning, policy gates, and CVE monitoring.
## Install
```
/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-security-audit@ruflo
```
## What's Included
- **Security Scanning**: Deep scan with `security scan --depth deep` (valid: quick, standard, deep)
feat: add 19 Claude Code native plugins with 64 skills, 25 commands, 21 agents Complete plugin marketplace for Ruflo with validated Claude Code plugin format: - ruflo-core: MCP server, status, doctor, plugin discovery - ruflo-swarm: swarm coordination, Monitor, worktree isolation - ruflo-autopilot: autonomous /loop completion with learning - ruflo-intelligence: SONA neural patterns, trajectory learning, routing - ruflo-agentdb: AgentDB controllers, HNSW vector search, RuVector - ruflo-aidefence: AI safety scanning, PII detection, prompt defense - ruflo-browser: Playwright browser automation, testing, scraping - ruflo-jujutsu: git diff analysis, risk scoring, reviewer recs - ruflo-wasm: sandboxed WASM agents and gallery sharing - ruflo-workflows: workflow templates, orchestration, lifecycle - ruflo-daa: Dynamic Agentic Architecture, cognitive patterns - ruflo-ruvllm: local LLM inference, MicroLoRA, SONA, chat format - ruflo-rvf: RVF portable memory, session persistence, transfer - ruflo-loop-workers: background /loop workers, CronCreate - ruflo-security-audit: CVE scanning, dependency checks - ruflo-rag-memory: simple store/search/recall interface - ruflo-testgen: test gap detection, TDD workflow - ruflo-docs: doc generation, drift detection - ruflo-plugin-creator: scaffold, validate, publish new plugins All 19 pass `claude plugin validate`. Skills auto-discovered from directory structure (not declared in plugin.json). Each skill wires to ruflo MCP tools via allowed-tools frontmatter. Includes: marketplace.json, GitHub Pages storefront, CI validation workflow, minimalist README with USERGUIDE split. Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-27 23:07:33 -04:00
- **CVE Monitoring**: Automated CVE detection and remediation guidance
- **Input Validation**: Zod-based validation at system boundaries via `@claude-flow/security`
- **Path Security**: Traversal prevention and safe executor for command injection protection
- **Policy Gates**: Configurable security policies for CI/CD pipelines
- **Threat Modeling**: Automated threat analysis and risk assessment
feat(plugins): ADR-098 Part 1 (slice 1/3) — capability sync for security plugins Adds ADR-095/096 + audit_1776853149979 references to ruflo-aidefence and ruflo-security-audit. End users installing either plugin now see the host hardening features that pair with the plugin's threat detection / scanning, not just the plugin's own surface. ruflo-aidefence/README.md: New "Defense-in-depth pairing (ruflo 3.6.25+)" section listing: - validateEnv() loader-hijack denylist (LD_PRELOAD, NODE_OPTIONS, DYLD_*, etc.) at the terminal_create MCP boundary - File mode 0600 / dir mode 0700 on session/terminal/memory stores via fs-secure - Encryption at rest (CLAUDE_FLOW_ENCRYPT_AT_REST=1, AES-256-GCM, RFE1 magic-byte sniff) Threat scoring should account for whether the host is a denylist- enforcing / encrypted-at-rest install. ruflo-security-audit/README.md: New "Patterns to scan for (audit_1776853149979 follow-up)" section with six concrete antipatterns + remediation pointers: - execSync(string) with template-literal args (4 closed sites cited) - Numeric MCP inputs cast as `number` without runtime check - Untrusted package specs flowing into npm install - Loader-hijack env vars - Plaintext at-rest secrets paired with ADR-096 - MCP stdin DoS (10MB cap reference) Plus a `ruflo verify` reference confirming 55 witnesses on disk. Plugin versions: ruflo-aidefence 0.1.0 → 0.2.0 (minor — capability sync) ruflo-security-audit 0.1.1 → 0.2.0 (minor — capability sync, was patch from iter #55 model fix) Two more slices remain for Part 1: - slice 2: ruflo-rag-memory + ruflo-rvf — encryption-at-rest gate notes - slice 3: ruflo-cost-tracker — federation budget breaker pairing, federation_spend events - slice 4: ruflo-agentdb + ruflo-knowledge-graph — G7 controllers
2026-05-03 22:01:01 -04:00
## Patterns to scan for (audit_1776853149979 follow-up)
The 3.6.25 release closed a class of shell-injection bugs. When auditing downstream code, the scanner should flag these patterns:
- **`execSync(string)` with template-literal args** — replace with `execFileSync(cmd, argv, { shell: false })`. Closed sites: `github-safe.js`, `statusline.js/cjs` (git calls), `mcp-tools/github-tools.ts` (`gh pr/issue/run`), `update/executor.ts` (`npm install`).
- **Numeric MCP inputs cast as `number`** — TypeScript casts don't run at runtime. A `prNumber: "1; rm -rf /"` slips through. Mitigate via `toPositiveInt(value)` (see `src/mcp-tools/github-tools.ts`).
- **Untrusted package specs flowing into `npm install`** — gate via `isSafePackageSpec(pkg, version)` regex check (see `src/update/executor.ts`). Defense-in-depth even with `execFileSync`.
- **Loader-hijack env vars** (`LD_PRELOAD`, `NODE_OPTIONS`, `DYLD_*`) flowing into a child process env — gate via `validateEnv()` (see `src/mcp-tools/validate-input.ts`).
- **Plaintext secrets at rest** in `.claude-flow/sessions/`, `.claude-flow/terminals/store.json`, `.swarm/memory.db` — paired with [ADR-096](../../v3/docs/adr/ADR-096-encryption-at-rest.md) opt-in encryption (`CLAUDE_FLOW_ENCRYPT_AT_REST=1`). Confirm gate state via `ruflo doctor -c encryption`.
- **MCP stdin DoS** — un-newlined input piped into the MCP server. The host caps the buffer at 10MB by default; downstream MCP wrappers should enforce equivalent limits.
A `ruflo verify` round-trip confirms 55 witnesses (27 regression-fix + 28 per-source-file capability) match the signed manifest byte-for-byte.
feat: add 19 Claude Code native plugins with 64 skills, 25 commands, 21 agents Complete plugin marketplace for Ruflo with validated Claude Code plugin format: - ruflo-core: MCP server, status, doctor, plugin discovery - ruflo-swarm: swarm coordination, Monitor, worktree isolation - ruflo-autopilot: autonomous /loop completion with learning - ruflo-intelligence: SONA neural patterns, trajectory learning, routing - ruflo-agentdb: AgentDB controllers, HNSW vector search, RuVector - ruflo-aidefence: AI safety scanning, PII detection, prompt defense - ruflo-browser: Playwright browser automation, testing, scraping - ruflo-jujutsu: git diff analysis, risk scoring, reviewer recs - ruflo-wasm: sandboxed WASM agents and gallery sharing - ruflo-workflows: workflow templates, orchestration, lifecycle - ruflo-daa: Dynamic Agentic Architecture, cognitive patterns - ruflo-ruvllm: local LLM inference, MicroLoRA, SONA, chat format - ruflo-rvf: RVF portable memory, session persistence, transfer - ruflo-loop-workers: background /loop workers, CronCreate - ruflo-security-audit: CVE scanning, dependency checks - ruflo-rag-memory: simple store/search/recall interface - ruflo-testgen: test gap detection, TDD workflow - ruflo-docs: doc generation, drift detection - ruflo-plugin-creator: scaffold, validate, publish new plugins All 19 pass `claude plugin validate`. Skills auto-discovered from directory structure (not declared in plugin.json). Each skill wires to ruflo MCP tools via allowed-tools frontmatter. Includes: marketplace.json, GitHub Pages storefront, CI validation workflow, minimalist README with USERGUIDE split. Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-27 23:07:33 -04:00
## Requires
- `ruflo-core` plugin (provides MCP server)
feat(ruflo-security-audit): adopt plugin contract — AIDefence static/runtime layered integration (ADR-0001) Plugin already at v0.2.0 with 1 agent + 2 skills + 1 command. The contract pieces were missing. Notable: this plugin's static analysis layer complements ruflo-aidefence's runtime 3-gate pattern. ADR-0001 documents the layered story: | Layer | Owner | What it catches | |------------------|------------------------|------------------------------------------------------------------| | Static analysis | ruflo-security-audit | Shell-injection patterns, CVEs, plaintext secrets, loader-hijack | | Runtime 3-gate | ruflo-aidefence ADR-1 | PII pre-storage, sanitization, prompt-injection | Static analysis finds the patterns; the runtime gates catch what slipped through. The audit_1776853149979 pattern catalog (already in README) is the regression-prevention contract for the shell-injection class the 3.6.25 release closed. - ADR-0001 (Proposed) at docs/adrs/0001-security-audit-contract.md - README adds Compatibility (pin v3.6), AIDefence integration block (static/runtime layered table; cross-reference to ruflo-aidefence ADR-0001), Namespace coordination (claims security-findings; defers to ruflo-agentdb ADR-0001), Verification + Architecture Decisions - plugin.json keywords add mcp, cve-monitoring, policy-gates, shell-injection (already at v0.2.0) - scripts/smoke.sh — 10 structural checks: version + keywords, both skills + agent + command present, v3.6 pin, namespace coordination, security-findings claimed, AIDefence 3-gate cross-reference, audit_1776853149979 pattern catalog intact (execSync, execFileSync, loader-hijack, isSafePackageSpec), ADR-096 encryption cross-reference, ADR Proposed, no wildcard tools Verification: bash plugins/ruflo-security-audit/scripts/smoke.sh → 10/10 Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-04 20:37:35 -04:00
## Compatibility
- **CLI:** pinned to `@claude-flow/cli` v3.6 major+minor.
- **Verification:** `bash plugins/ruflo-security-audit/scripts/smoke.sh` is the contract.
## AIDefence integration
This plugin's **static** scanning (CVE / dependency / shell-injection patterns) complements the **runtime** gates owned by [ruflo-aidefence ADR-0001](../ruflo-aidefence/docs/adrs/0001-aidefence-contract.md):
| Layer | Owner | What it catches |
|-------|-------|----------------|
| **Static analysis** (this plugin) | `ruflo-security-audit` | Shell-injection patterns, dependency CVEs, plaintext secrets at rest, loader-hijack env vars |
| **Runtime gates** (3-gate pattern) | `ruflo-aidefence` ADR-0001 | PII pre-storage gate, sanitization gate, prompt-injection gate |
The two layers are complementary: static analysis finds the patterns; the 3-gate runtime catches what slipped through.
## Namespace coordination
This plugin owns the `security-findings` AgentDB namespace (kebab-case, follows the convention from [ruflo-agentdb ADR-0001 §"Namespace convention"](../ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md)). Reserved namespaces (`pattern`, `claude-memories`, `default`) MUST NOT be shadowed.
`security-findings` indexes scan results by file + commit + severity. Accessed via `memory_*` (namespace-routed).
## Verification
```bash
bash plugins/ruflo-security-audit/scripts/smoke.sh
# Expected: "10 passed, 0 failed"
```
## Architecture Decisions
- [`ADR-0001` — ruflo-security-audit plugin contract (AIDefence integration, audit_1776853149979 pattern catalog as regression-prevention contract)](./docs/adrs/0001-security-audit-contract.md)