/** * Agentic QE v3 - Semgrep Integration * * REAL IMPLEMENTATION that integrates with Semgrep SAST scanner. * Semgrep is an open-source static analysis tool that finds bugs and enforces code standards. * * This module shells out to semgrep when available, with graceful fallback * to pattern-based scanning when semgrep is not installed. * * @module security-compliance/semgrep-integration */ export interface SemgrepFinding { check_id: string; path: string; start: { line: number; col: number; }; end: { line: number; col: number; }; extra: { message: string; severity: 'ERROR' | 'WARNING' | 'INFO'; lines: string; metadata?: { cwe?: string[]; owasp?: string[]; category?: string; description?: string; fix?: string; references?: string[]; confidence?: string; }; }; } export interface SemgrepResult { success: boolean; findings: SemgrepFinding[]; errors: string[]; version?: string; } export interface SemgrepConfig { /** Target directory to scan */ target: string; /** Semgrep config (default: 'auto') */ config: string; /** Patterns to exclude */ exclude: string[]; /** Maximum file size to scan (bytes) */ maxFileSize?: number; /** Timeout in seconds */ timeout?: number; /** Include verbose output */ verbose?: boolean; } /** * Check if semgrep is installed and available */ export declare function isSemgrepAvailable(): Promise; /** * Get semgrep version if available */ export declare function getSemgrepVersion(): Promise; /** * Run semgrep scan on target directory */ export declare function runSemgrep(config: Partial): Promise; /** * Run semgrep with specific rule sets */ export declare function runSemgrepWithRules(target: string, rules: string[], options?: Partial): Promise; /** * Map semgrep severity to standard severity */ export declare function mapSemgrepSeverity(severity: 'ERROR' | 'WARNING' | 'INFO'): 'critical' | 'high' | 'medium' | 'low'; /** * Convert semgrep findings to a generic format */ export declare function convertSemgrepFindings(findings: SemgrepFinding[]): Array<{ id: string; title: string; description: string; severity: 'critical' | 'high' | 'medium' | 'low'; file: string; line: number; column: number; snippet: string; cweId?: string; owaspCategory?: string; remediation: string; references: string[]; }>; //# sourceMappingURL=semgrep-integration.d.ts.map