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