M7: CLI Parity, ConsolidatedSecurityAuditor Wiring & YAML Config Support¶
- Task ID:
M7 - Priority:
P0 - Status:
Done - Dependencies: None (
M1–M6completed) - Blocks:
M8,M9,M10 - Target Repository:
/Users/ivan/Project/3t.tools.intellij/verityredteam-free(verity-redteam-core) - GitHub Project #5: Verity RedTeam Free Task Board
1. Problem Statement & Context¶
A codebase-vs-documentation audit of verity-redteam-core revealed critical parity gaps between what the README/product promises for verity scan and what the CLI actually executes today:
verity scanbypassesConsolidatedSecurityAuditor:- In
src/verity/cli.py(_collect_config_findings, L155–L191;_cmd_scan, L281–L298),verity scan(both default 9-client discovery and--config-file) only callsMultiClientConfigScannerand passes{"name": config.server_name, **raw}toStaticRuleEvaluator.scan_tool(). - Meanwhile,
ConsolidatedSecurityAuditor(src/verity/discovery/auditor.py, L27–L163) already implements:- Plaintext secret detection in
config.env(SEC-STATIC-SECRET-IN-CONFIG,FindingSeverity.HIGH, redacted evidenceKEY=****), - Unsafe shell execution wrapper detection (
SEC-STATIC-UNSAFE-SHELL-WRAPPER,FindingSeverity.MEDIUMforsh/bash/zsh/cmd/powershell), - Hybrid tri-layer Passport fingerprinting (
HybridDiscoveryMatcher/mcp-fingerprints), and - Offline OSV CVE correlation (
VulnerabilityLookupEngine/mcp-vulnerabilities, e.g., catchingmcp-remote@0.1.15/CVE-2025-6514asVULN-<id>).
- Plaintext secret detection in
- Because
cli.pynever invokesConsolidatedSecurityAuditor, runningverity scanon a workstation config with leakedenvcredentials, rawbash -cwrappers, or known-vulnerable pinned npm/PyPI MCP packages reports 0 findings unless a tool schema itself happens to match a static rule. - YAML IDE configs silently fail:
MultiClientConfigScanner.get_standard_client_paths()(src/verity/discovery/config_scanner.py, L153, L162–L163) registers.continue/config.yamlandlibrechat.yaml, yetparse_config_file()(config_scanner.py, L199–L204) and_collect_config_findings()(cli.py, L169–L177) only calljson.loads(), silently returning[]or raisingInvalid JSONon YAML configs.- Stale CLI template in
ActiveExploitBridge: src/verity/discovery/active_bridge.py(L44) definesDEFAULT_CLI_COMMAND_TEMPLATE = "verity test --server '{package}' --vuln '{vuln_id}'", referencing--serverand--vulnflags that do not exist insrc/verity/cli.py(L506–L519).- SARIF plugin entry-point mismatch:
_load_sarif_exporter()(src/verity/cli.py, L46–L54) looks only for entry points named"sarif"or"sarif_export"in group"verity.plugins", whereas../verityredteam/pyproject.tomlregisters"pro"(verity_pro.plugin:register_pro_extensions).
Scope Decision (Confirmed): Fix these CLI parity bugs first (
M7) before executing ground-zero empty-container verification (M8), demo GIF recording (M9), and customer README restructuring (M10), so every customer claim is 100% real and reproducible.
2. Requirements & Target Files¶
2.1 Wire ConsolidatedSecurityAuditor into verity scan¶
- Files:
src/verity/cli.py(L155–L191, L233–L298, L488–L504),src/verity/discovery/auditor.py(L27–L175) - Requirements:
- Update
_collect_config_findings()(or add a clean helper called by_collect_scan_data()) to runConsolidatedSecurityAuditor.audit_server(config, live_probe=...)on every discoveredDiscoveredServerConfigin addition toStaticRuleEvaluator.scan_tool()schema checks. - Ensure
verity scancontinues to run fast (< 5s) and offline-safe by default (i.e., do not block or crash if network is unavailable or offline caches are empty; gracefully reuse cached/bundled data frommcp-fingerprints/mcp-vulnerabilities/data_fetcher.py). Optionally expose--live-probe/--offlineflags if needed without breaking existing defaultverity scanbehavior. - Strict Credential Scrubbing Guarantee: Plaintext secret values from
config.envMUST NEVER appear unmasked interminal,json,markdown, orhtmloutput — only redacted evidence (KEY=****) and ruleSEC-STATIC-SECRET-IN-CONFIG. - Normalize
SecurityAuditFindingrecords seamlessly into_normalize_finding()soSummaryseverity counts (CRITICAL,HIGH,MEDIUM,LOW,INFO),--fail-on-findingsexit code1,--format {terminal,json,markdown,html}, and--outputall work uniformly across config findings, static rule findings, OSV CVE findings, and--pathAST findings. - Ensure
verity scan --config-file <path>can matchmcp-remote@0.1.15(and similar versioned npm/PyPI server specs incommand/args) against offline OSV advisories frommcp-vulnerabilities/data_fetcher.py.
2.2 Support YAML Config Parsing for Continue & LibreChat¶
- Files:
src/verity/discovery/config_scanner.py(L151–L240),src/verity/cli.py(L165–L178),pyproject.toml(only if a lightweight dependency likePyYAMLis needed — note: evaluate whetherPyYAMLdependency is justified vs. minimal pure-Python subset, and document dependency choice clearly perAGENTS.md). - Requirements:
- Update
MultiClientConfigScanner.parse_config_file()and_collect_config_findings()to parse.yaml/.ymlfiles (.continue/config.yaml,librechat.yaml, or--config-file path/to/config.yaml) and extract declared MCP server configurations (mcpServers/mcp_servers/servers). - Handle malformed YAML gracefully (consistent with malformed JSON handling).
2.3 Fix ActiveExploitBridge CLI Command Template¶
- Files:
src/verity/discovery/active_bridge.py(L41–L91) - Requirements:
- Replace
DEFAULT_CLI_COMMAND_TEMPLATE = "verity test --server '{package}' --vuln '{vuln_id}'"with validverityCLI syntax (verity test --command ...orverity test --url .../ valid subcommand flags matchingbuild_parser()insrc/verity/cli.py). - Keep
ActiveExploitPlan.to_dict()schema compatible with callers in bothverityredteam-freeandverityredteam.
2.4 Align Pro SARIF Entry-Point Discovery (Zero Pro Coupling)¶
- Files:
src/verity/cli.py(L46–L54) - Requirements:
- Keep zero imports from
verity_proorverity_lite(AGENTS.mdhygiene rule). - Update
_load_sarif_exporter()so that when averity.pluginsentry point (sarif,sarif_export, orpro) is installed and exposes a SARIF exporter attribute/callable (or plugin hook),--format sarifresolves cleanly without failing with"verity-pro is installed but no SARIF exporter entry point is registered", while keeping exit code2+PRO_FEATURE_REQUIREDpayload when no Pro plugin is installed.
2.5 Unit Tests¶
- Files:
tests/unit/test_cli_and_reporting.py,tests/unit/test_static_config_scanner.py(or dedicatedtests/unit/test_cli_auditor_parity.py) - Requirements:
- Test
verity scan --config-filedetectsSEC-STATIC-SECRET-IN-CONFIG(HIGH) and asserts the raw secret value does not appear anywhere interminal,json,markdown, orhtmloutputs. - Test
verity scan --config-filedetectsSEC-STATIC-UNSAFE-SHELL-WRAPPER(MEDIUM) onbash -c .../sh -c .... - Test
verity scan --config-fileflags known OSV CVEs (e.g.,mcp-remote0.1.15->CVE-2025-6514) using mocked/cached OSV engine without requiring live internet access in unit tests. - Test
verity scan --config-fileandMultiClientConfigScanner.scan_all()parse.continue/config.yamlandlibrechat.yamland extract servers + secrets/shell wrappers. - Test
--fail-on-findingsreturns exit code1for config, schema, and AST findings, and0when clean.
3. Verification Commands¶
Run in verityredteam-free:
cd /Users/ivan/Project/3t.tools.intellij/verityredteam-free
uv sync --extra dev
uv run ruff check src tests
uv run pytest tests/ -q
Run Pro regression check in companion verityredteam (per AGENTS.md):
cd /Users/ivan/Project/3t.tools.intellij/verityredteam
uv run pytest tests/unit/test_unified_production_mcp_agent_tools.py -q
4. Acceptance Criteria¶
- [x]
verity scan(default workstation discovery and--config-file) invokesConsolidatedSecurityAuditorand reportsSEC-STATIC-SECRET-IN-CONFIG,SEC-STATIC-UNSAFE-SHELL-WRAPPER, static tool schema matches, and OSV CVE findings. - [x] Raw secret values from
config.envnever leak unredacted intoterminal,json,markdown, orhtmloutputs. - [x]
.continue/config.yamlandlibrechat.yamlare parsed accurately in bothMultiClientConfigScanner.parse_config_file()andverity scan --config-file. - [x]
ActiveExploitBridge.DEFAULT_CLI_COMMAND_TEMPLATEreferences only validverityCLI flags present insrc/verity/cli.py. - [x]
_load_sarif_exporter()cleanly handles bothsarif/sarif_exportandproentry points while returningPRO_FEATURE_REQUIRED(exit2) when Pro is absent. - [x] Zero Pro/proprietary imports (
verity_pro,verity_lite,snowflake_guard,customer_lab) exist inverityredteam-free. - [x]
uv run ruff check src testsanduv run pytest tests/ -qpass 100%, andverityredteamPro MCP agent tests pass with zero regressions.
5. Out of Scope¶
- Docker / empty-container verification suite (covered in
M8). - Animated GIF screencast recording (covered in
M9). - Rewriting
README.mdor adding doc-parity tests (covered inM10). - Adding Pro-only features (
SnowflakeSecurityGuard, live DB canary oracles, etc.) intoverityredteam-free.