/** * DAST Scanner Types * * Types for Dynamic Application Security Testing integrations * with OWASP ZAP and Nuclei. * * @module scanners/dast/types */ import type { Severity } from "../../certification/types.js"; /** * DAST scanner types */ export type DASTScanner = "zap" | "nuclei"; /** * Authentication types for DAST scans */ export type AuthType = "none" | "basic" | "bearer" | "cookie" | "oauth2" | "api-key"; /** * Target for DAST scanning */ export interface DASTTarget { /** Base URL to scan */ url: string; /** Optional name for the target */ name?: string; /** Authentication configuration */ authentication?: DASTAuthentication; /** Custom headers to include */ headers?: Record; /** URL patterns to include in scan scope */ scope?: string[]; /** URL patterns to exclude from scan */ exclude?: string[]; /** OpenAPI/Swagger spec URL for API scanning */ openApiUrl?: string; /** GraphQL endpoint for GraphQL scanning */ graphqlUrl?: string; } /** * Authentication configuration */ export interface DASTAuthentication { /** Authentication type */ type: AuthType; /** Credentials based on auth type */ credentials: { /** Username for basic auth */ username?: string; /** Password for basic auth */ password?: string; /** Bearer token */ token?: string; /** Cookie string */ cookie?: string; /** API key */ apiKey?: string; /** API key header name */ apiKeyHeader?: string; /** OAuth2 client ID */ clientId?: string; /** OAuth2 client secret */ clientSecret?: string; /** OAuth2 token URL */ tokenUrl?: string; }; } /** * Scan policy/configuration */ export interface DASTPolicy { /** Only run passive scans (no active attacks) */ passiveOnly?: boolean; /** Risk threshold to report */ riskThreshold?: "high" | "medium" | "low" | "informational"; /** Maximum scan duration in seconds */ maxDuration?: number; /** Specific Nuclei template paths or tags */ templates?: string[]; /** Nuclei template tags to include */ templateTags?: string[]; /** Nuclei template tags to exclude */ excludeTags?: string[]; /** ZAP scan policy name */ zapPolicy?: string; /** Enable AJAX spider for JavaScript-heavy apps */ ajaxSpider?: boolean; /** Maximum depth for spidering */ maxDepth?: number; /** Maximum children per node for spidering */ maxChildren?: number; /** Delay between requests in milliseconds */ requestDelay?: number; /** Number of concurrent threads */ threads?: number; } /** * Default DAST policy */ export declare const DEFAULT_DAST_POLICY: DASTPolicy; /** * A finding from a DAST scanner */ export interface DASTFinding { /** Which scanner found this */ scanner: DASTScanner; /** Rule/template ID */ ruleId: string; /** Human-readable name */ name: string; /** Description of the vulnerability */ description: string; /** Severity level */ severity: Severity; /** Confidence level (0-100) */ confidence: number; /** Affected URL */ url: string; /** HTTP method */ method?: string; /** Attack parameter/input */ parameter?: string; /** Evidence/proof of vulnerability */ evidence?: string; /** Attack payload used */ attack?: string; /** CWE IDs */ cweIds?: string[]; /** CVE IDs */ cveIds?: string[]; /** Reference URLs */ references?: string[]; /** Suggested solution */ solution?: string; /** Raw scanner output */ rawOutput?: Record; /** Tags/labels */ tags?: string[]; /** Timestamp when found */ timestamp: string; } /** * Result from running a DAST scanner */ export interface DASTScanResult { /** Scanner used */ scanner: DASTScanner; /** Target that was scanned */ target: DASTTarget; /** Findings discovered */ findings: DASTFinding[]; /** Scan duration in milliseconds */ duration: number; /** Whether scan completed successfully */ success: boolean; /** Error message if failed */ error?: string; /** Scan statistics */ stats: { /** Total requests made */ requestCount: number; /** URLs discovered */ urlsDiscovered: number; /** Unique findings */ uniqueFindings: number; /** Findings by severity */ bySeverity: Partial>; }; /** Scanner version */ version?: string; /** Scan start time */ startTime: string; /** Scan end time */ endTime: string; /** Policy used */ policy: DASTPolicy; } /** * Aggregated results from multiple DAST scanners */ export interface AggregatedDASTResult { /** Timestamp */ timestamp: string; /** Target scanned */ target: DASTTarget; /** Results from each scanner */ scanners: DASTScanResult[]; /** Total findings across all scanners */ totalFindings: number; /** Deduplicated findings */ uniqueFindings: DASTFinding[]; /** Findings by severity */ bySeverity: Partial>; /** Findings by scanner */ byScanner: Record; /** Total scan duration */ totalDuration: number; /** Whether all scanners succeeded */ allSucceeded: boolean; /** Scanners that failed */ failedScanners: DASTScanner[]; } /** * DAST scanner availability status */ export interface DASTAvailability { scanner: DASTScanner; available: boolean; version?: string; path?: string; error?: string; features?: { passiveScan: boolean; activeScan: boolean; apiScan: boolean; authentication: boolean; }; } /** * Options for running DAST scans */ export interface DASTScanOptions { /** Scanners to run */ scanners?: DASTScanner[]; /** Scan policy */ policy?: DASTPolicy; /** Output format */ outputFormat?: "json" | "sarif" | "html"; /** Save report to file */ reportPath?: string; /** Verbose output */ verbose?: boolean; /** Confirmation that scan is authorized */ authorized: boolean; } /** * ZAP-specific alert structure */ export interface ZAPAlert { sourceid: string; other: string; method: string; evidence: string; pluginId: string; cweid: string; confidence: string; wascid: string; description: string; messageId: string; inputVector: string; url: string; tags: Record; reference: string; solution: string; alert: string; param: string; attack: string; name: string; risk: string; id: string; alertRef: string; } /** * Nuclei-specific result structure */ export interface NucleiResult { template: string; "template-url"?: string; "template-id": string; "template-path"?: string; info: { name: string; author: string[]; tags: string[]; description?: string; reference?: string[]; severity: string; metadata?: Record; classification?: { "cve-id"?: string[]; "cwe-id"?: string[]; }; }; type: string; host: string; matched: string; "extracted-results"?: string[]; ip?: string; timestamp: string; matcher?: string; "curl-command"?: string; request?: string; response?: string; } /** * Map ZAP risk levels to severity */ export declare const ZAP_RISK_MAPPING: Record; /** * Map ZAP confidence levels to numeric values */ export declare const ZAP_CONFIDENCE_MAPPING: Record; /** * Map Nuclei severity to vaspera severity */ export declare const NUCLEI_SEVERITY_MAPPING: Record; //# sourceMappingURL=types.d.ts.map