UNPKG

aimless-security

Version:

Enhanced Runtime Application Self-Protection (RASP) and API Fuzzing Engine with advanced threat detection, behavioral analysis, and intelligent response scoring for Node.js applications

93 lines 2.96 kB
import { RASPConfig, SecurityThreat } from '../types'; import { InjectionDetector } from './injection-detector'; import { XSSDetector } from './xss-detector'; import { CSRFDetector } from './csrf-detector'; import { AnomalyDetector } from './anomaly-detector'; import { AdvancedThreatDetector } from './advanced-detector'; import { Logger } from '../logger'; export declare class RASP { private config; private injectionDetector; private xssDetector; private csrfDetector; private anomalyDetector; private advancedDetector; private logger; constructor(config: RASPConfig | undefined, logger: Logger); analyze(request: { method: string; path: string; query?: any; body?: any; headers?: Record<string, string | string[] | undefined>; ip?: string; }): SecurityThreat[]; shouldBlock(threats: SecurityThreat[]): boolean; /** * Check if endpoint is allowed based on access control rules */ checkEndpointAccess(request: { method: string; path: string; headers?: Record<string, string | string[] | undefined>; }): { allowed: boolean; reason?: string; matchedRule?: any; }; /** * Check if endpoint has extra protection rules */ getProtectionRules(request: { method: string; path: string; }): import("../types").EndpointRule | null | undefined; /** * Match path against string or regex pattern */ private matchesPattern; generateCSRFToken(sessionId: string): string; sanitizeOutput(output: string): string; /** * Detect injections (SQL, NoSQL, Command, Path Traversal, etc.) */ detectInjections(input: any, context?: string): SecurityThreat[]; /** * Detect LDAP injection */ detectLDAPInjection(input: string): SecurityThreat | null; /** * Detect template injection (SSTI) */ detectTemplateInjection(input: string): SecurityThreat | null; /** * Validate file upload security */ validateFileUpload(filename: string, content?: string, mimeType?: string): SecurityThreat | null; /** * Analyze JWT token security */ analyzeJWT(token: string): SecurityThreat | null; /** * Detect GraphQL attacks */ detectGraphQLAttack(query: string): SecurityThreat | null; /** * Detect prototype pollution */ detectPrototypePollution(input: any): SecurityThreat | null; /** * Detect deserialization attacks */ detectDeserialization(input: string): SecurityThreat | null; /** * Get direct access to detectors for advanced use cases */ getInjectionDetector(): InjectionDetector; getXSSDetector(): XSSDetector; getCSRFDetector(): CSRFDetector; getAnomalyDetector(): AnomalyDetector; getAdvancedDetector(): AdvancedThreatDetector; private getHeader; } //# sourceMappingURL=index.d.ts.map