import { SecurityIssue } from '../entities/SecurityIssue'; import { CodeBlock } from '../entities/CodeBlock'; export interface SecurityScanOptions { readonly severity: ('low' | 'medium' | 'high' | 'critical')[]; readonly categories: ('injection' | 'authentication' | 'authorization' | 'cryptography' | 'data_exposure' | 'input_validation' | 'dependency' | 'configuration' | 'logging' | 'other')[]; readonly includePatterns?: string[]; readonly excludePatterns?: string[]; readonly maxIssues?: number; readonly includeDependencies?: boolean; } export interface DependencyVulnerability { readonly packageName: string; readonly version: string; readonly severity: 'low' | 'medium' | 'high' | 'critical'; readonly cve?: string; readonly description: string; readonly fixedVersion?: string; readonly references: string[]; } export interface SecurityScannerPort { /** * Scan code blocks for security issues */ scanCodeBlocks( codeBlocks: CodeBlock[], options: SecurityScanOptions ): Promise; /** * Scan a single code block for security issues */ scanCodeBlock( codeBlock: CodeBlock, options: SecurityScanOptions ): Promise; /** * Scan for dependency vulnerabilities */ scanDependencies( packageJsonPath: string, lockFilePath?: string ): Promise; /** * Scan for hardcoded secrets and credentials */ scanForSecrets(codeBlocks: CodeBlock[]): Promise; /** * Scan for insecure coding patterns */ scanForInsecurePatterns(codeBlocks: CodeBlock[]): Promise; /** * Validate security configuration */ validateSecurityConfig( configFiles: CodeBlock[] ): Promise; /** * Get security best practices for a language */ getSecurityBestPractices(language: string): Promise; /** * Check if a vulnerability pattern matches known CVEs */ checkCVE(pattern: string, language: string): Promise<{ readonly cveId?: string; readonly severity?: 'low' | 'medium' | 'high' | 'critical'; readonly description?: string; }>; }