/** * SARIF (Static Analysis Results Interchange Format) 생성기 * * SARIF 2.1.0 스펙을 따르는 보안 스캔 결과를 생성합니다. * GitHub Code Scanning, Azure DevOps, VS Code 등에서 사용 가능합니다. * * @see https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html * @author zerry */ import { SecurityIssue } from '../types.js'; /** * SARIF 2.1.0 루트 객체 */ interface SARIFReport { version: '2.1.0'; $schema: string; runs: SARIFRun[]; } /** * SARIF Run */ interface SARIFRun { tool: { driver: { name: string; version: string; informationUri: string; rules: SARIFRule[]; }; }; results: SARIFResult[]; } /** * SARIF Rule */ interface SARIFRule { id: string; name: string; shortDescription: { text: string; }; fullDescription?: { text: string; }; help?: { text: string; markdown?: string; }; properties?: { tags?: string[]; precision?: 'very-high' | 'high' | 'medium' | 'low'; 'security-severity'?: string; }; } /** * SARIF Result */ interface SARIFResult { ruleId: string; level: 'error' | 'warning' | 'note'; message: { text: string; }; locations?: Array<{ physicalLocation: { artifactLocation: { uri: string; }; region?: { startLine: number; snippet?: { text: string; }; }; }; }>; fixes?: Array<{ description: { text: string; }; }>; } /** * SARIF 리포트 생성 */ export declare function generateSARIFReport(issues: SecurityIssue[], filePath?: string, toolVersion?: string): SARIFReport; /** * SARIF 리포트를 JSON 문자열로 변환 */ export declare function sarifToJSON(report: SARIFReport, pretty?: boolean): string; /** * 여러 파일의 스캔 결과를 하나의 SARIF 리포트로 통합 */ export declare function mergeSARIFReports(reports: SARIFReport[]): SARIFReport; /** * SARIF 리포트 통계 */ export interface SARIFStats { totalIssues: number; errorCount: number; warningCount: number; noteCount: number; filesScanned: number; rulesTriggered: number; } /** * SARIF 리포트 통계 계산 */ export declare function calculateSARIFStats(report: SARIFReport): SARIFStats; export {};