vaspera 2.9.0 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#30](https://github.com/RCOLKITT/hardening-mcp/pull/30) [`8110af7`](https://github.com/RCOLKITT/hardening-mcp/commit/8110af76da720332e43f296b7357987e7edec533) Thanks [@RCOLKITT](https://github.com/RCOLKITT)! - ## Telemetry Integration
8
+
9
+ - Wired up telemetry tracking to certification tools (`certification_scan`, `agent_cert_scan`, `certification_finalize`)
10
+ - Added scan registry for persistent analytics storage
11
+ - Telemetry is opt-in via `VASPERA_TELEMETRY_ENABLED` environment variable
12
+ - Privacy-respecting: repo URL, org name, and email require explicit opt-in
13
+ - Backend API endpoint for receiving telemetry events with rate limiting
14
+
3
15
  All notable changes to this project will be documented in this file.
4
16
 
5
17
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -12,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
24
  #### Optimization Plan Modules
13
25
 
14
26
  ##### Corpus Expansion (P0)
27
+
15
28
  - 7 new payload categories bringing total from 220 to 430+ payloads
16
29
  - `multi-turn.json` - 30 payloads for context-building attacks across turns
17
30
  - `context-manipulation.json` - 30 payloads for conversation history attacks
@@ -23,18 +36,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
36
  - Updated corpus sizes: quick=100, standard=400, thorough=800, exhaustive=1500
24
37
 
25
38
  ##### Usage Telemetry (P0)
39
+
26
40
  - `src/telemetry/usage.ts` - Event tracking with privacy controls
27
41
  - `src/telemetry/registry.ts` - Persistent scan registry for analytics
28
42
  - Opt-in telemetry for repo URL, org name, user email
29
43
  - Analytics methods for dashboard and case study candidates
30
44
 
31
45
  ##### Badge Service (P0)
46
+
32
47
  - `src/badge-service/index.ts` - HTTP handlers for badge serving
33
48
  - Badge verification endpoint with Sigstore bundle support
34
49
  - `generateBadgeEmbedCode()` for markdown/HTML embedding
35
50
  - CertificationStorage interface with memory implementation
36
51
 
37
52
  ##### Frontier Model Interface (P1)
53
+
38
54
  - `src/frontier/types.ts` - Interfaces for Mythos/GPT-5.5-Cyber integration
39
55
  - `src/frontier/orchestrator.ts` - Multi-model orchestration with consensus
40
56
  - `src/frontier/providers/stub.ts` - Test provider placeholder
@@ -42,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
42
58
  - ExploitChain and ConsensusResult types
43
59
 
44
60
  ##### Data Flow Analysis (P1)
61
+
45
62
  - `src/analysis/data-flow.ts` - Source→sink tracking for JS/TS/Python
46
63
  - Pattern-based detection of user input sources (req.body, event.body, etc.)
47
64
  - Dangerous sink detection (SQL, command exec, eval, file write)
@@ -49,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
49
66
  - LLM context formatting for focused analysis
50
67
 
51
68
  ##### Agent Chain Analysis (P2)
69
+
52
70
  - `src/scanners/agent/agent-chain-analysis.ts` - Multi-hop attack paths
53
71
  - Trust boundary modeling between agents and MCP servers
54
72
  - AgentGraph construction from MCP server configs
@@ -56,6 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
56
74
  - Mermaid diagram generation for visualization
57
75
 
58
76
  ### Changed
77
+
59
78
  - Extended PayloadCategory type with 7 new categories
60
79
  - Updated FuzzerOptions corpus type to include "exhaustive"
61
80
  - Increased test count from 2,332 to 2,484 across 104 test files
@@ -65,6 +84,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
65
84
  ### Added
66
85
 
67
86
  #### Agent Batch Submit Tool
87
+
68
88
  - New `agent_batch_submit` tool for submitting findings from subagent JSON output
69
89
  - Solves MCP permission issues when certification agents run as subagents
70
90
  - Accepts array of findings and optional summary in one call
@@ -73,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
73
93
  ### Fixed
74
94
 
75
95
  #### CI/CD Improvements
96
+
76
97
  - Lazy Stripe initialization to allow builds without `STRIPE_SECRET_KEY`
77
98
  - Fixed TypeScript test timeout for CI environments
78
99
  - Synced package-lock.json for CI compatibility
