UNPKG

@seckav/security-sdk

Version:

SecKav Security SDK - Enterprise-grade security platform with AI-powered threat detection, LLM-powered misconfiguration scanning (Gemini/GPT-4/Claude), end-to-end encryption, behavioral analysis, enhanced file scanning, adaptive rate limiting, GDPR/DPDP/C

248 lines 6.79 kB
import { SecKavConfig } from '../types/common'; export interface SecurityIssue { id: string; severity: 'critical' | 'high' | 'medium' | 'low' | 'info'; category: 'authentication' | 'authorization' | 'encryption' | 'validation' | 'configuration' | 'exposure'; title: string; description: string; impact: string; location: { file?: string; path?: string; line?: number; endpoint?: string; }; remediation: { suggestion: string; autoFix?: string; codeExample?: string; priority: number; }; references: string[]; cwe?: string; owasp?: string; } export interface ScanResult { scanId: string; timestamp: string; duration: number; summary: { totalIssues: number; critical: number; high: number; medium: number; low: number; info: number; }; securityScore: number; issues: SecurityIssue[]; compliance: { owasp: number; pci: number; gdpr: number; hipaa: number; }; aiInsights: { summary: string; recommendations: string[]; threatModel: string; riskAssessment: string; }; } export interface LLMProvider { name: 'openai' | 'claude' | 'gemini' | 'local'; apiKey?: string; model: string; baseUrl?: string; } export interface SecurityRecommendations { recommendations: string[]; threatModel: string; implementationPlan: { immediate: string[]; shortTerm: string[]; longTerm: string[]; }; estimatedEffort: { immediate: string; shortTerm: string; longTerm: string; }; } export interface ScannerResult { success: boolean; data?: any; error?: string; message?: string; } export declare class MisconfigurationScannerModule { private config; constructor(config: SecKavConfig); /** * Scan OpenAPI/Swagger specification for security issues */ scanOpenAPISpec(specContent: string, filename: string): Promise<ScanResult>; /** * Legacy method for backward compatibility */ scanOpenAPISpecWithToken(token: string, specContent: string, filename: string): Promise<ScannerResult>; /** * Upload and scan configuration files */ uploadAndScanFiles(files: Array<{ filename: string; content: string; type: string; }>): Promise<ScanResult>; /** * Legacy method for backward compatibility */ uploadAndScanFilesWithToken(token: string, files: Array<{ name: string; content: string | Buffer; }>): Promise<ScannerResult>; /** * Get AI-powered security recommendations */ getSecurityRecommendations(context: { apiSpecs?: string[]; configFiles?: string[]; currentIssues?: SecurityIssue[]; organizationType?: string; complianceRequirements?: string[]; }): Promise<SecurityRecommendations>; /** * Legacy method for backward compatibility */ getSecurityRecommendationsWithToken(token: string, context: { apiSpecs?: string[]; configFiles?: string[]; currentIssues?: SecurityIssue[]; organizationType?: string; complianceRequirements?: string[]; }): Promise<ScannerResult>; /** * Configure LLM provider (modern method) */ configureLLM(provider: { provider: string; apiKey: string; model: string; }): Promise<{ success: boolean; message: string; data?: any; }>; /** * Test LLM integration (modern method) */ testLLMIntegration(options?: { prompt?: string; }): Promise<{ response: string; success: boolean; }>; /** * Get scan history (modern method) */ getScanHistory(options?: { page?: number; limit?: number; type?: string; }): Promise<{ scans: ScanResult[]; pagination: any; }>; /** * Generate security report (modern method) */ generateReport(options: { scanIds: string[]; format?: 'json' | 'html' | 'markdown'; includeRemediation?: boolean; }): Promise<any>; /** * Quick security assessment (modern method) */ quickAssessment(options: { apiSpecs?: string[]; configFiles?: string[]; includeRecommendations?: boolean; }): Promise<{ riskLevel: string; securityScore: number; topIssues: SecurityIssue[]; recommendations: string[]; }>; /** * Start monitoring (modern method) */ startMonitoring(options: { watchPaths: string[]; scanInterval: number; alertThreshold: string; }): Promise<{ monitorId: string; watchPaths: string[]; scanInterval: number; }>; /** * Configure LLM provider for enhanced scanning (legacy method) */ configureLLMProvider(token: string, provider: LLMProvider): Promise<ScannerResult>; /** * Test LLM integration (legacy method) */ testLLMIntegrationWithToken(token: string, testPrompt?: string): Promise<ScannerResult>; /** * Get scan history with pagination (legacy method) */ getScanHistoryWithToken(token: string, options?: { page?: number; limit?: number; type?: 'openapi' | 'config'; }): Promise<ScannerResult>; /** * Get specific scan result by ID */ getScanResult(token: string, scanId: string): Promise<ScannerResult>; /** * Generate comprehensive security report */ generateSecurityReport(token: string, options: { scanIds: string[]; format?: 'json' | 'html' | 'markdown'; includeRemediation?: boolean; }): Promise<ScannerResult>; /** * Quick security assessment - Combines multiple scans */ performQuickAssessment(token: string, assessment: { openApiSpecs?: Array<{ content: string; filename: string; }>; configFiles?: Array<{ name: string; content: string; }>; generateRecommendations?: boolean; }): Promise<ScannerResult>; /** * Scan from file paths (Node.js environments) */ scanFromFilePaths(token: string, filePaths: string[]): Promise<ScannerResult>; /** * Get scanner information and capabilities */ getInfo(): { name: string; version: string; capabilities: string[]; supportedFormats: string[]; llmProviders: string[]; apiUrl: string; }; } export default MisconfigurationScannerModule; //# sourceMappingURL=MisconfigurationScanner.d.ts.map