/** * @fileoverview Infrastructure as Code (IaC) Checker * @module @nahisaho/musubix-security/analyzers/iac/iac-checker * @trace DES-SEC2-IAC-001, REQ-SEC2-IAC-001 */ import type { Vulnerability, Severity, SourceLocation } from '../../types/vulnerability.js'; /** * IaC file type */ export type IaCType = 'terraform' | 'cloudformation' | 'kubernetes' | 'docker-compose' | 'helm' | 'ansible'; /** * IaC issue */ export interface IaCIssue { id: string; ruleId: string; severity: Severity; title: string; description: string; location: SourceLocation; remediation: string; references?: string[]; cwes?: string[]; } /** * IaC analysis result */ export interface IaCAnalysisResult { filePath: string; fileType: IaCType; issues: IaCIssue[]; resources: IaCResource[]; analysisTime: number; } /** * IaC resource */ export interface IaCResource { type: string; name: string; location: SourceLocation; properties: Record; } /** * IaC check options */ export interface IaCCheckOptions { /** File types to analyze */ fileTypes?: IaCType[]; /** Minimum severity to report */ minSeverity?: Severity; /** Custom rules */ customRules?: IaCRule[]; /** Skip specific rules */ skipRules?: string[]; } /** * IaC rule definition */ export interface IaCRule { id: string; name: string; description: string; severity: Severity; fileTypes: IaCType[]; check: (content: string, filePath: string) => IaCRuleMatch[]; remediation: string; cwes?: string[]; references?: string[]; } /** * IaC rule match */ export interface IaCRuleMatch { line: number; column?: number; endLine?: number; endColumn?: number; matchedText?: string; context?: string; } /** * IaC Checker implementation * @trace DES-SEC2-IAC-001 */ export declare class IaCChecker { private options; private rules; constructor(options?: IaCCheckOptions); /** * Analyze IaC files in a directory * @trace REQ-SEC2-IAC-001 */ analyze(dirPath: string, options?: IaCCheckOptions): Promise; /** * Analyze a single IaC file */ analyzeFile(filePath: string, fileType: IaCType, options?: IaCCheckOptions): Promise; /** * Convert IaC issues to standard vulnerability format */ toVulnerabilities(results: IaCAnalysisResult[]): Vulnerability[]; /** * Find IaC files in a directory */ private findIaCFiles; /** * Detect IaC file type */ private detectFileType; /** * Extract resources from IaC content */ private extractResources; /** * Get numeric severity level */ private getSeverityLevel; } /** * Create IaC checker instance */ export declare function createIaCChecker(options?: IaCCheckOptions): IaCChecker; //# sourceMappingURL=iac-checker.d.ts.map