@@ -82,6 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
82
103
  ### Added
83
104
 
84
105
  #### Plan Enforcement
106
+
85
107
  - New plan-limits system for free/pro/enterprise tiers
86
108
  - Certification monthly limits enforced at API level
87
109
  - Agent count limits based on subscription plan
@@ -90,19 +112,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
90
112
 
91
113
  #### Plan Limits
92
114
 
93
- | Limit | Free | Pro | Enterprise |
94
- |-------|------|-----|------------|
95
- | Certifications/month | 3 | 50 | Unlimited |
96
- | Projects | 2 | 20 | Unlimited |
97
- | Agents | 3 | 7 | All |
98
- | Frameworks | SOC2 | SOC2, HIPAA, NIST | All |
99
- | Red team | ❌ | ❌ | ✓ |
115
+ | Limit | Free | Pro | Enterprise |
116
+ | -------------------- | ---- | ----------------- | ---------- |
117
+ | Certifications/month | 3 | 50 | Unlimited |
118
+ | Projects | 2 | 20 | Unlimited |
119
+ | Agents | 3 | 7 | All |
120
+ | Frameworks | SOC2 | SOC2, HIPAA, NIST | All |
121
+ | Red team | ❌ | ❌ | ✓ |
100
122
 
101
123
  ## [2.6.0] - 2026-04-26
102
124
 
103
125
  ### Added
104
126
 
105
127
  #### Test Coverage
128
+
106
129
  - 147 new tests across 5 test files
107
130
  - `agent-integrity.test.ts` - Consensus analysis and outlier detection
108
131
  - `agent-privacy.test.ts` - PII detection with Luhn validation
@@ -111,12 +134,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
111
134
  - `flags.test.ts` - Feature flags and config loading
112
135
 
113
136
  #### Feature Flags System
137
+
114
138
  - New `.vaspera/config.yaml` configuration format
115
139
  - Per-agent weights and model selection
116
140
  - Per-scanner timeouts and custom rules
117
141
  - Feature toggles for multiModel, costTracking, autofix, etc.
118
142
 
119
143
  #### Plugin System
144
+
120
145
  - Scanner plugin architecture with manifest schema
121
146
  - Local plugins from `.vaspera/plugins/`
122
147
  - npm plugins from `vaspera-scanner-*` packages
@@ -127,6 +152,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
127
152
  ### Added
128
153
 
129
154
  #### Mythos-Class Security Scanners
155
+
130
156
  - New `binary-analysis` scanner for native module security
131
157
  - Detects Node.js native addons, shared libraries, Rust FFI, Go CGO
132
158
  - Checks RELRO, NX, PIE, CANARY protections via checksec
@@ -144,6 +170,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
144
170
  - Java: check-then-act and synchronized patterns
145
171
 
146
172
  #### Semantic AI Agents
173
+
147
174
  - New `zero-day-hunter` agent for novel vulnerability discovery
148
175
  - AI-powered semantic code analysis beyond pattern matching
149
176
  - Discovers logic flaws, auth bypasses, cryptographic weaknesses
@@ -160,17 +187,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
160
187
  - Severity escalation calculation (medium + medium = critical)
161
188
 
162
189
  #### New MCP Tools
190
+
163
191
  - `certification_scan_binary` - Scan compiled code and native modules
164
192
  - `certification_analyze_chains` - Analyze findings for exploitable chains
165
193
  - `certification_semantic_analysis` - Run AI-powered semantic analysis
166
194
 
167
195
  #### Compliance Enhancements
196
+
168
197
  - Added MITRE ATT&CK technique mapping for AI/ML systems
169
198
  - New CWE mappings for memory safety vulnerabilities
170
199
  - New CWE mappings for race condition vulnerabilities
171
200
  - OWASP LLM Top 10 integration
172
201
 
173
202
  ### Changed
203
+
174
204
  - Updated scanner count from 9 to 13+ scanners
175
205
  - Updated agent count from 4 to 7+ agents
176
206
  - Updated frontend marketing pages with Mythos-class capabilities
@@ -181,6 +211,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
181
211
  ### Added
182
212
 
183
213
  #### Cost Tracking
214
+
184
215
  - New `cost_track` tool to start tracking costs for a certification
185
216
  - New `cost_estimate` tool to estimate costs before running
186
217
  - New `cost_status` tool to get current cost status
