Repository navigation
feat(harness): MCP gate proxy with mode-aware enforcement (#555) - #558
Moon-Knight13 wants to merge 6 commits into
Conversation
…nd-trip (#555) Provider-agnostic harness index with platform-ops mode as validation target. Compiler reads harness/index.yaml and outputs Claude Code format. Validate subcommand confirms zero-diff round-trip. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
#555) Phase 1.1: Add glossary and offensive-base shared rules to harness/rules/. Phase 1.2: Convert all 12 remaining modes (3d-print, base, bounty, ctf, dev, green-dev, homelab, offensive-base, pentest, purple, red-dev, red-team) to harness/modes/<mode>/{prompt.md, tools.yaml, meta.yaml}. Add project-routes.yaml. Update index.yaml with all 13 modes, glossary reference, priority order, and harness targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Upgrade harness-compile.py from Phase 0 single-mode to Phase 1: - --mode all for both compile and validate subcommands - Absence validation: modes without tools.yaml must lack tool-policy.yaml - settings.override.json support for modes with non-standard settings - _offensive_base field for modes inheriting offensive-base - Summary output with pass/fail totals for --mode all - Pre-commit hook triggers on harness/ or .claude/modes/ changes All 13 modes validate successfully. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add harness enforcement layer to the SSE proxy. Mode-driven tool deny (glob patterns from harness/modes/<mode>/tools.yaml), secret scanning on arguments before forwarding, and JSONL audit trail at ~/.harness/audit/. - GET/POST /harness/mode endpoints for mode state management - Deny enforcement with fnmatch glob matching (prefix, suffix, exact) - Secret scanning: AWS keys, private keys, bearer tokens, GitHub/Slack tokens, generic secret assignments (patterns in secret-patterns.yaml) - Daily-rotated audit log with ISO timestamps, args hash, latency - Placeholder MCP server registry and profiles (harness/mcp/) - 1006 lines total (from 841), well under 1100 budget Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🤖 PR Review Bot: Review findings below. CI status: ALL PASS (8/8). Range check: CLEAN. Manual merge required. Findings
Overall: Well-structured MCP gate proxy with mode-aware tool denial, secret scanning, and audit logging. Two MEDIUM findings (unauthenticated mode switch, uncached deny patterns) worth addressing. No CRITICAL or HIGH. |
|
🤖 PR Review Bot: Review findings below. CI status: ✅ all pass. Range check: ✅ clean. Manual merge required. Risk: FEATURE | MCP gate proxy with mode-aware enforcement Findings
No CRITICAL findings. 2 HIGH, 2 MEDIUM, 1 LOW. |
|
🤖 PR Review Bot: UPDATED REVIEW — deeper analysis found more severe issues. Supersedes previous comment. Risk: FEATURE | MCP gate proxy with mode-aware enforcement Findings
Totals: 1 CRITICAL, 2 HIGH, 5 MEDIUM, 1 LOW. The CRITICAL and HIGHs are security-relevant — the proxy can be trivially bypassed. Recommend addressing items 1-3 before merge. |
|
🤖 PR Review Bot: Review findings below. CI status: all pass. Manual merge required. Range identifier check: ✅ Clean Findings
SummaryLarge PR adding MCP gate proxy with tool deny enforcement + secret scanning for 13 modes. Architecture is sound. Main concerns: unauthenticated mode-switch endpoint, redundant YAML parsing when module already has PyYAML, and per-call file I/O for deny patterns. |
- Platform-ops meta.yaml: update description to reflect full MCP access - Sync all 13 mode prompt.md, tools.yaml, settings.json, system-prompt.md, and tool-policy.yaml from main (#561 fixes) - Overhaul profiles.yaml: add range, research, offensive-dev profiles; expand offensive with all research MCPs - Fix mcp_profile assignments: green-dev→range, red-dev→offensive-dev, bounty→research, red-team→offensive, base+platform-ops→full - Validation: 13/13 modes pass harness-compile.py validate Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each mode gets its own named profile mapping to exactly the servers it needs. ctf drops tuoni/range-intel/bloodhound (external CTFs). bounty drops tuoni/range-intel/bloodhound/hashcat (web-focused). Validation: 13/13 modes pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🤖 PR Review Bot: Review findings below. CI status: ✅ all pass. Manual merge required. Findings
Range identifier check: ✅ Clean |
|
🤖 PR Review Bot: Updated review — critical findings from full analysis. CI status: ✅ all pass. Manual merge required. Findings
Range identifier check: ✅ Clean |
Summary
Extends
scripts/host/ollama-tool-proxy.pywith a harness enforcement layer — Epic #555 Phase 3 Story 6.~/.harness/active-modefile +GET/POST /harness/modeHTTP endpoints. Defaults tobaseif unset. Validates mode directory exists before accepting.call_tool, checksharness/modes/<mode>/tools.yamldeny patterns. Supports exact match, glob suffix (mcp__local-ollama__*), and glob prefix (*__tuoni_listener_delete) viafnmatch.scripts/host/secret-patterns.yamlbefore forwarding. Detects AWS keys, private key headers, bearer tokens, GitHub/Slack tokens, and generic secret assignments.~/.harness/audit/tool-calls-YYYY-MM-DD.jsonlwith ISO timestamps, mode, action (allow/deny/secret_blocked), latency for allowed calls, and SHA256 args hash for correlation.harness/mcp/servers.yamlandharness/mcp/profiles.yamlfor Story 7 integration.Usage
What's next
Story 7 (integration) will: rename proxy, wire mode switching to harness hooks, implement profile-driven MCP server reconnection, and update
.mcp.json.Test plan
🤖 Generated with Claude Code