secure-scan 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +564 -0
- package/dist/ai/aiAnalyzer.d.ts +99 -0
- package/dist/ai/aiAnalyzer.d.ts.map +1 -0
- package/dist/ai/aiAnalyzer.js +669 -0
- package/dist/ai/aiAnalyzer.js.map +1 -0
- package/dist/ai/index.d.ts +5 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +21 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/analyzers/base/baseAnalyzer.d.ts +44 -0
- package/dist/analyzers/base/baseAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/base/baseAnalyzer.js +53 -0
- package/dist/analyzers/base/baseAnalyzer.js.map +1 -0
- package/dist/analyzers/base/index.d.ts +5 -0
- package/dist/analyzers/base/index.d.ts.map +1 -0
- package/dist/analyzers/base/index.js +21 -0
- package/dist/analyzers/base/index.js.map +1 -0
- package/dist/analyzers/c-cpp/cppAnalyzer.d.ts +60 -0
- package/dist/analyzers/c-cpp/cppAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/c-cpp/cppAnalyzer.js +218 -0
- package/dist/analyzers/c-cpp/cppAnalyzer.js.map +1 -0
- package/dist/analyzers/c-cpp/index.d.ts +5 -0
- package/dist/analyzers/c-cpp/index.d.ts.map +1 -0
- package/dist/analyzers/c-cpp/index.js +21 -0
- package/dist/analyzers/c-cpp/index.js.map +1 -0
- package/dist/analyzers/core/engine/index.d.ts +5 -0
- package/dist/analyzers/core/engine/index.d.ts.map +1 -0
- package/dist/analyzers/core/engine/index.js +21 -0
- package/dist/analyzers/core/engine/index.js.map +1 -0
- package/dist/analyzers/core/engine/ruleEngine.d.ts +46 -0
- package/dist/analyzers/core/engine/ruleEngine.d.ts.map +1 -0
- package/dist/analyzers/core/engine/ruleEngine.js +173 -0
- package/dist/analyzers/core/engine/ruleEngine.js.map +1 -0
- package/dist/analyzers/core/index.d.ts +8 -0
- package/dist/analyzers/core/index.d.ts.map +1 -0
- package/dist/analyzers/core/index.js +24 -0
- package/dist/analyzers/core/index.js.map +1 -0
- package/dist/analyzers/core/scanner/fileScanner.d.ts +31 -0
- package/dist/analyzers/core/scanner/fileScanner.d.ts.map +1 -0
- package/dist/analyzers/core/scanner/fileScanner.js +199 -0
- package/dist/analyzers/core/scanner/fileScanner.js.map +1 -0
- package/dist/analyzers/core/scanner/index.d.ts +5 -0
- package/dist/analyzers/core/scanner/index.d.ts.map +1 -0
- package/dist/analyzers/core/scanner/index.js +21 -0
- package/dist/analyzers/core/scanner/index.js.map +1 -0
- package/dist/analyzers/core/scoring/index.d.ts +5 -0
- package/dist/analyzers/core/scoring/index.d.ts.map +1 -0
- package/dist/analyzers/core/scoring/index.js +21 -0
- package/dist/analyzers/core/scoring/index.js.map +1 -0
- package/dist/analyzers/core/scoring/riskScoring.d.ts +49 -0
- package/dist/analyzers/core/scoring/riskScoring.d.ts.map +1 -0
- package/dist/analyzers/core/scoring/riskScoring.js +180 -0
- package/dist/analyzers/core/scoring/riskScoring.js.map +1 -0
- package/dist/analyzers/core/securityScanner.d.ts +47 -0
- package/dist/analyzers/core/securityScanner.d.ts.map +1 -0
- package/dist/analyzers/core/securityScanner.js +298 -0
- package/dist/analyzers/core/securityScanner.js.map +1 -0
- package/dist/analyzers/csharp/csharpAnalyzer.d.ts +64 -0
- package/dist/analyzers/csharp/csharpAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/csharp/csharpAnalyzer.js +232 -0
- package/dist/analyzers/csharp/csharpAnalyzer.js.map +1 -0
- package/dist/analyzers/csharp/index.d.ts +5 -0
- package/dist/analyzers/csharp/index.d.ts.map +1 -0
- package/dist/analyzers/csharp/index.js +21 -0
- package/dist/analyzers/csharp/index.js.map +1 -0
- package/dist/analyzers/iac/iacAnalyzer.d.ts +36 -0
- package/dist/analyzers/iac/iacAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/iac/iacAnalyzer.js +182 -0
- package/dist/analyzers/iac/iacAnalyzer.js.map +1 -0
- package/dist/analyzers/iac/index.d.ts +5 -0
- package/dist/analyzers/iac/index.d.ts.map +1 -0
- package/dist/analyzers/iac/index.js +21 -0
- package/dist/analyzers/iac/index.js.map +1 -0
- package/dist/analyzers/index.d.ts +30 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +80 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/analyzers/java/index.d.ts +5 -0
- package/dist/analyzers/java/index.d.ts.map +1 -0
- package/dist/analyzers/java/index.js +21 -0
- package/dist/analyzers/java/index.js.map +1 -0
- package/dist/analyzers/java/javaAnalyzer.d.ts +64 -0
- package/dist/analyzers/java/javaAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/java/javaAnalyzer.js +224 -0
- package/dist/analyzers/java/javaAnalyzer.js.map +1 -0
- package/dist/analyzers/javascript/astUtils.d.ts +170 -0
- package/dist/analyzers/javascript/astUtils.d.ts.map +1 -0
- package/dist/analyzers/javascript/astUtils.js +700 -0
- package/dist/analyzers/javascript/astUtils.js.map +1 -0
- package/dist/analyzers/javascript/index.d.ts +18 -0
- package/dist/analyzers/javascript/index.d.ts.map +1 -0
- package/dist/analyzers/javascript/index.js +50 -0
- package/dist/analyzers/javascript/index.js.map +1 -0
- package/dist/analyzers/javascript/javascriptAnalyzer.d.ts +111 -0
- package/dist/analyzers/javascript/javascriptAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/javascript/javascriptAnalyzer.js +860 -0
- package/dist/analyzers/javascript/javascriptAnalyzer.js.map +1 -0
- package/dist/analyzers/javascript/malwareDetector.d.ts +102 -0
- package/dist/analyzers/javascript/malwareDetector.d.ts.map +1 -0
- package/dist/analyzers/javascript/malwareDetector.js +616 -0
- package/dist/analyzers/javascript/malwareDetector.js.map +1 -0
- package/dist/analyzers/javascript/packageJsonAnalyzer.d.ts +87 -0
- package/dist/analyzers/javascript/packageJsonAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/javascript/packageJsonAnalyzer.js +553 -0
- package/dist/analyzers/javascript/packageJsonAnalyzer.js.map +1 -0
- package/dist/analyzers/javascript/taintAnalyzer.d.ts +120 -0
- package/dist/analyzers/javascript/taintAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/javascript/taintAnalyzer.js +526 -0
- package/dist/analyzers/javascript/taintAnalyzer.js.map +1 -0
- package/dist/analyzers/php/index.d.ts +5 -0
- package/dist/analyzers/php/index.d.ts.map +1 -0
- package/dist/analyzers/php/index.js +21 -0
- package/dist/analyzers/php/index.js.map +1 -0
- package/dist/analyzers/php/phpAnalyzer.d.ts +56 -0
- package/dist/analyzers/php/phpAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/php/phpAnalyzer.js +202 -0
- package/dist/analyzers/php/phpAnalyzer.js.map +1 -0
- package/dist/analyzers/python/index.d.ts +5 -0
- package/dist/analyzers/python/index.d.ts.map +1 -0
- package/dist/analyzers/python/index.js +21 -0
- package/dist/analyzers/python/index.js.map +1 -0
- package/dist/analyzers/python/pythonAnalyzer.d.ts +64 -0
- package/dist/analyzers/python/pythonAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/python/pythonAnalyzer.js +226 -0
- package/dist/analyzers/python/pythonAnalyzer.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +281 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/engine/index.d.ts +5 -0
- package/dist/core/engine/index.d.ts.map +1 -0
- package/dist/core/engine/index.js +21 -0
- package/dist/core/engine/index.js.map +1 -0
- package/dist/core/engine/ruleEngine.d.ts +46 -0
- package/dist/core/engine/ruleEngine.d.ts.map +1 -0
- package/dist/core/engine/ruleEngine.js +173 -0
- package/dist/core/engine/ruleEngine.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +24 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/scanner/fileScanner.d.ts +31 -0
- package/dist/core/scanner/fileScanner.d.ts.map +1 -0
- package/dist/core/scanner/fileScanner.js +199 -0
- package/dist/core/scanner/fileScanner.js.map +1 -0
- package/dist/core/scanner/index.d.ts +5 -0
- package/dist/core/scanner/index.d.ts.map +1 -0
- package/dist/core/scanner/index.js +21 -0
- package/dist/core/scanner/index.js.map +1 -0
- package/dist/core/scoring/index.d.ts +5 -0
- package/dist/core/scoring/index.d.ts.map +1 -0
- package/dist/core/scoring/index.js +21 -0
- package/dist/core/scoring/index.js.map +1 -0
- package/dist/core/scoring/riskScoring.d.ts +49 -0
- package/dist/core/scoring/riskScoring.d.ts.map +1 -0
- package/dist/core/scoring/riskScoring.js +180 -0
- package/dist/core/scoring/riskScoring.js.map +1 -0
- package/dist/core/securityScanner.d.ts +47 -0
- package/dist/core/securityScanner.d.ts.map +1 -0
- package/dist/core/securityScanner.js +298 -0
- package/dist/core/securityScanner.js.map +1 -0
- package/dist/dependencies/aiDependencyAnalyzer.d.ts +96 -0
- package/dist/dependencies/aiDependencyAnalyzer.d.ts.map +1 -0
- package/dist/dependencies/aiDependencyAnalyzer.js +435 -0
- package/dist/dependencies/aiDependencyAnalyzer.js.map +1 -0
- package/dist/dependencies/database/cveDatabase.d.ts +32 -0
- package/dist/dependencies/database/cveDatabase.d.ts.map +1 -0
- package/dist/dependencies/database/cveDatabase.js +393 -0
- package/dist/dependencies/database/cveDatabase.js.map +1 -0
- package/dist/dependencies/database/index.d.ts +6 -0
- package/dist/dependencies/database/index.d.ts.map +1 -0
- package/dist/dependencies/database/index.js +22 -0
- package/dist/dependencies/database/index.js.map +1 -0
- package/dist/dependencies/database/maliciousPackages.d.ts +43 -0
- package/dist/dependencies/database/maliciousPackages.d.ts.map +1 -0
- package/dist/dependencies/database/maliciousPackages.js +279 -0
- package/dist/dependencies/database/maliciousPackages.js.map +1 -0
- package/dist/dependencies/dependencyAnalyzer.d.ts +74 -0
- package/dist/dependencies/dependencyAnalyzer.d.ts.map +1 -0
- package/dist/dependencies/dependencyAnalyzer.js +349 -0
- package/dist/dependencies/dependencyAnalyzer.js.map +1 -0
- package/dist/dependencies/detectors/index.d.ts +7 -0
- package/dist/dependencies/detectors/index.d.ts.map +1 -0
- package/dist/dependencies/detectors/index.js +28 -0
- package/dist/dependencies/detectors/index.js.map +1 -0
- package/dist/dependencies/detectors/securityStandards.d.ts +15 -0
- package/dist/dependencies/detectors/securityStandards.d.ts.map +1 -0
- package/dist/dependencies/detectors/securityStandards.js +178 -0
- package/dist/dependencies/detectors/securityStandards.js.map +1 -0
- package/dist/dependencies/detectors/vulnerabilityDetector.d.ts +53 -0
- package/dist/dependencies/detectors/vulnerabilityDetector.d.ts.map +1 -0
- package/dist/dependencies/detectors/vulnerabilityDetector.js +289 -0
- package/dist/dependencies/detectors/vulnerabilityDetector.js.map +1 -0
- package/dist/dependencies/index.d.ts +14 -0
- package/dist/dependencies/index.d.ts.map +1 -0
- package/dist/dependencies/index.js +43 -0
- package/dist/dependencies/index.js.map +1 -0
- package/dist/dependencies/installed/index.d.ts +8 -0
- package/dist/dependencies/installed/index.d.ts.map +1 -0
- package/dist/dependencies/installed/index.js +24 -0
- package/dist/dependencies/installed/index.js.map +1 -0
- package/dist/dependencies/installed/installedScanner.d.ts +91 -0
- package/dist/dependencies/installed/installedScanner.d.ts.map +1 -0
- package/dist/dependencies/installed/installedScanner.js +766 -0
- package/dist/dependencies/installed/installedScanner.js.map +1 -0
- package/dist/dependencies/installed/malwarePatterns.d.ts +32 -0
- package/dist/dependencies/installed/malwarePatterns.d.ts.map +1 -0
- package/dist/dependencies/installed/malwarePatterns.js +480 -0
- package/dist/dependencies/installed/malwarePatterns.js.map +1 -0
- package/dist/dependencies/installed/types.d.ts +274 -0
- package/dist/dependencies/installed/types.d.ts.map +1 -0
- package/dist/dependencies/installed/types.js +7 -0
- package/dist/dependencies/installed/types.js.map +1 -0
- package/dist/dependencies/parsers/base/baseParser.d.ts +44 -0
- package/dist/dependencies/parsers/base/baseParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/base/baseParser.js +80 -0
- package/dist/dependencies/parsers/base/baseParser.js.map +1 -0
- package/dist/dependencies/parsers/base/index.d.ts +6 -0
- package/dist/dependencies/parsers/base/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/base/index.js +27 -0
- package/dist/dependencies/parsers/base/index.js.map +1 -0
- package/dist/dependencies/parsers/cpp/cppParser.d.ts +36 -0
- package/dist/dependencies/parsers/cpp/cppParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/cpp/cppParser.js +196 -0
- package/dist/dependencies/parsers/cpp/cppParser.js.map +1 -0
- package/dist/dependencies/parsers/cpp/index.d.ts +6 -0
- package/dist/dependencies/parsers/cpp/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/cpp/index.js +27 -0
- package/dist/dependencies/parsers/cpp/index.js.map +1 -0
- package/dist/dependencies/parsers/csharp/csharpParser.d.ts +32 -0
- package/dist/dependencies/parsers/csharp/csharpParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/csharp/csharpParser.js +125 -0
- package/dist/dependencies/parsers/csharp/csharpParser.js.map +1 -0
- package/dist/dependencies/parsers/csharp/index.d.ts +6 -0
- package/dist/dependencies/parsers/csharp/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/csharp/index.js +27 -0
- package/dist/dependencies/parsers/csharp/index.js.map +1 -0
- package/dist/dependencies/parsers/index.d.ts +24 -0
- package/dist/dependencies/parsers/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/index.js +69 -0
- package/dist/dependencies/parsers/index.js.map +1 -0
- package/dist/dependencies/parsers/java/index.d.ts +6 -0
- package/dist/dependencies/parsers/java/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/java/index.js +27 -0
- package/dist/dependencies/parsers/java/index.js.map +1 -0
- package/dist/dependencies/parsers/java/javaParser.d.ts +32 -0
- package/dist/dependencies/parsers/java/javaParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/java/javaParser.js +168 -0
- package/dist/dependencies/parsers/java/javaParser.js.map +1 -0
- package/dist/dependencies/parsers/javascript/index.d.ts +6 -0
- package/dist/dependencies/parsers/javascript/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/javascript/index.js +27 -0
- package/dist/dependencies/parsers/javascript/index.js.map +1 -0
- package/dist/dependencies/parsers/javascript/javascriptParser.d.ts +55 -0
- package/dist/dependencies/parsers/javascript/javascriptParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/javascript/javascriptParser.js +266 -0
- package/dist/dependencies/parsers/javascript/javascriptParser.js.map +1 -0
- package/dist/dependencies/parsers/php/index.d.ts +6 -0
- package/dist/dependencies/parsers/php/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/php/index.js +27 -0
- package/dist/dependencies/parsers/php/index.js.map +1 -0
- package/dist/dependencies/parsers/php/phpParser.d.ts +35 -0
- package/dist/dependencies/parsers/php/phpParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/php/phpParser.js +162 -0
- package/dist/dependencies/parsers/php/phpParser.js.map +1 -0
- package/dist/dependencies/parsers/python/index.d.ts +6 -0
- package/dist/dependencies/parsers/python/index.d.ts.map +1 -0
- package/dist/dependencies/parsers/python/index.js +27 -0
- package/dist/dependencies/parsers/python/index.js.map +1 -0
- package/dist/dependencies/parsers/python/pythonParser.d.ts +60 -0
- package/dist/dependencies/parsers/python/pythonParser.d.ts.map +1 -0
- package/dist/dependencies/parsers/python/pythonParser.js +336 -0
- package/dist/dependencies/parsers/python/pythonParser.js.map +1 -0
- package/dist/dependencies/types.d.ts +280 -0
- package/dist/dependencies/types.d.ts.map +1 -0
- package/dist/dependencies/types.js +59 -0
- package/dist/dependencies/types.js.map +1 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +18 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/translations.d.ts +55 -0
- package/dist/i18n/translations.d.ts.map +1 -0
- package/dist/i18n/translations.js +119 -0
- package/dist/i18n/translations.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/reports/dependencyReportGenerator.d.ts +20 -0
- package/dist/reports/dependencyReportGenerator.d.ts.map +1 -0
- package/dist/reports/dependencyReportGenerator.js +690 -0
- package/dist/reports/dependencyReportGenerator.js.map +1 -0
- package/dist/reports/htmlReportGenerator.d.ts +43 -0
- package/dist/reports/htmlReportGenerator.d.ts.map +1 -0
- package/dist/reports/htmlReportGenerator.js +793 -0
- package/dist/reports/htmlReportGenerator.js.map +1 -0
- package/dist/reports/index.d.ts +7 -0
- package/dist/reports/index.d.ts.map +1 -0
- package/dist/reports/index.js +23 -0
- package/dist/reports/index.js.map +1 -0
- package/dist/reports/installedDepsReportGenerator.d.ts +14 -0
- package/dist/reports/installedDepsReportGenerator.d.ts.map +1 -0
- package/dist/reports/installedDepsReportGenerator.js +872 -0
- package/dist/reports/installedDepsReportGenerator.js.map +1 -0
- package/dist/rules/index.d.ts +31 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +95 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/malware/categories/backdoors.d.ts +12 -0
- package/dist/rules/malware/categories/backdoors.d.ts.map +1 -0
- package/dist/rules/malware/categories/backdoors.js +163 -0
- package/dist/rules/malware/categories/backdoors.js.map +1 -0
- package/dist/rules/malware/categories/cryptominers.d.ts +13 -0
- package/dist/rules/malware/categories/cryptominers.d.ts.map +1 -0
- package/dist/rules/malware/categories/cryptominers.js +415 -0
- package/dist/rules/malware/categories/cryptominers.js.map +1 -0
- package/dist/rules/malware/categories/exfiltration.d.ts +20 -0
- package/dist/rules/malware/categories/exfiltration.d.ts.map +1 -0
- package/dist/rules/malware/categories/exfiltration.js +658 -0
- package/dist/rules/malware/categories/exfiltration.js.map +1 -0
- package/dist/rules/malware/categories/keyloggers.d.ts +19 -0
- package/dist/rules/malware/categories/keyloggers.d.ts.map +1 -0
- package/dist/rules/malware/categories/keyloggers.js +763 -0
- package/dist/rules/malware/categories/keyloggers.js.map +1 -0
- package/dist/rules/malware/categories/loaders.d.ts +20 -0
- package/dist/rules/malware/categories/loaders.d.ts.map +1 -0
- package/dist/rules/malware/categories/loaders.js +702 -0
- package/dist/rules/malware/categories/loaders.js.map +1 -0
- package/dist/rules/malware/categories/network.d.ts +19 -0
- package/dist/rules/malware/categories/network.d.ts.map +1 -0
- package/dist/rules/malware/categories/network.js +622 -0
- package/dist/rules/malware/categories/network.js.map +1 -0
- package/dist/rules/malware/categories/obfuscation.d.ts +22 -0
- package/dist/rules/malware/categories/obfuscation.d.ts.map +1 -0
- package/dist/rules/malware/categories/obfuscation.js +766 -0
- package/dist/rules/malware/categories/obfuscation.js.map +1 -0
- package/dist/rules/malware/constants/index.d.ts +281 -0
- package/dist/rules/malware/constants/index.d.ts.map +1 -0
- package/dist/rules/malware/constants/index.js +327 -0
- package/dist/rules/malware/constants/index.js.map +1 -0
- package/dist/rules/malware/engine/index.d.ts +178 -0
- package/dist/rules/malware/engine/index.d.ts.map +1 -0
- package/dist/rules/malware/engine/index.js +552 -0
- package/dist/rules/malware/engine/index.js.map +1 -0
- package/dist/rules/malware/index.d.ts +205 -0
- package/dist/rules/malware/index.d.ts.map +1 -0
- package/dist/rules/malware/index.js +837 -0
- package/dist/rules/malware/index.js.map +1 -0
- package/dist/rules/malware/scoring/index.d.ts +84 -0
- package/dist/rules/malware/scoring/index.d.ts.map +1 -0
- package/dist/rules/malware/scoring/index.js +441 -0
- package/dist/rules/malware/scoring/index.js.map +1 -0
- package/dist/rules/malware/types/index.d.ts +616 -0
- package/dist/rules/malware/types/index.d.ts.map +1 -0
- package/dist/rules/malware/types/index.js +155 -0
- package/dist/rules/malware/types/index.js.map +1 -0
- package/dist/rules/malware/utils/index.d.ts +117 -0
- package/dist/rules/malware/utils/index.d.ts.map +1 -0
- package/dist/rules/malware/utils/index.js +514 -0
- package/dist/rules/malware/utils/index.js.map +1 -0
- package/dist/rules/standards.d.ts +26 -0
- package/dist/rules/standards.d.ts.map +1 -0
- package/dist/rules/standards.js +352 -0
- package/dist/rules/standards.js.map +1 -0
- package/dist/rules/vulnerabilities/constants/index.d.ts +835 -0
- package/dist/rules/vulnerabilities/constants/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/constants/index.js +544 -0
- package/dist/rules/vulnerabilities/constants/index.js.map +1 -0
- package/dist/rules/vulnerabilities/engine/index.d.ts +145 -0
- package/dist/rules/vulnerabilities/engine/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/engine/index.js +581 -0
- package/dist/rules/vulnerabilities/engine/index.js.map +1 -0
- package/dist/rules/vulnerabilities/index.d.ts +148 -0
- package/dist/rules/vulnerabilities/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/index.js +252 -0
- package/dist/rules/vulnerabilities/index.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/authentication.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/authentication.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/authentication.js +419 -0
- package/dist/rules/vulnerabilities/rules/authentication.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/commandInjection.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/commandInjection.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/commandInjection.js +300 -0
- package/dist/rules/vulnerabilities/rules/commandInjection.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/csrf.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/csrf.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/csrf.js +261 -0
- package/dist/rules/vulnerabilities/rules/csrf.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/deserialization.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/deserialization.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/deserialization.js +336 -0
- package/dist/rules/vulnerabilities/rules/deserialization.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/fileUpload.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/fileUpload.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/fileUpload.js +325 -0
- package/dist/rules/vulnerabilities/rules/fileUpload.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/hardcodedSecrets.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/hardcodedSecrets.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/hardcodedSecrets.js +446 -0
- package/dist/rules/vulnerabilities/rules/hardcodedSecrets.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/index.d.ts +17 -0
- package/dist/rules/vulnerabilities/rules/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/index.js +47 -0
- package/dist/rules/vulnerabilities/rules/index.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/pathTraversal.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/pathTraversal.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/pathTraversal.js +351 -0
- package/dist/rules/vulnerabilities/rules/pathTraversal.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/prototypePollution.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/prototypePollution.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/prototypePollution.js +272 -0
- package/dist/rules/vulnerabilities/rules/prototypePollution.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/securityMisconfiguration.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/securityMisconfiguration.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/securityMisconfiguration.js +438 -0
- package/dist/rules/vulnerabilities/rules/securityMisconfiguration.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/sqlInjection.d.ts +12 -0
- package/dist/rules/vulnerabilities/rules/sqlInjection.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/sqlInjection.js +636 -0
- package/dist/rules/vulnerabilities/rules/sqlInjection.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/ssrf.d.ts +8 -0
- package/dist/rules/vulnerabilities/rules/ssrf.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/ssrf.js +401 -0
- package/dist/rules/vulnerabilities/rules/ssrf.js.map +1 -0
- package/dist/rules/vulnerabilities/rules/xss.d.ts +11 -0
- package/dist/rules/vulnerabilities/rules/xss.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/rules/xss.js +724 -0
- package/dist/rules/vulnerabilities/rules/xss.js.map +1 -0
- package/dist/rules/vulnerabilities/scoring/index.d.ts +80 -0
- package/dist/rules/vulnerabilities/scoring/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/scoring/index.js +414 -0
- package/dist/rules/vulnerabilities/scoring/index.js.map +1 -0
- package/dist/rules/vulnerabilities/types/index.d.ts +830 -0
- package/dist/rules/vulnerabilities/types/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/types/index.js +164 -0
- package/dist/rules/vulnerabilities/types/index.js.map +1 -0
- package/dist/rules/vulnerabilities/utils/index.d.ts +206 -0
- package/dist/rules/vulnerabilities/utils/index.d.ts.map +1 -0
- package/dist/rules/vulnerabilities/utils/index.js +615 -0
- package/dist/rules/vulnerabilities/utils/index.js.map +1 -0
- package/dist/types/index.d.ts +359 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +61 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +82 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +326 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +40 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +139 -0
- package/dist/utils/logger.js.map +1 -0
- package/docs/ARCHITECTURE.md +320 -0
- package/docs/V1.2.1-IA_Performances.md +116 -0
- package/docs/images/WIN_Defender.png +0 -0
- package/package.json +68 -0
- package/secure-scan.config.json +134 -0
- package/secure-scan.sln +29 -0
- package/src/ai/aiAnalyzer.ts +714 -0
- package/src/ai/index.ts +5 -0
- package/src/analyzers/base/baseAnalyzer.ts +66 -0
- package/src/analyzers/base/index.ts +5 -0
- package/src/analyzers/c-cpp/cppAnalyzer.ts +308 -0
- package/src/analyzers/c-cpp/index.ts +5 -0
- package/src/analyzers/core/engine/index.ts +5 -0
- package/src/analyzers/core/engine/ruleEngine.ts +221 -0
- package/src/analyzers/core/index.ts +8 -0
- package/src/analyzers/core/scanner/fileScanner.ts +204 -0
- package/src/analyzers/core/scanner/index.ts +5 -0
- package/src/analyzers/core/scoring/index.ts +5 -0
- package/src/analyzers/core/scoring/riskScoring.ts +198 -0
- package/src/analyzers/core/securityScanner.ts +321 -0
- package/src/analyzers/csharp/csharpAnalyzer.ts +328 -0
- package/src/analyzers/csharp/index.ts +5 -0
- package/src/analyzers/iac/iacAnalyzer.ts +318 -0
- package/src/analyzers/iac/index.ts +5 -0
- package/src/analyzers/index.ts +67 -0
- package/src/analyzers/java/index.ts +5 -0
- package/src/analyzers/java/javaAnalyzer.ts +320 -0
- package/src/analyzers/javascript/PROMPT_JS_ANALYZER.md +267 -0
- package/src/analyzers/javascript/astUtils.ts +789 -0
- package/src/analyzers/javascript/index.ts +50 -0
- package/src/analyzers/javascript/javascriptAnalyzer.ts +984 -0
- package/src/analyzers/javascript/malwareDetector.ts +697 -0
- package/src/analyzers/javascript/packageJsonAnalyzer.ts +626 -0
- package/src/analyzers/javascript/taintAnalyzer.ts +630 -0
- package/src/analyzers/php/index.ts +5 -0
- package/src/analyzers/php/phpAnalyzer.ts +280 -0
- package/src/analyzers/python/index.ts +5 -0
- package/src/analyzers/python/pythonAnalyzer.ts +319 -0
- package/src/cli/index.ts +276 -0
- package/src/dependencies/aiDependencyAnalyzer.ts +496 -0
- package/src/dependencies/database/cveDatabase.ts +426 -0
- package/src/dependencies/database/index.ts +6 -0
- package/src/dependencies/database/maliciousPackages.ts +286 -0
- package/src/dependencies/dependencyAnalyzer.ts +394 -0
- package/src/dependencies/detectors/index.ts +7 -0
- package/src/dependencies/detectors/securityStandards.ts +200 -0
- package/src/dependencies/detectors/vulnerabilityDetector.ts +343 -0
- package/src/dependencies/index.ts +27 -0
- package/src/dependencies/installed/index.ts +8 -0
- package/src/dependencies/installed/installedScanner.ts +821 -0
- package/src/dependencies/installed/malwarePatterns.ts +492 -0
- package/src/dependencies/installed/types.ts +287 -0
- package/src/dependencies/parsers/base/baseParser.ts +108 -0
- package/src/dependencies/parsers/base/index.ts +6 -0
- package/src/dependencies/parsers/cpp/cppParser.ts +245 -0
- package/src/dependencies/parsers/cpp/index.ts +6 -0
- package/src/dependencies/parsers/csharp/csharpParser.ts +151 -0
- package/src/dependencies/parsers/csharp/index.ts +6 -0
- package/src/dependencies/parsers/index.ts +56 -0
- package/src/dependencies/parsers/java/index.ts +6 -0
- package/src/dependencies/parsers/java/javaParser.ts +203 -0
- package/src/dependencies/parsers/javascript/index.ts +6 -0
- package/src/dependencies/parsers/javascript/javascriptParser.ts +362 -0
- package/src/dependencies/parsers/php/index.ts +6 -0
- package/src/dependencies/parsers/php/phpParser.ts +208 -0
- package/src/dependencies/parsers/python/index.ts +6 -0
- package/src/dependencies/parsers/python/pythonParser.ts +437 -0
- package/src/dependencies/types.ts +330 -0
- package/src/i18n/index.ts +1 -0
- package/src/i18n/translations.ts +194 -0
- package/src/index.ts +16 -0
- package/src/reports/dependencyReportGenerator.ts +717 -0
- package/src/reports/htmlReportGenerator.ts +781 -0
- package/src/reports/index.ts +7 -0
- package/src/reports/installedDepsReportGenerator.ts +899 -0
- package/src/rules/index.ts +58 -0
- package/src/rules/malware/INFO.md +287 -0
- package/src/rules/malware/categories/backdoors.ts +174 -0
- package/src/rules/malware/categories/cryptominers.ts +434 -0
- package/src/rules/malware/categories/exfiltration.ts +677 -0
- package/src/rules/malware/categories/keyloggers.ts +780 -0
- package/src/rules/malware/categories/loaders.ts +721 -0
- package/src/rules/malware/categories/network.ts +639 -0
- package/src/rules/malware/categories/obfuscation.ts +788 -0
- package/src/rules/malware/constants/index.ts +358 -0
- package/src/rules/malware/engine/index.ts +758 -0
- package/src/rules/malware/index.ts +928 -0
- package/src/rules/malware/scoring/index.ts +549 -0
- package/src/rules/malware/types/index.ts +752 -0
- package/src/rules/malware/utils/index.ts +643 -0
- package/src/rules/standards.ts +372 -0
- package/src/rules/vulnerabilities/PROMPT_VULNERABILITIES.md +226 -0
- package/src/rules/vulnerabilities/constants/index.ts +625 -0
- package/src/rules/vulnerabilities/engine/index.ts +831 -0
- package/src/rules/vulnerabilities/index.ts +312 -0
- package/src/rules/vulnerabilities/rules/authentication.ts +426 -0
- package/src/rules/vulnerabilities/rules/commandInjection.ts +307 -0
- package/src/rules/vulnerabilities/rules/csrf.ts +268 -0
- package/src/rules/vulnerabilities/rules/deserialization.ts +343 -0
- package/src/rules/vulnerabilities/rules/fileUpload.ts +332 -0
- package/src/rules/vulnerabilities/rules/hardcodedSecrets.ts +453 -0
- package/src/rules/vulnerabilities/rules/index.ts +17 -0
- package/src/rules/vulnerabilities/rules/pathTraversal.ts +358 -0
- package/src/rules/vulnerabilities/rules/prototypePollution.ts +279 -0
- package/src/rules/vulnerabilities/rules/securityMisconfiguration.ts +445 -0
- package/src/rules/vulnerabilities/rules/sqlInjection.ts +669 -0
- package/src/rules/vulnerabilities/rules/ssrf.ts +408 -0
- package/src/rules/vulnerabilities/rules/xss.ts +753 -0
- package/src/rules/vulnerabilities/scoring/index.ts +543 -0
- package/src/rules/vulnerabilities/types/index.ts +1004 -0
- package/src/rules/vulnerabilities/utils/index.ts +709 -0
- package/src/types/index.ts +391 -0
- package/src/utils/index.ts +306 -0
- package/src/utils/logger.ts +150 -0
- package/test-installed-scanner.ts +136 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,830 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Vulnerability Detection Module - Type Definitions
|
|
3
|
+
* @module rules/vulnerabilities/types
|
|
4
|
+
*
|
|
5
|
+
* Comprehensive type definitions for the vulnerability detection engine.
|
|
6
|
+
* Supports multi-language analysis, AST-aware detection, taint analysis,
|
|
7
|
+
* and enterprise-level reporting with OWASP/CWE/SANS/MITRE mappings.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Supported programming languages for vulnerability detection
|
|
11
|
+
*/
|
|
12
|
+
export declare enum SupportedLanguage {
|
|
13
|
+
JAVASCRIPT = "javascript",
|
|
14
|
+
TYPESCRIPT = "typescript",
|
|
15
|
+
PYTHON = "python",
|
|
16
|
+
PHP = "php",
|
|
17
|
+
C = "c",
|
|
18
|
+
CPP = "cpp",
|
|
19
|
+
CSHARP = "csharp",
|
|
20
|
+
JAVA = "java",
|
|
21
|
+
RUBY = "ruby",
|
|
22
|
+
GO = "go",
|
|
23
|
+
RUST = "rust",
|
|
24
|
+
SHELL = "shell",
|
|
25
|
+
POWERSHELL = "powershell",
|
|
26
|
+
DOCKERFILE = "dockerfile",
|
|
27
|
+
YAML = "yaml",
|
|
28
|
+
TERRAFORM = "terraform"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Vulnerability categories based on OWASP classification
|
|
32
|
+
*/
|
|
33
|
+
export declare enum VulnerabilityCategory {
|
|
34
|
+
INJECTION = "injection",
|
|
35
|
+
XSS = "xss",
|
|
36
|
+
AUTHENTICATION = "authentication",
|
|
37
|
+
SESSION_MANAGEMENT = "session_management",
|
|
38
|
+
ACCESS_CONTROL = "access_control",
|
|
39
|
+
BROKEN_ACCESS_CONTROL = "broken_access_control",
|
|
40
|
+
CRYPTOGRAPHY = "cryptography",
|
|
41
|
+
CRYPTOGRAPHIC_FAILURE = "cryptographic_failure",
|
|
42
|
+
DESERIALIZATION = "deserialization",
|
|
43
|
+
FILE_HANDLING = "file_handling",
|
|
44
|
+
CONFIGURATION = "configuration",
|
|
45
|
+
SECURITY_MISCONFIGURATION = "security_misconfiguration",
|
|
46
|
+
INFORMATION_DISCLOSURE = "information_disclosure",
|
|
47
|
+
SENSITIVE_DATA_EXPOSURE = "sensitive_data_exposure",
|
|
48
|
+
INPUT_VALIDATION = "input_validation",
|
|
49
|
+
INFRASTRUCTURE = "infrastructure",
|
|
50
|
+
KNOWN_VULNERABLE_COMPONENT = "known_vulnerable_component"
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Specific vulnerability types
|
|
54
|
+
*/
|
|
55
|
+
export declare enum VulnerabilityType {
|
|
56
|
+
SQL_INJECTION = "sql_injection",
|
|
57
|
+
NOSQL_INJECTION = "nosql_injection",
|
|
58
|
+
COMMAND_INJECTION = "command_injection",
|
|
59
|
+
CODE_INJECTION = "code_injection",
|
|
60
|
+
LDAP_INJECTION = "ldap_injection",
|
|
61
|
+
XPATH_INJECTION = "xpath_injection",
|
|
62
|
+
TEMPLATE_INJECTION = "template_injection",
|
|
63
|
+
HEADER_INJECTION = "header_injection",
|
|
64
|
+
XSS_REFLECTED = "xss_reflected",
|
|
65
|
+
XSS_STORED = "xss_stored",
|
|
66
|
+
XSS_DOM = "xss_dom",
|
|
67
|
+
CSRF = "csrf",
|
|
68
|
+
SSRF = "ssrf",
|
|
69
|
+
INSECURE_DESERIALIZATION = "insecure_deserialization",
|
|
70
|
+
PROTOTYPE_POLLUTION = "prototype_pollution",
|
|
71
|
+
PATH_TRAVERSAL = "path_traversal",
|
|
72
|
+
UNSAFE_FILE_UPLOAD = "unsafe_file_upload",
|
|
73
|
+
FILE_UPLOAD = "file_upload",
|
|
74
|
+
ARBITRARY_FILE_READ = "arbitrary_file_read",
|
|
75
|
+
ARBITRARY_FILE_WRITE = "arbitrary_file_write",
|
|
76
|
+
INSECURE_AUTHENTICATION = "insecure_authentication",
|
|
77
|
+
BROKEN_AUTHENTICATION = "broken_authentication",
|
|
78
|
+
BROKEN_SESSION = "broken_session",
|
|
79
|
+
HARDCODED_CREDENTIALS = "hardcoded_credentials",
|
|
80
|
+
HARDCODED_SECRETS = "hardcoded_secrets",
|
|
81
|
+
WEAK_PASSWORD_POLICY = "weak_password_policy",
|
|
82
|
+
WEAK_CRYPTO = "weak_crypto",
|
|
83
|
+
WEAK_RANDOM = "weak_random",
|
|
84
|
+
INSECURE_TLS = "insecure_tls",
|
|
85
|
+
MISSING_ENCRYPTION = "missing_encryption",
|
|
86
|
+
BROKEN_ACCESS_CONTROL = "broken_access_control",
|
|
87
|
+
IDOR = "idor",
|
|
88
|
+
PRIVILEGE_ESCALATION = "privilege_escalation",
|
|
89
|
+
INFORMATION_EXPOSURE = "information_exposure",
|
|
90
|
+
ERROR_DISCLOSURE = "error_disclosure",
|
|
91
|
+
DEBUG_ENABLED = "debug_enabled",
|
|
92
|
+
SECURITY_MISCONFIGURATION = "security_misconfiguration",
|
|
93
|
+
CORS_MISCONFIGURATION = "cors_misconfiguration",
|
|
94
|
+
INSECURE_HEADERS = "insecure_headers",
|
|
95
|
+
DANGEROUS_FUNCTION = "dangerous_function",
|
|
96
|
+
DOCKERFILE_ISSUE = "dockerfile_issue",
|
|
97
|
+
CICD_VULNERABILITY = "cicd_vulnerability",
|
|
98
|
+
IaC_ISSUE = "iac_issue"
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Severity levels for vulnerability findings
|
|
102
|
+
*/
|
|
103
|
+
export declare enum VulnerabilitySeverity {
|
|
104
|
+
CRITICAL = "critical",// Immediate exploitation risk
|
|
105
|
+
HIGH = "high",// Serious vulnerability
|
|
106
|
+
MEDIUM = "medium",// Moderate risk
|
|
107
|
+
LOW = "low",// Minor concern
|
|
108
|
+
INFO = "info"
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Confidence level of the detection
|
|
112
|
+
*/
|
|
113
|
+
export declare enum ConfidenceLevel {
|
|
114
|
+
CONFIRMED = "confirmed",// 95%+ certainty, verified taint flow
|
|
115
|
+
HIGH = "high",// 80-95% certainty
|
|
116
|
+
MEDIUM = "medium",// 60-80% certainty
|
|
117
|
+
LOW = "low",// 40-60% certainty
|
|
118
|
+
TENTATIVE = "tentative"
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Pattern matching strategies
|
|
122
|
+
*/
|
|
123
|
+
export declare enum PatternType {
|
|
124
|
+
REGEX = "regex",
|
|
125
|
+
LITERAL = "literal",
|
|
126
|
+
AST = "ast",
|
|
127
|
+
SEMANTIC = "semantic",
|
|
128
|
+
TAINT = "taint",
|
|
129
|
+
CFG = "cfg"
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Taint flow stages
|
|
133
|
+
*/
|
|
134
|
+
export declare enum TaintStage {
|
|
135
|
+
SOURCE = "source",
|
|
136
|
+
PROPAGATION = "propagation",
|
|
137
|
+
SANITIZER = "sanitizer",
|
|
138
|
+
SINK = "sink"
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* OWASP Top 10 reference
|
|
142
|
+
*/
|
|
143
|
+
export interface OwaspReference {
|
|
144
|
+
/** OWASP ID (e.g., A03:2021) */
|
|
145
|
+
id: string;
|
|
146
|
+
/** Category name */
|
|
147
|
+
name: string;
|
|
148
|
+
/** URL to OWASP documentation */
|
|
149
|
+
url?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* CWE reference
|
|
153
|
+
*/
|
|
154
|
+
export interface CweReference {
|
|
155
|
+
/** CWE ID (e.g., CWE-79) */
|
|
156
|
+
id: string;
|
|
157
|
+
/** CWE title */
|
|
158
|
+
title: string;
|
|
159
|
+
/** URL to CWE documentation */
|
|
160
|
+
url?: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* SANS Top 25 reference
|
|
164
|
+
*/
|
|
165
|
+
export interface SansReference {
|
|
166
|
+
/** SANS ranking (1-25) */
|
|
167
|
+
rank: number;
|
|
168
|
+
/** Associated CWE ID */
|
|
169
|
+
cweId: string;
|
|
170
|
+
/** Category name */
|
|
171
|
+
category: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* MITRE ATT&CK reference
|
|
175
|
+
*/
|
|
176
|
+
export interface MitreReference {
|
|
177
|
+
/** Tactic ID (e.g., TA0001) */
|
|
178
|
+
tacticId: string;
|
|
179
|
+
/** Tactic name */
|
|
180
|
+
tacticName: string;
|
|
181
|
+
/** Technique ID (e.g., T1059) */
|
|
182
|
+
techniqueId: string;
|
|
183
|
+
/** Technique name */
|
|
184
|
+
techniqueName: string;
|
|
185
|
+
/** Sub-technique ID if applicable */
|
|
186
|
+
subTechniqueId?: string;
|
|
187
|
+
/** URL to MITRE documentation */
|
|
188
|
+
url?: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* CVE reference
|
|
192
|
+
*/
|
|
193
|
+
export interface CveReference {
|
|
194
|
+
/** CVE ID (e.g., CVE-2021-44228) */
|
|
195
|
+
cveId: string;
|
|
196
|
+
/** Brief description */
|
|
197
|
+
description: string;
|
|
198
|
+
/** CVSS score if available */
|
|
199
|
+
cvssScore?: number;
|
|
200
|
+
/** URL to CVE details */
|
|
201
|
+
url?: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Combined security standards for a vulnerability
|
|
205
|
+
*/
|
|
206
|
+
export interface SecurityStandards {
|
|
207
|
+
owasp?: OwaspReference[];
|
|
208
|
+
cwe?: CweReference[];
|
|
209
|
+
sans?: SansReference[];
|
|
210
|
+
mitre?: MitreReference[];
|
|
211
|
+
cve?: CveReference[];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Base pattern definition
|
|
215
|
+
*/
|
|
216
|
+
export interface VulnerabilityPatternBase {
|
|
217
|
+
/** Pattern type */
|
|
218
|
+
type: PatternType;
|
|
219
|
+
/** Pattern identifier for reference */
|
|
220
|
+
patternId?: string;
|
|
221
|
+
/** Languages this pattern applies to (empty = all) */
|
|
222
|
+
languages?: SupportedLanguage[];
|
|
223
|
+
/** Weight for scoring (0.0 - 1.0) */
|
|
224
|
+
weight?: number;
|
|
225
|
+
/** Description of what this pattern detects */
|
|
226
|
+
description?: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Regex-based pattern
|
|
230
|
+
*/
|
|
231
|
+
export interface RegexPattern extends VulnerabilityPatternBase {
|
|
232
|
+
type: PatternType.REGEX;
|
|
233
|
+
/** The regex pattern string */
|
|
234
|
+
pattern: string;
|
|
235
|
+
/** Regex flags (g, i, m, s, u) */
|
|
236
|
+
flags?: string;
|
|
237
|
+
/** Maximum execution time in ms (ReDoS protection) */
|
|
238
|
+
timeout?: number;
|
|
239
|
+
/** Maximum matches before stopping */
|
|
240
|
+
maxMatches?: number;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Literal string pattern
|
|
244
|
+
*/
|
|
245
|
+
export interface LiteralPattern extends VulnerabilityPatternBase {
|
|
246
|
+
type: PatternType.LITERAL;
|
|
247
|
+
/** The literal string to match */
|
|
248
|
+
value: string;
|
|
249
|
+
/** Case sensitive matching */
|
|
250
|
+
caseSensitive?: boolean;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* AST-based pattern for structural matching
|
|
254
|
+
*/
|
|
255
|
+
export interface AstPattern extends VulnerabilityPatternBase {
|
|
256
|
+
type: PatternType.AST;
|
|
257
|
+
/** AST node type to match */
|
|
258
|
+
nodeType: string;
|
|
259
|
+
/** Properties to match on the node */
|
|
260
|
+
properties?: Record<string, unknown>;
|
|
261
|
+
/** Child patterns to match */
|
|
262
|
+
children?: AstPattern[];
|
|
263
|
+
/** Parent context requirements */
|
|
264
|
+
parentContext?: string[];
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Taint analysis pattern
|
|
268
|
+
*/
|
|
269
|
+
export interface TaintPattern extends VulnerabilityPatternBase {
|
|
270
|
+
type: PatternType.TAINT;
|
|
271
|
+
/** Taint sources */
|
|
272
|
+
sources: TaintSource[];
|
|
273
|
+
/** Taint sinks */
|
|
274
|
+
sinks: TaintSink[];
|
|
275
|
+
/** Optional sanitizers that break the taint */
|
|
276
|
+
sanitizers?: TaintSanitizer[];
|
|
277
|
+
/** Required flow path */
|
|
278
|
+
requiredPath?: string[];
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Semantic pattern for meaning-based matching
|
|
282
|
+
*/
|
|
283
|
+
export interface SemanticPattern extends VulnerabilityPatternBase {
|
|
284
|
+
type: PatternType.SEMANTIC;
|
|
285
|
+
/** Semantic concept to detect */
|
|
286
|
+
concept: string;
|
|
287
|
+
/** Required data flows */
|
|
288
|
+
dataFlows?: string[];
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Control flow graph pattern
|
|
292
|
+
*/
|
|
293
|
+
export interface CfgPattern extends VulnerabilityPatternBase {
|
|
294
|
+
type: PatternType.CFG;
|
|
295
|
+
/** Entry point condition */
|
|
296
|
+
entryCondition: string;
|
|
297
|
+
/** Required path conditions */
|
|
298
|
+
pathConditions?: string[];
|
|
299
|
+
/** Exit point condition */
|
|
300
|
+
exitCondition: string;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Union type for all pattern types
|
|
304
|
+
*/
|
|
305
|
+
export type VulnerabilityPattern = RegexPattern | LiteralPattern | AstPattern | TaintPattern | SemanticPattern | CfgPattern;
|
|
306
|
+
/**
|
|
307
|
+
* Taint source definition
|
|
308
|
+
*/
|
|
309
|
+
export interface TaintSource {
|
|
310
|
+
/** Source identifier */
|
|
311
|
+
id: string;
|
|
312
|
+
/** Source name (e.g., req.body, $_GET) */
|
|
313
|
+
name: string;
|
|
314
|
+
/** Pattern to match the source */
|
|
315
|
+
pattern: string | RegExp;
|
|
316
|
+
/** Languages this source applies to */
|
|
317
|
+
languages?: SupportedLanguage[];
|
|
318
|
+
/** Trust level (0-100, lower = less trusted) */
|
|
319
|
+
trustLevel?: number;
|
|
320
|
+
/** Source category */
|
|
321
|
+
category?: 'user_input' | 'environment' | 'database' | 'network' | 'file';
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Taint sink definition
|
|
325
|
+
*/
|
|
326
|
+
export interface TaintSink {
|
|
327
|
+
/** Sink identifier */
|
|
328
|
+
id: string;
|
|
329
|
+
/** Sink name (e.g., exec, innerHTML) */
|
|
330
|
+
name: string;
|
|
331
|
+
/** Pattern to match the sink */
|
|
332
|
+
pattern: string | RegExp;
|
|
333
|
+
/** Languages this sink applies to */
|
|
334
|
+
languages?: SupportedLanguage[];
|
|
335
|
+
/** Vulnerability type this sink can cause */
|
|
336
|
+
vulnerabilityType: VulnerabilityType;
|
|
337
|
+
/** Arguments that are dangerous (0-indexed) */
|
|
338
|
+
dangerousArgs?: number[];
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Taint sanitizer definition
|
|
342
|
+
*/
|
|
343
|
+
export interface TaintSanitizer {
|
|
344
|
+
/** Sanitizer identifier */
|
|
345
|
+
id: string;
|
|
346
|
+
/** Sanitizer name */
|
|
347
|
+
name: string;
|
|
348
|
+
/** Pattern to match the sanitizer */
|
|
349
|
+
pattern: string | RegExp;
|
|
350
|
+
/** Languages this sanitizer applies to */
|
|
351
|
+
languages?: SupportedLanguage[];
|
|
352
|
+
/** Vulnerability types this sanitizer protects against */
|
|
353
|
+
protectsAgainst: VulnerabilityType[];
|
|
354
|
+
/** Effectiveness (0-100) */
|
|
355
|
+
effectiveness?: number;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Detected taint flow
|
|
359
|
+
*/
|
|
360
|
+
export interface TaintFlow {
|
|
361
|
+
/** Source of the taint */
|
|
362
|
+
source: TaintSource;
|
|
363
|
+
/** Sink where taint reaches */
|
|
364
|
+
sink: TaintSink;
|
|
365
|
+
/** Propagation path */
|
|
366
|
+
path: TaintPathNode[];
|
|
367
|
+
/** Applied sanitizers */
|
|
368
|
+
sanitizers: TaintSanitizer[];
|
|
369
|
+
/** Is the flow exploitable */
|
|
370
|
+
isExploitable: boolean;
|
|
371
|
+
/** Confidence of the flow detection */
|
|
372
|
+
confidence: ConfidenceLevel;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Node in taint propagation path
|
|
376
|
+
*/
|
|
377
|
+
export interface TaintPathNode {
|
|
378
|
+
/** Variable or expression name */
|
|
379
|
+
name: string;
|
|
380
|
+
/** Location in source */
|
|
381
|
+
location: SourceLocation;
|
|
382
|
+
/** Operation performed */
|
|
383
|
+
operation?: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Example code for documentation
|
|
387
|
+
*/
|
|
388
|
+
export interface CodeExample {
|
|
389
|
+
/** The example code */
|
|
390
|
+
code: string;
|
|
391
|
+
/** Language of the example */
|
|
392
|
+
language: SupportedLanguage;
|
|
393
|
+
/** Whether this is a vulnerable example */
|
|
394
|
+
isVulnerable: boolean;
|
|
395
|
+
/** Description of the example */
|
|
396
|
+
description: string;
|
|
397
|
+
/** If safe, explanation of why */
|
|
398
|
+
safetyExplanation?: string;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Impact assessment following CVSS-like scoring
|
|
402
|
+
*/
|
|
403
|
+
export interface ImpactAssessment {
|
|
404
|
+
/** Confidentiality impact (none, low, medium, high) */
|
|
405
|
+
confidentiality: 'none' | 'low' | 'medium' | 'high';
|
|
406
|
+
/** Integrity impact (none, low, medium, high) */
|
|
407
|
+
integrity: 'none' | 'low' | 'medium' | 'high';
|
|
408
|
+
/** Availability impact (none, low, medium, high) */
|
|
409
|
+
availability: 'none' | 'low' | 'medium' | 'high';
|
|
410
|
+
/** Scope (unchanged, changed) */
|
|
411
|
+
scope?: 'unchanged' | 'changed';
|
|
412
|
+
/** Technical impact description */
|
|
413
|
+
technicalImpact: string;
|
|
414
|
+
/** Business impact description */
|
|
415
|
+
businessImpact: string;
|
|
416
|
+
/** Affected assets */
|
|
417
|
+
affectedAssets?: string[];
|
|
418
|
+
/** Data at risk */
|
|
419
|
+
dataAtRisk?: string[];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Exploitability assessment
|
|
423
|
+
*/
|
|
424
|
+
export interface ExploitabilityAssessment {
|
|
425
|
+
/** Attack vector (network, adjacent, local, physical) */
|
|
426
|
+
attackVector: 'network' | 'adjacent' | 'local' | 'physical';
|
|
427
|
+
/** Attack complexity (low, medium, high) */
|
|
428
|
+
attackComplexity: 'low' | 'medium' | 'high';
|
|
429
|
+
/** Privileges required (none, low, high) */
|
|
430
|
+
privilegesRequired: 'none' | 'low' | 'high';
|
|
431
|
+
/** User interaction (none, required) */
|
|
432
|
+
userInteraction: 'none' | 'required';
|
|
433
|
+
/** Known exploits in the wild */
|
|
434
|
+
knownExploits?: boolean;
|
|
435
|
+
/** Exploit difficulty description */
|
|
436
|
+
exploitDifficulty?: string;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Remediation guidance
|
|
440
|
+
*/
|
|
441
|
+
export interface RemediationGuidance {
|
|
442
|
+
/** Short remediation summary */
|
|
443
|
+
summary: string;
|
|
444
|
+
/** Detailed steps */
|
|
445
|
+
steps: string[];
|
|
446
|
+
/** Secure code example */
|
|
447
|
+
secureCodeExample?: string;
|
|
448
|
+
/** References for more information */
|
|
449
|
+
references?: string[];
|
|
450
|
+
/** Estimated effort (low, medium, high) */
|
|
451
|
+
effort?: 'low' | 'medium' | 'high';
|
|
452
|
+
/** Priority for fixing */
|
|
453
|
+
priority?: 'immediate' | 'high' | 'medium' | 'low';
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Rule correlation configuration
|
|
457
|
+
*/
|
|
458
|
+
export interface RuleCorrelation {
|
|
459
|
+
/** Rules that increase severity when both match */
|
|
460
|
+
amplifyWith?: string[];
|
|
461
|
+
/** Rules that must also match for this rule to trigger */
|
|
462
|
+
requiresAlso?: string[];
|
|
463
|
+
/** Rules that suppress this rule when matched */
|
|
464
|
+
suppressedBy?: string[];
|
|
465
|
+
/** Severity boost when correlated rules match */
|
|
466
|
+
severityBoost?: number;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Context conditions for severity adjustment
|
|
470
|
+
*/
|
|
471
|
+
export interface ContextConditions {
|
|
472
|
+
/** Boost severity if in production code */
|
|
473
|
+
productionBoost?: number;
|
|
474
|
+
/** Reduce severity if in test code */
|
|
475
|
+
testCodePenalty?: number;
|
|
476
|
+
/** Boost if handles sensitive data */
|
|
477
|
+
sensitiveDataBoost?: number;
|
|
478
|
+
/** File path patterns to adjust severity */
|
|
479
|
+
filePatterns?: Array<{
|
|
480
|
+
pattern: string;
|
|
481
|
+
severityAdjustment: number;
|
|
482
|
+
}>;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Comprehensive vulnerability detection rule
|
|
486
|
+
*/
|
|
487
|
+
export interface VulnerabilityRule {
|
|
488
|
+
/** Unique rule identifier (e.g., VUL-SQLI-001) */
|
|
489
|
+
id: string;
|
|
490
|
+
/** Human-readable rule name */
|
|
491
|
+
name: string;
|
|
492
|
+
/** Detailed technical description */
|
|
493
|
+
description: string;
|
|
494
|
+
/** Version of the rule */
|
|
495
|
+
version?: string;
|
|
496
|
+
/** Specific vulnerability type */
|
|
497
|
+
vulnerabilityType: VulnerabilityType;
|
|
498
|
+
/** Vulnerability category */
|
|
499
|
+
category: VulnerabilityCategory;
|
|
500
|
+
/** Languages this rule applies to */
|
|
501
|
+
languages: SupportedLanguage[];
|
|
502
|
+
/** Base severity level */
|
|
503
|
+
severity: VulnerabilitySeverity;
|
|
504
|
+
/** Detection confidence */
|
|
505
|
+
confidence: ConfidenceLevel;
|
|
506
|
+
/** Primary detection patterns */
|
|
507
|
+
patterns: VulnerabilityPattern[];
|
|
508
|
+
/** Secondary patterns that increase severity */
|
|
509
|
+
amplifyingPatterns?: VulnerabilityPattern[];
|
|
510
|
+
/** Patterns that indicate false positive */
|
|
511
|
+
falsePositivePatterns?: VulnerabilityPattern[];
|
|
512
|
+
/** Taint sources for this vulnerability */
|
|
513
|
+
taintSources?: TaintSource[];
|
|
514
|
+
/** Taint sinks for this vulnerability */
|
|
515
|
+
taintSinks?: TaintSink[];
|
|
516
|
+
/** Sanitizers that prevent this vulnerability */
|
|
517
|
+
taintSanitizers?: TaintSanitizer[];
|
|
518
|
+
/** Simplified taint analysis config (sources, sinks, sanitizers as strings) */
|
|
519
|
+
taintAnalysis?: {
|
|
520
|
+
sources: string[];
|
|
521
|
+
sinks: string[];
|
|
522
|
+
sanitizers?: string[];
|
|
523
|
+
};
|
|
524
|
+
/** Rule correlation configuration */
|
|
525
|
+
correlation?: RuleCorrelation;
|
|
526
|
+
/** Context conditions for severity adjustment */
|
|
527
|
+
contextConditions?: ContextConditions;
|
|
528
|
+
/** Base score contribution (0-100) */
|
|
529
|
+
baseScore?: number;
|
|
530
|
+
/** Scoring factors */
|
|
531
|
+
scoringFactors?: ScoringFactors;
|
|
532
|
+
/** Impact assessment */
|
|
533
|
+
impact: ImpactAssessment;
|
|
534
|
+
/** Exploitability assessment */
|
|
535
|
+
exploitability?: ExploitabilityAssessment;
|
|
536
|
+
/** Example vulnerable code */
|
|
537
|
+
vulnerableExamples?: CodeExample[];
|
|
538
|
+
/** Example secure code */
|
|
539
|
+
secureExamples?: CodeExample[];
|
|
540
|
+
/** Known false positive examples */
|
|
541
|
+
falsePositiveExamples?: CodeExample[];
|
|
542
|
+
/** Remediation guidance */
|
|
543
|
+
remediation: RemediationGuidance;
|
|
544
|
+
/** Security standard references */
|
|
545
|
+
standards: SecurityStandards;
|
|
546
|
+
/** Tags for categorization */
|
|
547
|
+
tags: string[];
|
|
548
|
+
/** Whether the rule is enabled */
|
|
549
|
+
enabled: boolean;
|
|
550
|
+
/** Author of the rule */
|
|
551
|
+
author?: string;
|
|
552
|
+
/** Creation date */
|
|
553
|
+
createdAt?: string;
|
|
554
|
+
/** Last update date */
|
|
555
|
+
updatedAt?: string;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Scoring factors for dynamic severity calculation
|
|
559
|
+
*/
|
|
560
|
+
export interface ScoringFactors {
|
|
561
|
+
/** Taint flow weight */
|
|
562
|
+
taintFlowWeight?: number;
|
|
563
|
+
/** Pattern count weight */
|
|
564
|
+
patternCountWeight?: number;
|
|
565
|
+
/** Exploitability weight */
|
|
566
|
+
exploitabilityWeight?: number;
|
|
567
|
+
/** Impact weight */
|
|
568
|
+
impactWeight?: number;
|
|
569
|
+
/** Context weight */
|
|
570
|
+
contextWeight?: number;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Vulnerability score breakdown
|
|
574
|
+
*/
|
|
575
|
+
export interface VulnerabilityScoreBreakdown {
|
|
576
|
+
/** Base score from rule */
|
|
577
|
+
baseScore: number;
|
|
578
|
+
/** Score from pattern matches */
|
|
579
|
+
patternScore: number;
|
|
580
|
+
/** Score from taint analysis */
|
|
581
|
+
taintScore: number;
|
|
582
|
+
/** Score from exploitability */
|
|
583
|
+
exploitabilityScore: number;
|
|
584
|
+
/** Score from impact assessment */
|
|
585
|
+
impactScore: number;
|
|
586
|
+
/** Score from context analysis */
|
|
587
|
+
contextScore: number;
|
|
588
|
+
/** Penalty for false positive indicators */
|
|
589
|
+
falsePositivePenalty: number;
|
|
590
|
+
/** Boost from correlated rules */
|
|
591
|
+
correlationBoost: number;
|
|
592
|
+
/** Final calculated score */
|
|
593
|
+
totalScore: number;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Complete vulnerability score result
|
|
597
|
+
*/
|
|
598
|
+
export interface VulnerabilityScore {
|
|
599
|
+
/** Numeric score (0-100) */
|
|
600
|
+
score: number;
|
|
601
|
+
/** Score breakdown */
|
|
602
|
+
breakdown: VulnerabilityScoreBreakdown;
|
|
603
|
+
/** Calculated severity from score */
|
|
604
|
+
calculatedSeverity: VulnerabilitySeverity;
|
|
605
|
+
/** Risk level description */
|
|
606
|
+
riskLevel: 'critical' | 'high' | 'medium' | 'low' | 'minimal';
|
|
607
|
+
/** Explanation of the score */
|
|
608
|
+
explanation: string;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Location of a finding in source code
|
|
612
|
+
*/
|
|
613
|
+
export interface SourceLocation {
|
|
614
|
+
/** File path */
|
|
615
|
+
filePath: string;
|
|
616
|
+
/** Starting line number (1-based) */
|
|
617
|
+
startLine: number;
|
|
618
|
+
/** Ending line number (1-based) */
|
|
619
|
+
endLine: number;
|
|
620
|
+
/** Starting column (0-based) */
|
|
621
|
+
startColumn?: number;
|
|
622
|
+
/** Ending column (0-based) */
|
|
623
|
+
endColumn?: number;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Pattern match details
|
|
627
|
+
*/
|
|
628
|
+
export interface PatternMatch {
|
|
629
|
+
/** Pattern that matched */
|
|
630
|
+
pattern: VulnerabilityPattern;
|
|
631
|
+
/** Matched text */
|
|
632
|
+
matchedText: string;
|
|
633
|
+
/** Location of the match */
|
|
634
|
+
location: SourceLocation;
|
|
635
|
+
/** Capture groups if regex */
|
|
636
|
+
captures?: string[];
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Data flow trace for audit reporting
|
|
640
|
+
*/
|
|
641
|
+
export interface DataFlowTrace {
|
|
642
|
+
/** Starting source */
|
|
643
|
+
source: {
|
|
644
|
+
name: string;
|
|
645
|
+
location: SourceLocation;
|
|
646
|
+
codeSnippet: string;
|
|
647
|
+
};
|
|
648
|
+
/** Intermediate steps */
|
|
649
|
+
propagation: Array<{
|
|
650
|
+
variable: string;
|
|
651
|
+
location: SourceLocation;
|
|
652
|
+
operation: string;
|
|
653
|
+
codeSnippet: string;
|
|
654
|
+
}>;
|
|
655
|
+
/** Ending sink */
|
|
656
|
+
sink: {
|
|
657
|
+
name: string;
|
|
658
|
+
location: SourceLocation;
|
|
659
|
+
codeSnippet: string;
|
|
660
|
+
};
|
|
661
|
+
/** Was the data sanitized? */
|
|
662
|
+
sanitized: boolean;
|
|
663
|
+
/** Sanitization details if applicable */
|
|
664
|
+
sanitizationDetails?: {
|
|
665
|
+
sanitizer: string;
|
|
666
|
+
location: SourceLocation;
|
|
667
|
+
effectiveness: number;
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Complete vulnerability finding
|
|
672
|
+
*/
|
|
673
|
+
export interface VulnerabilityFinding {
|
|
674
|
+
/** Unique finding ID */
|
|
675
|
+
id: string;
|
|
676
|
+
/** Rule that triggered this finding */
|
|
677
|
+
ruleId: string;
|
|
678
|
+
/** Rule name */
|
|
679
|
+
ruleName: string;
|
|
680
|
+
/** Source code location */
|
|
681
|
+
location: SourceLocation;
|
|
682
|
+
/** Code snippet */
|
|
683
|
+
codeSnippet: string;
|
|
684
|
+
/** Highlighted portion */
|
|
685
|
+
highlightedCode?: string;
|
|
686
|
+
/** Vulnerability type */
|
|
687
|
+
vulnerabilityType: VulnerabilityType;
|
|
688
|
+
/** Vulnerability category */
|
|
689
|
+
category: VulnerabilityCategory;
|
|
690
|
+
/** Final severity */
|
|
691
|
+
severity: VulnerabilitySeverity;
|
|
692
|
+
/** Confidence level */
|
|
693
|
+
confidence: ConfidenceLevel;
|
|
694
|
+
/** Vulnerability score */
|
|
695
|
+
score: VulnerabilityScore;
|
|
696
|
+
/** Patterns that matched */
|
|
697
|
+
patternMatches: PatternMatch[];
|
|
698
|
+
/** Taint flow if detected */
|
|
699
|
+
taintFlow?: TaintFlow;
|
|
700
|
+
/** Data flow trace for audit */
|
|
701
|
+
dataFlowTrace?: DataFlowTrace;
|
|
702
|
+
/** Correlated findings */
|
|
703
|
+
correlatedFindings?: string[];
|
|
704
|
+
/** Human-readable message */
|
|
705
|
+
message: string;
|
|
706
|
+
/** Detailed analysis for auditors */
|
|
707
|
+
auditAnalysis: string;
|
|
708
|
+
/** Developer-friendly explanation */
|
|
709
|
+
developerExplanation: string;
|
|
710
|
+
/** Remediation guidance */
|
|
711
|
+
remediation: RemediationGuidance;
|
|
712
|
+
/** Security standard references */
|
|
713
|
+
standards: SecurityStandards;
|
|
714
|
+
/** Detection timestamp */
|
|
715
|
+
detectedAt: string;
|
|
716
|
+
/** Language of the code */
|
|
717
|
+
language: SupportedLanguage;
|
|
718
|
+
/** Is in test code */
|
|
719
|
+
isTestCode?: boolean;
|
|
720
|
+
/** Is in vendor/node_modules */
|
|
721
|
+
isVendorCode?: boolean;
|
|
722
|
+
/** Additional context */
|
|
723
|
+
context?: Record<string, unknown>;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Analysis context for rule evaluation
|
|
727
|
+
*/
|
|
728
|
+
export interface AnalysisContext {
|
|
729
|
+
/** File being analyzed */
|
|
730
|
+
filePath: string;
|
|
731
|
+
/** File content */
|
|
732
|
+
content: string;
|
|
733
|
+
/** Detected language */
|
|
734
|
+
language: SupportedLanguage;
|
|
735
|
+
/** AST if available */
|
|
736
|
+
ast?: unknown;
|
|
737
|
+
/** Control flow graph if available */
|
|
738
|
+
cfg?: unknown;
|
|
739
|
+
/** Call graph if available */
|
|
740
|
+
callGraph?: unknown;
|
|
741
|
+
/** Detected taint flows */
|
|
742
|
+
taintFlows?: TaintFlow[];
|
|
743
|
+
/** Dependencies if available */
|
|
744
|
+
dependencies?: string[];
|
|
745
|
+
/** Is this in node_modules or vendor */
|
|
746
|
+
isVendorCode?: boolean;
|
|
747
|
+
/** Is this a test file */
|
|
748
|
+
isTestFile?: boolean;
|
|
749
|
+
/** Is this production code */
|
|
750
|
+
isProductionCode?: boolean;
|
|
751
|
+
/** File handles sensitive data */
|
|
752
|
+
handlesSensitiveData?: boolean;
|
|
753
|
+
/** Previous findings in this file */
|
|
754
|
+
previousFindings?: VulnerabilityFinding[];
|
|
755
|
+
/** Findings from related files */
|
|
756
|
+
relatedFindings?: VulnerabilityFinding[];
|
|
757
|
+
/** Project configuration */
|
|
758
|
+
projectConfig?: ProjectConfig;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Project configuration for context-aware analysis
|
|
762
|
+
*/
|
|
763
|
+
export interface ProjectConfig {
|
|
764
|
+
/** Framework being used */
|
|
765
|
+
framework?: string;
|
|
766
|
+
/** Production vs development */
|
|
767
|
+
environment?: 'production' | 'development' | 'staging';
|
|
768
|
+
/** Configured security headers */
|
|
769
|
+
securityHeaders?: string[];
|
|
770
|
+
/** Enabled security features */
|
|
771
|
+
securityFeatures?: string[];
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Analysis options
|
|
775
|
+
*/
|
|
776
|
+
export interface AnalysisOptions {
|
|
777
|
+
/** Enable taint analysis */
|
|
778
|
+
enableTaintAnalysis?: boolean;
|
|
779
|
+
/** Enable AST analysis */
|
|
780
|
+
enableAstAnalysis?: boolean;
|
|
781
|
+
/** Enable CFG analysis */
|
|
782
|
+
enableCfgAnalysis?: boolean;
|
|
783
|
+
/** Minimum confidence to report */
|
|
784
|
+
minConfidence?: ConfidenceLevel;
|
|
785
|
+
/** Maximum findings per file */
|
|
786
|
+
maxFindingsPerFile?: number;
|
|
787
|
+
/** Timeout per rule in ms */
|
|
788
|
+
ruleTimeoutMs?: number;
|
|
789
|
+
/** Include info severity */
|
|
790
|
+
includeInfo?: boolean;
|
|
791
|
+
/** Exclude test files */
|
|
792
|
+
excludeTestFiles?: boolean;
|
|
793
|
+
/** Exclude vendor code */
|
|
794
|
+
excludeVendorCode?: boolean;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Pattern matcher interface
|
|
798
|
+
*/
|
|
799
|
+
export interface IPatternMatcher {
|
|
800
|
+
match(content: string, patterns: VulnerabilityPattern[], language: SupportedLanguage): PatternMatch[];
|
|
801
|
+
matchWithTimeout(content: string, patterns: VulnerabilityPattern[], language: SupportedLanguage, timeout: number): Promise<PatternMatch[]>;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Taint analyzer interface
|
|
805
|
+
*/
|
|
806
|
+
export interface ITaintAnalyzer {
|
|
807
|
+
analyze(context: AnalysisContext, sources: TaintSource[], sinks: TaintSink[], sanitizers?: TaintSanitizer[]): TaintFlow[];
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Score calculator interface
|
|
811
|
+
*/
|
|
812
|
+
export interface IScoreCalculator {
|
|
813
|
+
calculateScore(rule: VulnerabilityRule, matches: PatternMatch[], context: AnalysisContext, taintFlow?: TaintFlow): VulnerabilityScore;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Vulnerability rule engine interface
|
|
817
|
+
*/
|
|
818
|
+
export interface IVulnerabilityRuleEngine {
|
|
819
|
+
/** Analyze code against all enabled rules */
|
|
820
|
+
analyze(context: AnalysisContext, options?: AnalysisOptions): Promise<VulnerabilityFinding[]>;
|
|
821
|
+
/** Get all registered rules */
|
|
822
|
+
getRules(): VulnerabilityRule[];
|
|
823
|
+
/** Get rule by ID */
|
|
824
|
+
getRule(id: string): VulnerabilityRule | undefined;
|
|
825
|
+
/** Enable/disable a rule */
|
|
826
|
+
setRuleEnabled(id: string, enabled: boolean): void;
|
|
827
|
+
/** Add a custom rule */
|
|
828
|
+
addRule(rule: VulnerabilityRule): void;
|
|
829
|
+
}
|
|
830
|
+
//# sourceMappingURL=index.d.ts.map
|