@@ -191,6 +222,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
191
222
  - Budget limits with automatic warnings and abort capability
192
223
 
193
224
  #### Multi-Model Consensus
225
+
194
226
  - New `multimodel_record` tool to record findings from model runs
195
227
  - New `multimodel_consensus` tool to calculate inter-model agreement
196
228
  - New `multimodel_disagreements` tool to identify model disagreements
@@ -203,6 +235,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
203
235
  - Disagreement detection by type (existence, severity, location, description)
204
236
 
205
237
  #### Compliance Mapping
238
+
206
239
  - New `compliance_report` tool for single-framework reports
207
240
  - New `compliance_multi_report` tool for multi-framework reports
208
241
  - New `compliance_controls` tool to list framework controls
@@ -212,6 +245,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
212
245
  - Finding-to-control mapping by category
213
246
 
214
247
  #### SBOM & Provenance
248
+
215
249
  - New `sbom_generate` tool for CycloneDX SBOM generation
216
250
  - New `sbom_provenance` tool for SLSA provenance attestation
217
251
  - New `sbom_sign` tool for Sigstore signing
@@ -220,6 +254,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
220
254
  - Build attestation with SLSA Level 2 support
221
255
 
222
256
  #### Documentation
257
+
223
258
  - New `docs/` folder with feature documentation
224
259
  - Cost tracking guide (`docs/cost-tracking.md`)
225
260
  - Multi-model consensus guide (`docs/multi-model.md`)
@@ -228,11 +263,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
228
263
  - Example workflows (`docs/examples/`)
229
264
 
230
265
  ### Changed
266
+
231
267
  - Updated MCP tool count from 36 to 52
232
268
  - Updated package description to highlight enterprise features
233
269
  - README now includes v2.0.0 features section
234
270
 
235
271
  ### Fixed
272
+
236
273
  - Finding type now uses `description` consistently (removed legacy `title`)
237
274
  - Multi-model consensus correctly handles partial model agreement
238
275
  - Cost calculation uses accurate per-model pricing
@@ -242,58 +279,68 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
242
279
  ### Added
243
280
 
244
281
  #### Deterministic Scanners
282
+
245
283
  - Semgrep integration for OWASP Top 10
246
284
  - gitleaks integration for secrets detection
247
285
  - npm audit integration for CVE detection
248
286
  - TypeScript analysis for type safety
249
287
 
250
288
  #### GitHub Action
289
+
251
290
  - `action.yml` for CI/CD integration
252
291
  - Diff-mode scanning for PRs
253
292
  - PR comment formatting
254
293
  - SARIF upload to GitHub Code Scanning
255
294
 
256
295
  #### Evaluation Harness
296
+
257
297
  - Test fixtures for scanner accuracy
258
298
  - Precision, recall, F1 metrics
259
299
  - Stability testing across runs
260
300
  - Target thresholds for publication
261
301
 
262
302
  #### Custom Rules
303
+
263
304
  - `rules_load` for custom rule loading
264
305
  - `rules_templates` for built-in templates
265
306
  - `rules_generate_config` for config generation
266
307
  - `rules_check_file` for file checking
267
308
 
268
309
  ### Changed
310
+
269
311
  - Scanner findings now have confidence: 100
270
312
  - LLM agents reference scanner findings by ID
271
313
 
272
314
  ## [1.0.2] - 2023-12-15
273
315
 
274
316
  ### Added
317
+
275
318
  - Cross-verification system between agents
276
319
  - Consensus scoring with certification levels
277
320
  - SARIF export for GitHub integration
278
321
 
279
322
  ### Fixed
323
+
280
324
  - Evidence validation for LLM findings
281
325
  - Finding deduplication logic
282
326
 
283
327
  ## [1.0.1] - 2023-12-01
284
328
 
285
329
  ### Added
330
+
286
331
  - File hash-based caching
287
332
  - Agent finding submission tools
288
333
  - Basic certification workflow
289
334
 
290
335
  ### Fixed
336
+
291
337
  - Project discovery on macOS
292
338
  - Command installation paths
293
339
 
294
340
  ## [1.0.0] - 2023-11-15
295
341
 
296
342
  ### Added
343
+
297
344
  - Initial release
298
345
  - 6 certification agents (security, reliability, typesafety, performance, quality, redteam)
