/** * Security Scanner Service * * Scans for security vulnerabilities, secrets, and dependency issues */ import type { SecurityScanResult, SecurityScanOptions, DependencyCheckResult, DependencyCheckOptions, SecretDetectionResult, SecretDetectionOptions } from "../types/security.js"; /** * Service for security scanning and vulnerability detection. * * Scans code for security issues (OWASP Top 10), checks dependencies * for vulnerabilities, and detects hardcoded secrets or credentials. */ export declare class SecurityService { private projectRoot; /** Directories to exclude from scanning */ private static readonly EXCLUDE_DIRS; /** Security patterns for code scanning */ private securityPatterns; /** Secret patterns for detection */ private secretPatterns; constructor(projectRoot: string); /** * Initialize security and secret patterns */ private initializePatterns; /** * Scan files for security issues */ scanFiles(options?: SecurityScanOptions): Promise; /** * Check dependencies for vulnerabilities */ checkDependencies(options?: DependencyCheckOptions): Promise; /** * Detect secrets in files */ detectSecrets(options?: SecretDetectionOptions): Promise; /** * Scan a single file for security issues */ private scanFile; /** * Scan file for secrets */ private scanFileForSecrets; /** * Run npm audit */ private runNpmAudit; /** * Parse npm audit JSON result */ private parseNpmAuditResult; /** * Count outdated packages */ private countOutdatedPackages; /** * Get source files for scanning */ private getSourceFiles; /** * Walk directory recursively */ private walkDirectory; /** * Check if file should be scanned */ private isSourceFile; /** * Check if file should skip secret scanning */ private shouldSkipSecretScan; /** * Get line number from character index */ private getLineNumber; /** * Calculate Shannon entropy */ private calculateEntropy; /** * Find high entropy strings in a line */ private findHighEntropyStrings; /** * Redact secret for display */ private redactSecret; /** * Get severity for secret type */ private getSecretSeverity; /** * Map npm severity to our severity */ private mapNpmSeverity; /** * Convert severity to number for comparison */ private severityToNumber; /** * Filter issues by severity */ private filterBySeverity; /** * Filter secrets by confidence */ private filterByConfidence; /** * Count issues by severity */ private countBySeverity; /** * Count vulnerabilities by severity */ private countVulnBySeverity; /** * Count issues by category */ private countByCategory; /** * Count secrets by type */ private countBySecretType; /** * Calculate overall risk level */ private calculateRiskLevel; /** * Generate scan summary */ private generateScanSummary; /** * Generate dependency recommendations */ private generateDependencyRecommendations; /** * Generate secret detection suggestions */ private generateSecretSuggestions; } //# sourceMappingURL=security-service.d.ts.map