/** * Exporter Types * * Defines types for exporting findings to various security tool formats. * * @module exporters/types */ import type { Certification, Severity } from "../certification/types.js"; /** * Supported export formats */ export type ExportFormat = "sarif" | "sonarqube" | "snyk" | "checkmarx"; /** * Export options */ export interface ExportOptions { /** Output file path */ outputPath?: string; /** Include resolved/fixed findings */ includeResolved?: boolean; /** Minimum severity to include */ minSeverity?: Severity; /** Project root path for relative file paths */ projectRoot?: string; /** Additional metadata */ metadata?: Record; } /** * Export result */ export interface ExportResult { format: ExportFormat; outputPath?: string; findingsExported: number; content: string; } /** * Exporter interface */ export interface Exporter { format: ExportFormat; export(certification: Certification, options?: ExportOptions): Promise; } /** * SonarQube Generic Issue Import Format * https://docs.sonarqube.org/latest/analyzing-source-code/importing-external-issues/generic-issue-import-format/ */ export interface SonarQubeReport { issues: SonarQubeIssue[]; } export interface SonarQubeIssue { /** Engine ID (e.g., "vaspera") */ engineId: string; /** Rule ID */ ruleId: string; /** Primary location */ primaryLocation: { message: string; filePath: string; textRange?: { startLine: number; endLine?: number; startColumn?: number; endColumn?: number; }; }; /** Issue type */ type: "BUG" | "VULNERABILITY" | "CODE_SMELL"; /** Severity */ severity: "BLOCKER" | "CRITICAL" | "MAJOR" | "MINOR" | "INFO"; /** Effort to fix (in minutes) */ effortMinutes?: number; /** Secondary locations */ secondaryLocations?: Array<{ message: string; filePath: string; textRange?: { startLine: number; endLine?: number; }; }>; } /** * Snyk JSON Output Format * https://docs.snyk.io/snyk-cli/commands/test */ export interface SnykReport { ok: boolean; vulnerabilities: SnykVulnerability[]; dependencyCount: number; org: string; policy: string; isPrivate: boolean; licensesPolicy: Record; packageManager: string; projectName: string; summary: string; filesystemPolicy: boolean; filtered?: { ignore: unknown[]; patch: unknown[]; }; } export interface SnykVulnerability { /** Vulnerability ID */ id: string; /** Title */ title: string; /** Description */ description: string; /** Severity */ severity: "critical" | "high" | "medium" | "low"; /** CVSS score */ cvssScore?: number; /** CVE IDs */ identifiers?: { CVE?: string[]; CWE?: string[]; }; /** Affected package */ packageName?: string; /** Affected version */ version?: string; /** Fixed in version */ fixedIn?: string[]; /** File paths */ from?: string[]; /** Upgrade path */ upgradePath?: string[]; /** Exploit maturity */ exploit?: string; /** Is patchable */ isPatchable?: boolean; /** Is upgradeable */ isUpgradable?: boolean; /** Publication time */ publicationTime?: string; /** Disclosure time */ disclosureTime?: string; /** SEMVER vulnerable */ semver?: { vulnerable: string[]; }; } /** * Checkmarx XML Report Format (simplified) * Based on Checkmarx CxSAST report structure */ export interface CheckmarxReport { projectName: string; projectId: string; scanId: string; scanDate: string; scanStatus: string; resultsCount: number; results: CheckmarxResult[]; } export interface CheckmarxResult { /** Query ID */ queryId: string; /** Query name */ queryName: string; /** Query group (category) */ queryGroup: string; /** CWE ID */ cweId?: string; /** Severity */ severity: "High" | "Medium" | "Low" | "Information"; /** Result state */ state: "To Verify" | "Not Exploitable" | "Confirmed" | "Urgent"; /** Source file */ sourceFile: string; /** Source line */ sourceLine: number; /** Source object */ sourceObject: string; /** Destination file */ destFile?: string; /** Destination line */ destLine?: number; /** Destination object */ destObject?: string; /** Result hash */ resultHash: string; /** Detection date */ detectionDate: string; /** Comment */ comment?: string; } //# sourceMappingURL=types.d.ts.map