299
346
  - Hardening command installation
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwPpE;;GAEG;AACH,iBAAS,YAAY,CAAC,IAAI,EAAE,MAAM;;;;;EAIjC;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;;;;;;EAK/D;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,OAAO,EAAE,MAAM;;;;;EAIrC;AA+CD,QAAA,MAAM,MAAM,WAGV,CAAC;AAghKH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiQpE;;GAEG;AACH,iBAAS,YAAY,CAAC,IAAI,EAAE,MAAM;;;;;EAIjC;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;;;;;;EAK/D;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,OAAO,EAAE,MAAM;;;;;EAIrC;AA+CD,QAAA,MAAM,MAAM,WAGV,CAAC;AAkoKH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -46,6 +46,9 @@ import { getTracker, formatCost, formatTokens, estimateCost, getSupportedModels,
46
46
  import { getRunner, DEFAULT_MODELS, formatProvider, } from "./multimodel/index.js";
47
47
  // Path validation utilities
48
48
  import { validateProjectPath, PathValidationError } from "./util/paths.js";
49
+ // Telemetry and scan registry
50
+ import { trackCertificationStarted, trackCertificationCompleted, trackScannerRun, } from "./telemetry/usage.js";
51
+ import { getRegistry } from "./telemetry/registry.js";
49
52
  // ---------------------------------------------------------------------------
50
53
  // Config
51
54
  // ---------------------------------------------------------------------------
@@ -755,6 +758,12 @@ server.registerTool("certification_scan", {
755
758
  project: basename(project_path),
756
759
  });
757
760
  scanLogger.info("scanners.starting", { scanners, auto_detect });
761
+ const startTime = Date.now();
762
+ // Track scan start via telemetry
763
+ const scannersToRun = auto_detect
764
+ ? ["auto-detect"]
765
+ : Object.entries(scanners || {}).filter(([, v]) => v).map(([k]) => k);
766
+ await trackCertificationStarted(project_path, scannersToRun, [], auto_detect ? "auto" : "manual");
758
767
  // Use auto-detection or manual scanner selection
759
768
  let result;
760
769
  let detectedLanguages;
@@ -768,6 +777,24 @@ server.registerTool("certification_scan", {
768
777
  else {
769
778
  result = await runAllScanners(project_path, scanners);
770
779
  }
780
+ // Track scanner runs in telemetry
781
+ for (const scanner of Object.keys(result.byScanner)) {
782
+ await trackScannerRun(project_path, scanner, result.totalDuration / Object.keys(result.byScanner).length, // Approximate per-scanner duration
783
+ result.byScanner[scanner] || 0, !result.failedScanners.includes(scanner));
784
+ }
785
+ // Record scan in registry for analytics
786
+ const registry = getRegistry();
787
+ await registry.recordScan({
788
+ certificationId: certification_id,
789
+ projectPath: project_path,
790
+ scanDate: new Date().toISOString(),
791
+ duration: Date.now() - startTime,
792
+ findingsSummary: result.bySeverity,
793
+ totalFindings: result.totalFindings,
794
+ scannersRun: Object.keys(result.byScanner),
795
+ frameworksAssessed: [],
796
+ success: result.allSucceeded,
797
+ });
771
798
  // If certification_id provided and submit_findings is true, submit to certification
772
799
  if (certification_id && submit_findings && result.totalFindings > 0) {
773
800
  const certFindings = scannerFindingsToCertificationFindings(result);
@@ -1579,6 +1606,7 @@ server.registerTool("certification_finalize", {
1579
1606
  },
1580
1607
  }, async ({ project_path, certification_id }) => {
1581
1608
  const certLogger = createChildLogger({ certId: certification_id, project: basename(project_path) });
1609
+ const startTime = Date.now();
1582
1610
  const certification = await getCertification(project_path, certification_id);
1583
1611
  if (!certification) {
1584
1612
  certLogger.warn("certification.not_found");
@@ -1604,6 +1632,36 @@ server.registerTool("certification_finalize", {
1604
1632
  }
1605
1633
  // Generate artifacts
1606
1634
  const artifacts = await writeCertificationArtifacts(project_path, finalCert);
1635
+ // Track certification completion via telemetry
1636
+ const severityCounts = { critical: 0, high: 0, medium: 0, low: 0, info: 0 };
1637
+ let totalFindings = 0;
1638
+ for (const agentType of Object.keys(certification.agents || {})) {
1639
+ const agent = certification.agents[agentType];
1640
+ if (agent?.findings) {
1641
+ for (const finding of agent.findings) {
1642
+ severityCounts[finding.severity]++;
1643
+ totalFindings++;
1644
+ }
1645
+ }
1646
+ }
1647
+ await trackCertificationCompleted(project_path, certification_id, finalCert.consensus?.certification_level || "BLOCKED", finalCert.consensus?.overall_score || 0, Date.now() - new Date(certification.metadata.started_at).getTime(), severityCounts, totalFindings, [] // frameworks
1648
+ );
1649
+ // Record in registry
1650
+ const registry = getRegistry();
1651
+ await registry.recordScan({
1652
+ certificationId: certification_id,
1653
+ projectPath: project_path,
1654
+ scanDate: new Date().toISOString(),
1655
+ level: finalCert.consensus?.certification_level || "BLOCKED",
1656
+ score: finalCert.consensus?.overall_score || 0,
1657
+ duration: Date.now() - startTime,
1658
+ findingsSummary: severityCounts,
1659
+ totalFindings,
1660
+ scannersRun: Object.keys(certification.agents || {}),
1661
+ frameworksAssessed: [],
1662
+ success: true,
1663
+ tags: ["certification-finalized"],
1664
+ });
1607
1665
  certLogger.info("certification.finalized", {
1608
1666
  level: finalCert.consensus?.certification_level,
1609
1667
  score: finalCert.consensus?.overall_score,
@@ -3625,7 +3683,11 @@ Maps findings to AI compliance frameworks (OWASP LLM, NIST AI RMF, EU AI Act).`,
3625
3683
  if (!authorized) {
3626
3684
  return errorResponse("Agent scanning requires explicit authorization. Set authorized=true to confirm you have permission to scan this target.");
3627
3685
  }
3686
+ const startTime = Date.now();
3628
3687
  try {
3688
+ // Track scan start via telemetry
3689
+ const enabledScanners = scanners || AGENT_SCANNER_TYPES;
3690
+ await trackCertificationStarted(target, enabledScanners, frameworks || [], "agent-cert");
3629
3691
  // Build scan target
3630
3692
  const scanTarget = {};
3631
3693
  if (target.startsWith("http://") || target.startsWith("https://")) {
@@ -3641,7 +3703,6 @@ Maps findings to AI compliance frameworks (OWASP LLM, NIST AI RMF, EU AI Act).`,
3641
3703
  scanTarget.npmPackage = target;
3642
3704
  }
3643
3705
  // Build scanner options
3644
- const enabledScanners = scanners || AGENT_SCANNER_TYPES;
3645
3706
  const scannerFlags = {
3646
3707
  manifestAudit: enabledScanners.includes("manifest-audit"),
3647
3708
  toolDrift: enabledScanners.includes("tool-description-drift"),
@@ -3680,6 +3741,28 @@ Maps findings to AI compliance frameworks (OWASP LLM, NIST AI RMF, EU AI Act).`,
3680
3741
  }
3681
3742
  // Generate summary
3682
3743
  const summary = generateAgentScannerSummary(result);
3744
+ // Record scan in registry for analytics
3745
+ const registry = getRegistry();
3746
+ await registry.recordScan({
3747
+ certificationId: certification_id,
3748
+ projectPath: target,
3749
+ scanDate: new Date().toISOString(),
3750
+ level: result.certificationReadiness === "ready" ? "CERTIFIED"
3751
+ : result.certificationReadiness === "needs-review" ? "REVIEW_REQUIRED"
3752
+ : "BLOCKED",
3753
+ score: 100 - result.riskScore,
3754
+ duration: Date.now() - startTime,
3755
+ findingsSummary: result.bySeverity,
3756
+ totalFindings: result.totalFindings,
3757
+ scannersRun: result.scanners.map((s) => s.scanner),
3758
+ frameworksAssessed: frameworks || [],
3759
+ success: result.allSucceeded,
3760
+ tags: ["agent-cert", "mcp-security"],
3761
+ });
3762
+ // Track individual scanner runs
3763
+ for (const scanner of result.scanners) {
3764
+ await trackScannerRun(target, scanner.scanner, scanner.duration || 0, scanner.findings.length, scanner.success);
3765
+ }
3683
3766
  return jsonResponse({
3684
3767
  success: result.allSucceeded,
3685
3768
  target,