UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

40 lines (39 loc) 1.19 kB
/** * Detector for hardcoded secrets, API keys, passwords, and tokens */ import { BaseDetector } from "./BaseDetector"; import { Vulnerability } from "../types/vulnerability.types"; import { ScanResult } from "../../../types"; export declare class HardcodedSecretDetector extends BaseDetector { private static readonly SECRET_PATTERNS; constructor(); detect(scanResult: ScanResult): Promise<Vulnerability[]>; /** * Validate if a pattern match is actually a secret */ private validateSecretMatch; /** * AST-based secret detection for more sophisticated analysis */ private analyzeASTForSecrets; /** * Check if a string looks like a secret based on various heuristics */ private looksLikeSecret; /** * Check if a variable name suggests it contains sensitive data */ private isSensitiveVariableName; /** * Get variable name for a string literal */ private getVariableNameForStringLiteral; /** * Fixed extractFunctionFromAST function */ private extractFunctionFromAST; /** * Check if value is a placeholder or example */ private isPlaceholderValue; }