@openai/codex-security 0.9.1 → 0.10.1

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 (444) hide show
  1. package/README.md +37 -788
  2. package/_bundled_plugin/.codex-plugin/plugin.json +2 -0
  3. package/_bundled_plugin/.mcp.json +3 -0
  4. package/_bundled_plugin/mcp/helpers.mjs.br +0 -0
  5. package/_bundled_plugin/mcp/native/darwin-arm64/unix.node +0 -0
  6. package/_bundled_plugin/mcp/native/darwin-x64/unix.node +0 -0
  7. package/_bundled_plugin/mcp/native/linux-arm64-gnu/unix.node +0 -0
  8. package/_bundled_plugin/mcp/native/linux-arm64-musl/unix.node +0 -0
  9. package/_bundled_plugin/mcp/native/linux-x64-gnu/unix.node +0 -0
  10. package/_bundled_plugin/mcp/native/linux-x64-musl/unix.node +0 -0
  11. package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
  12. package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
  13. package/_bundled_plugin/mcp/server.mjs.br +0 -0
  14. package/_bundled_plugin/references/access-advisory.md +1 -1
  15. package/_bundled_plugin/references/artifact-storage.md +1 -1
  16. package/_bundled_plugin/references/baseline-auditor.md +18 -0
  17. package/_bundled_plugin/references/core-scan.md +5 -42
  18. package/_bundled_plugin/references/final-report.md +1 -1
  19. package/_bundled_plugin/references/focused-investigator.md +13 -0
  20. package/_bundled_plugin/references/scan-prologue.md +2 -2
  21. package/_bundled_plugin/references/scan-runtime.md +4 -2
  22. package/_bundled_plugin/references/security-guidance.md +14 -1
  23. package/_bundled_plugin/references/threat-model.md +1 -0
  24. package/_bundled_plugin/references/validate-scan-findings.md +3 -0
  25. package/_bundled_plugin/scripts/deep_scan_workbench.py +30 -12
  26. package/_bundled_plugin/scripts/dispatch_inventory_tool +7 -0
  27. package/_bundled_plugin/scripts/finalize_scan_contract.py +47 -9
  28. package/_bundled_plugin/scripts/launch_codex_security_mcp +54 -16
  29. package/_bundled_plugin/scripts/launch_codex_security_mcp.cmd +2 -0
  30. package/_bundled_plugin/scripts/posix_scan_local_files.py +26 -1
  31. package/_bundled_plugin/scripts/snapshot_sqlite.py +8 -2
  32. package/_bundled_plugin/scripts/windows_scan_local_files.py +216 -25
  33. package/_bundled_plugin/scripts/workbench/handoff.py +55 -25
  34. package/_bundled_plugin/scripts/workbench/storage.py +25 -5
  35. package/_bundled_plugin/scripts/workbench_cli.py +24 -2
  36. package/_bundled_plugin/scripts/workbench_constants.py +2 -0
  37. package/_bundled_plugin/scripts/workbench_db.py +257 -268
  38. package/_bundled_plugin/scripts/workbench_feedback.py +49 -4
  39. package/_bundled_plugin/scripts/workbench_native_indexes.py +226 -29
  40. package/_bundled_plugin/scripts/workbench_progress.py +159 -3
  41. package/_bundled_plugin/scripts/workbench_publication.py +2 -3
  42. package/_bundled_plugin/scripts/workbench_remediation.py +142 -2
  43. package/_bundled_plugin/scripts/workbench_saved_results.py +48 -8
  44. package/_bundled_plugin/scripts/workbench_scan_history.py +291 -134
  45. package/_bundled_plugin/scripts/workbench_scan_start.py +208 -11
  46. package/_bundled_plugin/scripts/workbench_scan_usage.py +36 -10
  47. package/_bundled_plugin/scripts/workbench_schema.py +220 -14
  48. package/_bundled_plugin/scripts/workbench_setup.py +1 -1
  49. package/_bundled_plugin/scripts/workbench_source_scopes.py +8 -0
  50. package/_bundled_plugin/scripts/workbench_target.py +486 -85
  51. package/_bundled_plugin/scripts/workbench_target_state.py +1108 -22
  52. package/_bundled_plugin/shared/workbench-history-repairs.json +64 -14
  53. package/_bundled_plugin/shared/workbench-migrations.json +66 -0
  54. package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +4 -2
  55. package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +2 -2
  56. package/_bundled_plugin/skills/fix-finding/SKILL.md +1 -0
  57. package/_bundled_plugin/skills/publish-findings/SKILL.md +26 -160
  58. package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +2 -2
  59. package/_bundled_plugin/skills/publish-findings/references/checkmarx-import.md +2 -2
  60. package/_bundled_plugin/skills/publish-findings/scripts/collect_checkmarx.py +3 -58
  61. package/_bundled_plugin/skills/publish-findings/scripts/collector_paths.py +63 -0
  62. package/_bundled_plugin/skills/security-scan/SKILL.md +9 -46
  63. package/_bundled_plugin/skills/security-scan/agents/openai.yaml +2 -2
  64. package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +3 -21
  65. package/_bundled_plugin/skills/security-scan/references/managed-scan.md +11 -0
  66. package/_bundled_plugin/skills/security-scan/references/scan-results.md +15 -0
  67. package/_bundled_plugin/skills/security-scan/references/scoped-paths.md +23 -0
  68. package/_bundled_plugin/skills/security-scan/references/sdk-files.md +24 -0
  69. package/bin/codex-security.mjs +2 -2
  70. package/dist/api.d.ts +7 -1
  71. package/dist/api.d.ts.map +1 -1
  72. package/dist/api.js +459 -157
  73. package/dist/api.js.map +1 -1
  74. package/dist/armorcode-findings.d.ts +9 -0
  75. package/dist/armorcode-findings.d.ts.map +1 -0
  76. package/dist/armorcode-findings.js +145 -0
  77. package/dist/armorcode-findings.js.map +1 -0
  78. package/dist/artifact-export.d.ts +2 -0
  79. package/dist/artifact-export.d.ts.map +1 -1
  80. package/dist/artifact-export.js +29 -13
  81. package/dist/artifact-export.js.map +1 -1
  82. package/dist/auth.d.ts +6 -2
  83. package/dist/auth.d.ts.map +1 -1
  84. package/dist/auth.js +33 -12
  85. package/dist/auth.js.map +1 -1
  86. package/dist/batch-cost.d.ts +18 -0
  87. package/dist/batch-cost.d.ts.map +1 -0
  88. package/dist/batch-cost.js +41 -0
  89. package/dist/batch-cost.js.map +1 -0
  90. package/dist/blackduck-findings.d.ts +1 -1
  91. package/dist/blackduck-findings.d.ts.map +1 -1
  92. package/dist/blackduck-findings.js +5 -18
  93. package/dist/blackduck-findings.js.map +1 -1
  94. package/dist/bundled-plugin.d.ts +4 -0
  95. package/dist/bundled-plugin.d.ts.map +1 -0
  96. package/dist/bundled-plugin.js +23 -0
  97. package/dist/bundled-plugin.js.map +1 -0
  98. package/dist/classify-scan-severity.d.ts +1 -1
  99. package/dist/classify-scan-severity.d.ts.map +1 -1
  100. package/dist/classify-scan-severity.js +11 -3
  101. package/dist/classify-scan-severity.js.map +1 -1
  102. package/dist/classify-severity-diagnostics.d.ts +10 -0
  103. package/dist/classify-severity-diagnostics.d.ts.map +1 -0
  104. package/dist/classify-severity-diagnostics.js +57 -0
  105. package/dist/classify-severity-diagnostics.js.map +1 -0
  106. package/dist/classify-severity-records.d.ts +4 -0
  107. package/dist/classify-severity-records.d.ts.map +1 -1
  108. package/dist/classify-severity-records.js +35 -8
  109. package/dist/classify-severity-records.js.map +1 -1
  110. package/dist/classify-severity.d.ts.map +1 -1
  111. package/dist/classify-severity.js +9 -6
  112. package/dist/classify-severity.js.map +1 -1
  113. package/dist/cli-argument.d.ts +4 -0
  114. package/dist/cli-argument.d.ts.map +1 -0
  115. package/dist/cli-argument.js +17 -0
  116. package/dist/cli-argument.js.map +1 -0
  117. package/dist/cli-help.d.ts +1 -1
  118. package/dist/cli-help.d.ts.map +1 -1
  119. package/dist/cli-help.js +71 -29
  120. package/dist/cli-help.js.map +1 -1
  121. package/dist/cli-hook.d.ts +3 -0
  122. package/dist/cli-hook.d.ts.map +1 -0
  123. package/dist/cli-hook.js +87 -0
  124. package/dist/cli-hook.js.map +1 -0
  125. package/dist/cli-integrations.d.ts +13 -0
  126. package/dist/cli-integrations.d.ts.map +1 -0
  127. package/dist/cli-integrations.js +333 -0
  128. package/dist/cli-integrations.js.map +1 -0
  129. package/dist/cli-mcp.d.ts +15 -0
  130. package/dist/cli-mcp.d.ts.map +1 -0
  131. package/dist/cli-mcp.js +178 -0
  132. package/dist/cli-mcp.js.map +1 -0
  133. package/dist/cli-token-view.d.ts +10 -0
  134. package/dist/cli-token-view.d.ts.map +1 -0
  135. package/dist/cli-token-view.js +41 -0
  136. package/dist/cli-token-view.js.map +1 -0
  137. package/dist/cli.d.ts +8 -3
  138. package/dist/cli.d.ts.map +1 -1
  139. package/dist/cli.js +1860 -903
  140. package/dist/cli.js.map +1 -1
  141. package/dist/cloud-publish.d.ts.map +1 -1
  142. package/dist/cloud-publish.js +33 -31
  143. package/dist/cloud-publish.js.map +1 -1
  144. package/dist/codex-sdk-environment.d.ts +6 -0
  145. package/dist/codex-sdk-environment.d.ts.map +1 -1
  146. package/dist/codex-sdk-environment.js +19 -0
  147. package/dist/codex-sdk-environment.js.map +1 -1
  148. package/dist/command-words.d.ts +3 -0
  149. package/dist/command-words.d.ts.map +1 -0
  150. package/dist/command-words.js +46 -0
  151. package/dist/command-words.js.map +1 -0
  152. package/dist/component-plan.d.ts.map +1 -1
  153. package/dist/component-plan.js +3 -3
  154. package/dist/component-plan.js.map +1 -1
  155. package/dist/component-scan.d.ts +3 -1
  156. package/dist/component-scan.d.ts.map +1 -1
  157. package/dist/component-scan.js +40 -7
  158. package/dist/component-scan.js.map +1 -1
  159. package/dist/config.d.ts +1 -1
  160. package/dist/config.d.ts.map +1 -1
  161. package/dist/config.js +30 -1
  162. package/dist/config.js.map +1 -1
  163. package/dist/continuum-aws.d.ts +6 -0
  164. package/dist/continuum-aws.d.ts.map +1 -0
  165. package/dist/continuum-aws.js +202 -0
  166. package/dist/continuum-aws.js.map +1 -0
  167. package/dist/continuum-collector.d.ts +44 -0
  168. package/dist/continuum-collector.d.ts.map +1 -0
  169. package/dist/continuum-collector.js +266 -0
  170. package/dist/continuum-collector.js.map +1 -0
  171. package/dist/continuum-findings.d.ts +31 -2
  172. package/dist/continuum-findings.d.ts.map +1 -1
  173. package/dist/continuum-findings.js +497 -59
  174. package/dist/continuum-findings.js.map +1 -1
  175. package/dist/contract.d.ts +1 -0
  176. package/dist/contract.d.ts.map +1 -1
  177. package/dist/contract.js +3 -0
  178. package/dist/contract.js.map +1 -1
  179. package/dist/cost.d.ts.map +1 -1
  180. package/dist/cost.js +1 -45
  181. package/dist/cost.js.map +1 -1
  182. package/dist/crowdstrike-findings.d.ts +7 -0
  183. package/dist/crowdstrike-findings.d.ts.map +1 -0
  184. package/dist/crowdstrike-findings.js +210 -0
  185. package/dist/crowdstrike-findings.js.map +1 -0
  186. package/dist/custom-validation-prompt.d.ts +1 -1
  187. package/dist/custom-validation-prompt.d.ts.map +1 -1
  188. package/dist/custom-validation-prompt.js +29 -19
  189. package/dist/custom-validation-prompt.js.map +1 -1
  190. package/dist/deduplication/local.d.ts +3 -1
  191. package/dist/deduplication/local.d.ts.map +1 -1
  192. package/dist/deduplication/local.js +8 -1
  193. package/dist/deduplication/local.js.map +1 -1
  194. package/dist/deduplication/refusal.d.ts.map +1 -1
  195. package/dist/deduplication/refusal.js +2 -1
  196. package/dist/deduplication/refusal.js.map +1 -1
  197. package/dist/deduplication/scan.d.ts +2 -0
  198. package/dist/deduplication/scan.d.ts.map +1 -1
  199. package/dist/deduplication/scan.js +24 -7
  200. package/dist/deduplication/scan.js.map +1 -1
  201. package/dist/deep-scan.d.ts.map +1 -1
  202. package/dist/deep-scan.js +16 -15
  203. package/dist/deep-scan.js.map +1 -1
  204. package/dist/endor-findings.d.ts +2 -2
  205. package/dist/endor-findings.d.ts.map +1 -1
  206. package/dist/endor-findings.js +6 -23
  207. package/dist/endor-findings.js.map +1 -1
  208. package/dist/errors.d.ts +3 -1
  209. package/dist/errors.d.ts.map +1 -1
  210. package/dist/errors.js +7 -3
  211. package/dist/errors.js.map +1 -1
  212. package/dist/executable-path.d.ts +3 -0
  213. package/dist/executable-path.d.ts.map +1 -1
  214. package/dist/executable-path.js +26 -0
  215. package/dist/executable-path.js.map +1 -1
  216. package/dist/external-findings-import.d.ts.map +1 -1
  217. package/dist/external-findings-import.js +12 -1
  218. package/dist/external-findings-import.js.map +1 -1
  219. package/dist/external-findings-local.d.ts +66 -4
  220. package/dist/external-findings-local.d.ts.map +1 -1
  221. package/dist/external-findings-local.js +258 -59
  222. package/dist/external-findings-local.js.map +1 -1
  223. package/dist/external-findings-publish.d.ts +6 -1
  224. package/dist/external-findings-publish.d.ts.map +1 -1
  225. package/dist/external-findings-publish.js +330 -1633
  226. package/dist/external-findings-publish.js.map +1 -1
  227. package/dist/external-findings-read.d.ts +11 -2
  228. package/dist/external-findings-read.d.ts.map +1 -1
  229. package/dist/external-findings-read.js +56 -53
  230. package/dist/external-findings-read.js.map +1 -1
  231. package/dist/external-findings.d.ts +1 -1
  232. package/dist/external-findings.d.ts.map +1 -1
  233. package/dist/external-findings.js +12 -1
  234. package/dist/external-findings.js.map +1 -1
  235. package/dist/external-import-contract.d.ts +6 -11
  236. package/dist/external-import-contract.d.ts.map +1 -1
  237. package/dist/external-import-contract.js +35 -177
  238. package/dist/external-import-contract.js.map +1 -1
  239. package/dist/external-import-models.d.ts +1 -1
  240. package/dist/external-import-models.d.ts.map +1 -1
  241. package/dist/external-import-models.js.map +1 -1
  242. package/dist/finding-prompt.d.ts.map +1 -1
  243. package/dist/finding-prompt.js +2 -2
  244. package/dist/finding-prompt.js.map +1 -1
  245. package/dist/github-dependabot-findings.d.ts.map +1 -1
  246. package/dist/github-dependabot-findings.js +3 -4
  247. package/dist/github-dependabot-findings.js.map +1 -1
  248. package/dist/github-findings.d.ts.map +1 -1
  249. package/dist/github-findings.js +19 -287
  250. package/dist/github-findings.js.map +1 -1
  251. package/dist/host-protocol.d.ts +6 -0
  252. package/dist/host-protocol.d.ts.map +1 -1
  253. package/dist/host-protocol.js +11 -1
  254. package/dist/host-protocol.js.map +1 -1
  255. package/dist/host-records-protocol.d.ts +2 -0
  256. package/dist/host-records-protocol.d.ts.map +1 -1
  257. package/dist/host-records-protocol.js +4 -0
  258. package/dist/host-records-protocol.js.map +1 -1
  259. package/dist/hosted-remediation.d.ts +1 -0
  260. package/dist/hosted-remediation.d.ts.map +1 -1
  261. package/dist/hosted-remediation.js +23 -3
  262. package/dist/hosted-remediation.js.map +1 -1
  263. package/dist/index.d.ts +5 -3
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js +3 -1
  266. package/dist/index.js.map +1 -1
  267. package/dist/inspector-findings.d.ts.map +1 -1
  268. package/dist/inspector-findings.js +19 -35
  269. package/dist/inspector-findings.js.map +1 -1
  270. package/dist/knowledge-base.d.ts +1 -1
  271. package/dist/knowledge-base.d.ts.map +1 -1
  272. package/dist/knowledge-base.js +34 -27
  273. package/dist/knowledge-base.js.map +1 -1
  274. package/dist/linear.d.ts +11 -0
  275. package/dist/linear.d.ts.map +1 -1
  276. package/dist/linear.js.map +1 -1
  277. package/dist/local-git-metadata.d.ts +5 -2
  278. package/dist/local-git-metadata.d.ts.map +1 -1
  279. package/dist/local-git-metadata.js +8 -4
  280. package/dist/local-git-metadata.js.map +1 -1
  281. package/dist/multiscan.d.ts +4 -0
  282. package/dist/multiscan.d.ts.map +1 -1
  283. package/dist/multiscan.js +83 -39
  284. package/dist/multiscan.js.map +1 -1
  285. package/dist/opengrep-findings.d.ts +4 -2
  286. package/dist/opengrep-findings.d.ts.map +1 -1
  287. package/dist/opengrep-findings.js +39 -22
  288. package/dist/opengrep-findings.js.map +1 -1
  289. package/dist/private-finding-import.d.ts +8 -13
  290. package/dist/private-finding-import.d.ts.map +1 -1
  291. package/dist/private-finding-import.js +69 -129
  292. package/dist/private-finding-import.js.map +1 -1
  293. package/dist/project-config-schema.d.ts +2 -0
  294. package/dist/project-config-schema.d.ts.map +1 -1
  295. package/dist/project-config-schema.js +1 -0
  296. package/dist/project-config-schema.js.map +1 -1
  297. package/dist/project-config.d.ts +1 -0
  298. package/dist/project-config.d.ts.map +1 -1
  299. package/dist/project-config.js +56 -13
  300. package/dist/project-config.js.map +1 -1
  301. package/dist/prompt-files.d.ts +7 -2
  302. package/dist/prompt-files.d.ts.map +1 -1
  303. package/dist/prompt-files.js +42 -20
  304. package/dist/prompt-files.js.map +1 -1
  305. package/dist/provider-profile.d.ts.map +1 -1
  306. package/dist/provider-profile.js +4 -9
  307. package/dist/provider-profile.js.map +1 -1
  308. package/dist/publication.d.ts +1 -1
  309. package/dist/publication.d.ts.map +1 -1
  310. package/dist/publication.js.map +1 -1
  311. package/dist/record.d.ts +1 -5
  312. package/dist/record.d.ts.map +1 -1
  313. package/dist/record.js +3 -51
  314. package/dist/record.js.map +1 -1
  315. package/dist/remediation.d.ts.map +1 -1
  316. package/dist/remediation.js +3 -1
  317. package/dist/remediation.js.map +1 -1
  318. package/dist/runtime.d.ts +35 -7
  319. package/dist/runtime.d.ts.map +1 -1
  320. package/dist/runtime.js +782 -153
  321. package/dist/runtime.js.map +1 -1
  322. package/dist/saved-scan-bootstrap.d.ts +6 -1
  323. package/dist/saved-scan-bootstrap.d.ts.map +1 -1
  324. package/dist/saved-scan-bootstrap.js +267 -115
  325. package/dist/saved-scan-bootstrap.js.map +1 -1
  326. package/dist/scan-archive-path.d.ts +2 -0
  327. package/dist/scan-archive-path.d.ts.map +1 -0
  328. package/dist/scan-archive-path.js +5 -0
  329. package/dist/scan-archive-path.js.map +1 -0
  330. package/dist/scan-comparison.d.ts +20 -2
  331. package/dist/scan-comparison.d.ts.map +1 -1
  332. package/dist/scan-comparison.js +26 -5
  333. package/dist/scan-comparison.js.map +1 -1
  334. package/dist/scan-dashboard.d.ts +1 -0
  335. package/dist/scan-dashboard.d.ts.map +1 -1
  336. package/dist/scan-dashboard.js +18 -2
  337. package/dist/scan-dashboard.js.map +1 -1
  338. package/dist/scan-executor.d.ts.map +1 -1
  339. package/dist/scan-executor.js +4 -2
  340. package/dist/scan-executor.js.map +1 -1
  341. package/dist/scan-history-renderer.d.ts +1 -0
  342. package/dist/scan-history-renderer.d.ts.map +1 -1
  343. package/dist/scan-history-renderer.js +25 -9
  344. package/dist/scan-history-renderer.js.map +1 -1
  345. package/dist/scan-logs.d.ts.map +1 -1
  346. package/dist/scan-logs.js +28 -4
  347. package/dist/scan-logs.js.map +1 -1
  348. package/dist/scan-settings.d.ts +1 -0
  349. package/dist/scan-settings.d.ts.map +1 -1
  350. package/dist/scan-settings.js +1 -0
  351. package/dist/scan-settings.js.map +1 -1
  352. package/dist/scanner-import.d.ts +5 -11
  353. package/dist/scanner-import.d.ts.map +1 -1
  354. package/dist/scanner-import.js +16 -89
  355. package/dist/scanner-import.js.map +1 -1
  356. package/dist/security-policy.d.ts.map +1 -1
  357. package/dist/security-policy.js +26 -6
  358. package/dist/security-policy.js.map +1 -1
  359. package/dist/semgrep-findings.d.ts.map +1 -1
  360. package/dist/semgrep-findings.js +14 -48
  361. package/dist/semgrep-findings.js.map +1 -1
  362. package/dist/semgrep-platform-findings.d.ts +20 -70
  363. package/dist/semgrep-platform-findings.d.ts.map +1 -1
  364. package/dist/semgrep-platform-findings.js +116 -333
  365. package/dist/semgrep-platform-findings.js.map +1 -1
  366. package/dist/severity-review.d.ts.map +1 -1
  367. package/dist/severity-review.js +1 -0
  368. package/dist/severity-review.js.map +1 -1
  369. package/dist/snyk-findings.d.ts +2 -0
  370. package/dist/snyk-findings.d.ts.map +1 -1
  371. package/dist/snyk-findings.js +5 -8
  372. package/dist/snyk-findings.js.map +1 -1
  373. package/dist/snyk-rest-findings.d.ts +3 -20
  374. package/dist/snyk-rest-findings.d.ts.map +1 -1
  375. package/dist/snyk-rest-findings.js +45 -217
  376. package/dist/snyk-rest-findings.js.map +1 -1
  377. package/dist/sonar-findings.d.ts +1 -1
  378. package/dist/sonar-findings.d.ts.map +1 -1
  379. package/dist/sonar-findings.js +2 -4
  380. package/dist/sonar-findings.js.map +1 -1
  381. package/dist/sonar-import.d.ts +3 -0
  382. package/dist/sonar-import.d.ts.map +1 -1
  383. package/dist/sonar-import.js +28 -30
  384. package/dist/sonar-import.js.map +1 -1
  385. package/dist/stored-finding-projection.d.ts +6 -0
  386. package/dist/stored-finding-projection.d.ts.map +1 -0
  387. package/dist/stored-finding-projection.js +129 -0
  388. package/dist/stored-finding-projection.js.map +1 -0
  389. package/dist/stored-findings-publication.d.ts +23 -0
  390. package/dist/stored-findings-publication.d.ts.map +1 -0
  391. package/dist/stored-findings-publication.js +169 -0
  392. package/dist/stored-findings-publication.js.map +1 -0
  393. package/dist/targets.d.ts +8 -1
  394. package/dist/targets.d.ts.map +1 -1
  395. package/dist/targets.js +103 -23
  396. package/dist/targets.js.map +1 -1
  397. package/dist/tenable-findings.d.ts +1 -4
  398. package/dist/tenable-findings.d.ts.map +1 -1
  399. package/dist/tenable-findings.js.map +1 -1
  400. package/dist/trivy-findings.d.ts.map +1 -1
  401. package/dist/trivy-findings.js +0 -11
  402. package/dist/trivy-findings.js.map +1 -1
  403. package/dist/trusted-executable.d.ts +7 -0
  404. package/dist/trusted-executable.d.ts.map +1 -1
  405. package/dist/trusted-executable.js +148 -37
  406. package/dist/trusted-executable.js.map +1 -1
  407. package/dist/value.js +3 -1
  408. package/dist/value.js.map +1 -1
  409. package/dist/veracode-findings.d.ts +1 -3
  410. package/dist/veracode-findings.d.ts.map +1 -1
  411. package/dist/veracode-findings.js +13 -38
  412. package/dist/veracode-findings.js.map +1 -1
  413. package/dist/version.d.ts +3 -1
  414. package/dist/version.d.ts.map +1 -1
  415. package/dist/version.js +184 -32
  416. package/dist/version.js.map +1 -1
  417. package/dist/wiz-findings.d.ts +2 -2
  418. package/dist/wiz-findings.d.ts.map +1 -1
  419. package/dist/wiz-findings.js +14 -92
  420. package/dist/wiz-findings.js.map +1 -1
  421. package/docs/classify-severity-records.md +30 -0
  422. package/docs/cli.md +537 -124
  423. package/docs/findings-service.md +22 -9
  424. package/docs/hosted-remediation.md +13 -4
  425. package/docs/sdk.md +918 -0
  426. package/package.json +15 -6
  427. package/schemas/external-findings.schema.json +2 -1
  428. package/schemas/project-config.schema.json +5 -0
  429. package/dist/hosted-scanner-v1.d.ts +0 -6
  430. package/dist/hosted-scanner-v1.d.ts.map +0 -1
  431. package/dist/hosted-scanner-v1.js +0 -60
  432. package/dist/hosted-scanner-v1.js.map +0 -1
  433. package/dist/reader-selection.d.ts +0 -15
  434. package/dist/reader-selection.d.ts.map +0 -1
  435. package/dist/reader-selection.js +0 -89
  436. package/dist/reader-selection.js.map +0 -1
  437. package/dist/semgrep-platform-v1.d.ts +0 -6
  438. package/dist/semgrep-platform-v1.d.ts.map +0 -1
  439. package/dist/semgrep-platform-v1.js +0 -83
  440. package/dist/semgrep-platform-v1.js.map +0 -1
  441. package/dist/snyk-rest-v1.d.ts +0 -28
  442. package/dist/snyk-rest-v1.d.ts.map +0 -1
  443. package/dist/snyk-rest-v1.js +0 -132
  444. package/dist/snyk-rest-v1.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -59,8 +59,8 @@ export type { DeduplicationDiagnostic, DeduplicationDiagnosticObserver, } from "
59
59
  export type { FindingEmbedder, EmbeddingUsageObservation, EmbeddingUsageObserver, } from "./server/embeddings.js";
60
60
  export { ExternalPublicationError, prepareExternalPublication, prepareNormalizedExternalPublication, } from "./external-findings-publish.js";
61
61
  export type { ExternalPublicationOptions, NormalizedExternalPublicationOptions, ExternalPublicationDependencies, ExternalPublicationPreview, ExternalPublicationProgress, ExternalPublicationResult, PreparedExternalPublication, } from "./external-findings-publish.js";
62
- export { prepareNormalizedLocalImport, listLocalExternalFindings, } from "./external-findings-local.js";
63
- export type { StoredExternalFinding, NormalizedLocalImportOptions, LocalExternalImportDependencies, LocalExternalImportPreview, LocalExternalImportResult, PreparedLocalExternalImport, } from "./external-findings-local.js";
62
+ export { prepareNormalizedLocalImport, listLocalExternalImports, listLocalExternalFindings, listLocalFindingPublications, selectLocalExternalFindings, } from "./external-findings-local.js";
63
+ export type { ExternalFindingProvenance, LocalExternalFindingSelection, SelectedLocalExternalFindings, StoredExternalImport, StoredFindingPublication, StoredExternalFinding, NormalizedLocalImportOptions, LocalExternalImportDependencies, LocalExternalImportPreview, LocalExternalImportResult, PreparedLocalExternalImport, } from "./external-findings-local.js";
64
64
  export { NoPublishableFindingsError, type ExternalFinding, type ExternalFindings, type ExternalSourceRepository, } from "./external-findings.js";
65
65
  export type { ExternalFindingEvidence, FindingImportRequest, FindingImportReceipt, ImportRepository, SourceReport, } from "./external-import-models.js";
66
66
  export { normalizeGitHubCodeScanningAlerts, normalizeGitHubAdvisories, readGitHubFindings, } from "./github-findings.js";
@@ -79,13 +79,15 @@ export type { NormalizedTarget, ScanMode, ScanTarget } from "./targets.js";
79
79
  export type { AbsolutePath } from "./config-path.js";
80
80
  export { BUNDLED_PLUGIN_VERSION, VERSION } from "./version.js";
81
81
  export { classifySeverityRecords, classifySeverityRecordsInputSchema, } from "./classify-severity-records.js";
82
- export type { ClassifySeverityRecordsInput, ClassifySeverityRecordsOptions, ClassifySeverityRecordsResult, CanonicalSeverityAssessment, SeverityClassificationReviewRequest, } from "./classify-severity-records.js";
82
+ export type { ClassifySeverityRecordsInput, ClassifySeverityRecordsOptions, ClassifySeverityRecordsResult, CanonicalSeverityAssessment, SeverityClassificationReviewRequest, SeverityDiagnosticCode, SeverityRecordDiagnosticCode, } from "./classify-severity-records.js";
83
83
  export { validateRecords } from "./validation-records.js";
84
84
  export type { ValidateRecordsInput, ValidateRecordsOptions, ValidationReviewRequest, } from "./validation-records.js";
85
85
  export { readOperationTelemetry, summarizeOperationTelemetry, } from "./operation-telemetry.js";
86
86
  export type { OperationTelemetryEvent, OperationOutcome, OperationFailureCategory, } from "./operation-telemetry.js";
87
87
  export { prepareLocalExternalImport, type LocalExternalImportOptions, } from "./external-findings-import.js";
88
+ export { prepareStoredFindingsPublication, type StoredFindingsPublication, type StoredFindingsPublicationGroup, } from "./stored-findings-publication.js";
88
89
  export { readTenableFindings } from "./tenable-findings.js";
90
+ export { readCrowdStrikeFindings } from "./crowdstrike-findings.js";
89
91
  export { normalizeOpenGrepFindings, readOpenGrepFindings, type OpenGrepImportOptions, } from "./opengrep-findings.js";
90
92
  export { readSonarFindings, type SonarCapture } from "./sonar-findings.js";
91
93
  export { collectSonarIssues, type SonarCollectionOptions, } from "./sonar-collector.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sB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AAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACxF,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EACL,wCAAwC,EACxC,6BAA6B,EAC7B,gCAAgC,EAChC,KAAK,wBAAwB,GAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ export { publishScanToCustom } from "./custom-publish.js";
21
21
  export { deduplicateRecords } from "./deduplication/records.js";
22
22
  export { deduplicateScan, deduplicateScanDirectory, } from "./deduplication/scan.js";
23
23
  export { ExternalPublicationError, prepareExternalPublication, prepareNormalizedExternalPublication, } from "./external-findings-publish.js";
24
- export { prepareNormalizedLocalImport, listLocalExternalFindings, } from "./external-findings-local.js";
24
+ export { prepareNormalizedLocalImport, listLocalExternalImports, listLocalExternalFindings, listLocalFindingPublications, selectLocalExternalFindings, } from "./external-findings-local.js";
25
25
  export { NoPublishableFindingsError, } from "./external-findings.js";
26
26
  export { normalizeGitHubCodeScanningAlerts, normalizeGitHubAdvisories, readGitHubFindings, } from "./github-findings.js";
27
27
  export { importGitHubAdvisories } from "./github-advisories.js";
@@ -35,7 +35,9 @@ export { classifySeverityRecords, classifySeverityRecordsInputSchema, } from "./
35
35
  export { validateRecords } from "./validation-records.js";
36
36
  export { readOperationTelemetry, summarizeOperationTelemetry, } from "./operation-telemetry.js";
37
37
  export { prepareLocalExternalImport, } from "./external-findings-import.js";
38
+ export { prepareStoredFindingsPublication, } from "./stored-findings-publication.js";
38
39
  export { readTenableFindings } from "./tenable-findings.js";
40
+ export { readCrowdStrikeFindings } from "./crowdstrike-findings.js";
39
41
  export { normalizeOpenGrepFindings, readOpenGrepFindings, } from "./opengrep-findings.js";
40
42
  export { readSonarFindings } from "./sonar-findings.js";
41
43
  export { collectSonarIssues, } from "./sonar-collector.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,iBAAiB,EAAE,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BAAoB,GAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,GAKxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AAMxF,OAAO,EACL,wCAAwC,EACxC,6BAA6B,EAC7B,gCAAgC,GAEjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC","sourcesContent":["export { exportArtifact } from \"./artifact-export.js\";\nexport type {\n ExportArtifactOptions,\n ArtifactExportResult,\n} from \"./artifact-export.js\";\nexport { CodexSecurity, createSecurity } from \"./api.js\";\nexport {\n runHostedRemediation,\n HostedRemediationInputSchema,\n HostedRemediationPreparationError,\n} from \"./hosted-remediation.js\";\nexport type {\n HostedRemediationInput,\n HostedRemediationOptions,\n HostedRemediationResult,\n RemediationExecutor,\n RemediationExecutionRequest,\n RemediationExecutionResult,\n RemediationExecutionEvent,\n} from \"./hosted-remediation.js\";\nexport { runHostedRemediationProtocol } from \"./hosted-remediation-protocol.js\";\nexport type { FindingPatch, FindingVerification } from \"./remediation.js\";\nexport {\n runHostedScan,\n HostedScanInputSchema,\n HostedScanPreparationError,\n} from \"./hosted-scan.js\";\nexport type {\n HostedScanInput,\n HostedScanOptions,\n HostedScanResult,\n} from \"./hosted-scan.js\";\nexport type {\n ScanExecutor,\n ScanExecutionRequest,\n ScanExecutionResult,\n ScanExecutionEvent,\n} from \"./scan-executor.js\";\nexport { loadProjectConfig, resolveProjectConfig } from \"./project-config.js\";\nexport type {\n ResolvedProjectConfig,\n ProjectConfigProvenance,\n} from \"./project-config.js\";\nexport type {\n ProjectConfigInput,\n ProjectScope,\n} from \"./project-config-schema.js\";\nexport type { ScanSettings } from \"./scan-settings.js\";\nexport type { SeverityRubricSnapshot } from \"./severity-rubric.js\";\nexport { classifySeverity } from \"./classify-severity.js\";\nexport { suggestOwners, suggestOwnersFromScan } from \"./suggest-owners.js\";\nexport type {\n OwnerFinding,\n CodeownerIdentity,\n OwnerIdentity,\n OwnerSuggestion,\n OwnerSuggestions,\n SuggestOwnersOptions,\n} from \"./suggest-owners.js\";\nexport type {\n ClassifySeverityOptions,\n SeverityClassificationFinding,\n SeverityClassification,\n SeverityAssessment,\n} from \"./classify-severity.js\";\nexport {\n classifyScanSeverity,\n classifyScanDirectorySeverity,\n} from \"./classify-scan-severity.js\";\nexport type {\n ClassifyScanSeverityOptions,\n ScanSeverityClassification,\n} from \"./classify-scan-severity.js\";\nexport { runComponentScans } from \"./component-scan.js\";\nexport type {\n ComponentDeduplicationSummary,\n ComponentReceipt,\n ComponentScanOptions,\n ComponentScanEvent,\n ComponentScanResult,\n} from \"./component-scan.js\";\nexport { normalizeComponentPlan, planComponents } from \"./component-plan.js\";\nexport type {\n ComponentPlan,\n ComponentPlanningOptions,\n} from \"./component-plan.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type {\n ScanAccountRateLimit,\n ScanAccountRateLimitWindow,\n ScanCost,\n ScanSessionEvent,\n ScanUsageMeasurement,\n ScanUsageObservation,\n ScanWorkerEvent,\n} from \"./cost.js\";\nexport type { ScanPricingContext, ScanTokenUsage } from \"./cost-model.js\";\nexport type { DeepScanProgress } from \"./scan-progress.js\";\nexport type { CustomValidationResult } from \"./custom-validation.js\";\nexport type { ScanActivity, ScanActivityStatus } from \"./scan-activity.js\";\nexport { matchScanFindings } from \"./scan-comparison.js\";\nexport type {\n ScanComparisonInput,\n ScanComparisonOptions,\n ScanComparisonProgress,\n ScanComparisonResult,\n} from \"./scan-comparison.js\";\nexport type {\n CodexSecurityMetadata,\n DeepScanOptions,\n PatchOptions,\n PatchResult,\n ScanAuthMode,\n ScanAuthentication,\n ScanBudget,\n ScanLifecycle,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n ScanTrustedAccessStatus,\n ScanWarningDetails,\n ValidationOptions,\n ValidationResult,\n} from \"./api.js\";\nexport type {\n ScanPhase,\n ScanProgress,\n ScanWorkerPhase,\n ScanWorkerStatus,\n} from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n DeduplicationReviewError,\n IncompleteScanError,\n InvalidTargetError,\n LocalPluginBootstrapError,\n OutputDirectoryError,\n OutputDirectoryNotEmptyError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n SandboxUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type {\n DeduplicationReviewFailureCategory,\n DeduplicationReviewFailureMetadata,\n DeduplicationReviewStage,\n ProtectedScanPathKind,\n} from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport {\n resolveSecurityPolicyTarget,\n securityPolicyDiff,\n} from \"./security-policy.js\";\nexport type {\n SecurityPolicyDraft,\n SecurityPolicyOptions,\n SecurityPolicyPreflight,\n SecurityPolicyStage,\n SecurityPolicyTarget,\n} from \"./security-policy.js\";\nexport { checkScanPublication, publishScan } from \"./publish.js\";\nexport { publishScanToCustom } from \"./custom-publish.js\";\nexport type {\n PublishScanToCustomOptions,\n CustomPublicationResult,\n} from \"./custom-publish.js\";\nexport { deduplicateRecords } from \"./deduplication/records.js\";\nexport type {\n DeduplicateRecordsInput,\n DeduplicateRecordsOptions,\n DeduplicateRecordsResult,\n} from \"./deduplication/records.js\";\nexport type {\n DeduplicationReviewRequest,\n DeduplicationReviewAttribution,\n DeduplicationReviewRunner,\n} from \"./deduplication/review.js\";\nexport {\n deduplicateScan,\n deduplicateScanDirectory,\n} from \"./deduplication/scan.js\";\nexport type {\n DeduplicateScanDirectoryOptions,\n DeduplicateScanOptions,\n DeduplicateScanResult,\n} from \"./deduplication/scan.js\";\nexport type { DeduplicationRefusal } from \"./deduplication/deduplication.js\";\nexport type { FindingEmbeddingBinding } from \"./deduplication/local.js\";\nexport type {\n PublicationTelemetry,\n PublicationTelemetryObserver,\n} from \"./publication-telemetry.js\";\nexport type {\n DeduplicationDiagnostic,\n DeduplicationDiagnosticObserver,\n} from \"./deduplication/diagnostics.js\";\nexport type {\n FindingEmbedder,\n EmbeddingUsageObservation,\n EmbeddingUsageObserver,\n} from \"./server/embeddings.js\";\nexport {\n ExternalPublicationError,\n prepareExternalPublication,\n prepareNormalizedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport type {\n ExternalPublicationOptions,\n NormalizedExternalPublicationOptions,\n ExternalPublicationDependencies,\n ExternalPublicationPreview,\n ExternalPublicationProgress,\n ExternalPublicationResult,\n PreparedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport {\n prepareNormalizedLocalImport,\n listLocalExternalFindings,\n} from \"./external-findings-local.js\";\nexport type {\n StoredExternalFinding,\n NormalizedLocalImportOptions,\n LocalExternalImportDependencies,\n LocalExternalImportPreview,\n LocalExternalImportResult,\n PreparedLocalExternalImport,\n} from \"./external-findings-local.js\";\nexport {\n NoPublishableFindingsError,\n type ExternalFinding,\n type ExternalFindings,\n type ExternalSourceRepository,\n} from \"./external-findings.js\";\nexport type {\n ExternalFindingEvidence,\n FindingImportRequest,\n FindingImportReceipt,\n ImportRepository,\n SourceReport,\n} from \"./external-import-models.js\";\nexport {\n normalizeGitHubCodeScanningAlerts,\n normalizeGitHubAdvisories,\n readGitHubFindings,\n} from \"./github-findings.js\";\nexport { importGitHubAdvisories } from \"./github-advisories.js\";\nexport { normalizeGitHubDependabotAlerts } from \"./github-dependabot-findings.js\";\nexport type {\n GitHubAdvisoryImportOptions,\n ImportedGitHubAdvisory,\n} from \"./github-advisories.js\";\nexport { importGitHubCodeScanningAlerts } from \"./github.js\";\nexport type {\n GitHubCodeScanningImportOptions,\n ImportedGitHubCodeScanningAlert,\n} from \"./github.js\";\nexport type {\n CheckScanPublicationOptions,\n CheckScanPublicationResult,\n PublishScanOptions,\n PublishScanProgress,\n PublishScanResult,\n} from \"./publish.js\";\nexport { ScanResult } from \"./result.js\";\nexport type {\n RepositoryFinding,\n ScanResultOptions,\n TurnResultMetadata,\n} from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport type { AbsolutePath } from \"./config-path.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n\nexport {\n classifySeverityRecords,\n classifySeverityRecordsInputSchema,\n} from \"./classify-severity-records.js\";\nexport type {\n ClassifySeverityRecordsInput,\n ClassifySeverityRecordsOptions,\n ClassifySeverityRecordsResult,\n CanonicalSeverityAssessment,\n SeverityClassificationReviewRequest,\n} from \"./classify-severity-records.js\";\nexport { validateRecords } from \"./validation-records.js\";\nexport type {\n ValidateRecordsInput,\n ValidateRecordsOptions,\n ValidationReviewRequest,\n} from \"./validation-records.js\";\n\nexport {\n readOperationTelemetry,\n summarizeOperationTelemetry,\n} from \"./operation-telemetry.js\";\nexport type {\n OperationTelemetryEvent,\n OperationOutcome,\n OperationFailureCategory,\n} from \"./operation-telemetry.js\";\n\nexport {\n prepareLocalExternalImport,\n type LocalExternalImportOptions,\n} from \"./external-findings-import.js\";\nexport { readTenableFindings } from \"./tenable-findings.js\";\nexport {\n normalizeOpenGrepFindings,\n readOpenGrepFindings,\n type OpenGrepImportOptions,\n} from \"./opengrep-findings.js\";\nexport { readSonarFindings, type SonarCapture } from \"./sonar-findings.js\";\nexport {\n collectSonarIssues,\n type SonarCollectionOptions,\n} from \"./sonar-collector.js\";\nexport {\n normalizeVeracodeFindings,\n readVeracodeFindings,\n} from \"./veracode-findings.js\";\nexport { normalizeTrivyFindings, readTrivyFindings } from \"./trivy-findings.js\";\nexport {\n normalizeBlackDuckFindings,\n readBlackDuckFindings,\n} from \"./blackduck-findings.js\";\nexport {\n normalizeContinuumFindings,\n readContinuumFindings,\n} from \"./continuum-findings.js\";\nexport { readCheckmarxFindings } from \"./checkmarx-findings.js\";\nexport {\n normalizeInspectorFindings,\n readInspectorFindings,\n} from \"./inspector-findings.js\";\nexport {\n normalizeSnykFindingsExport,\n normalizeSnykJson,\n normalizeSnykSarif,\n readSnykFindings,\n} from \"./snyk-findings.js\";\nexport {\n collectSnykIssues,\n normalizeSnykIssues,\n SNYK_REST_ISSUES_FORMAT,\n type CollectSnykIssuesOptions,\n type SnykIssuesExport,\n type SnykIssuesFindings,\n type SnykIssuesProduct,\n} from \"./snyk-rest-findings.js\";\nexport {\n normalizeSemgrepFindings,\n normalizeSemgrepSarif,\n readSemgrepFindings,\n type SemgrepImportOptions,\n} from \"./semgrep-findings.js\";\nexport { collectSemgrepPlatformFindings } from \"./semgrep-platform-collector.js\";\nexport { collectSelectedSemgrepGuardianFindings } from \"./semgrep-guardian-findings.js\";\nexport type {\n SemgrepPlatformOptions,\n SemgrepPlatformReport,\n} from \"./semgrep-platform-collector.js\";\nexport type { HostedScannerHttpOptions } from \"./hosted-scanner-http.js\";\nexport {\n normalizeSelectedSemgrepPlatformFindings,\n selectSemgrepPlatformFindings,\n normalizeSemgrepPlatformFindings,\n type SemgrepPlatformSelection,\n} from \"./semgrep-platform-findings.js\";\nexport {\n normalizeEndorFindings,\n normalizeEndorSarif,\n readEndorFindings,\n} from \"./endor-findings.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,0BAA0B,G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B,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC","sourcesContent":["export { exportArtifact } from \"./artifact-export.js\";\nexport type {\n ExportArtifactOptions,\n ArtifactExportResult,\n} from \"./artifact-export.js\";\nexport { CodexSecurity, createSecurity } from \"./api.js\";\nexport {\n runHostedRemediation,\n HostedRemediationInputSchema,\n HostedRemediationPreparationError,\n} from \"./hosted-remediation.js\";\nexport type {\n HostedRemediationInput,\n HostedRemediationOptions,\n HostedRemediationResult,\n RemediationExecutor,\n RemediationExecutionRequest,\n RemediationExecutionResult,\n RemediationExecutionEvent,\n} from \"./hosted-remediation.js\";\nexport { runHostedRemediationProtocol } from \"./hosted-remediation-protocol.js\";\nexport type { FindingPatch, FindingVerification } from \"./remediation.js\";\nexport {\n runHostedScan,\n HostedScanInputSchema,\n HostedScanPreparationError,\n} from \"./hosted-scan.js\";\nexport type {\n HostedScanInput,\n HostedScanOptions,\n HostedScanResult,\n} from \"./hosted-scan.js\";\nexport type {\n ScanExecutor,\n ScanExecutionRequest,\n ScanExecutionResult,\n ScanExecutionEvent,\n} from \"./scan-executor.js\";\nexport { loadProjectConfig, resolveProjectConfig } from \"./project-config.js\";\nexport type {\n ResolvedProjectConfig,\n ProjectConfigProvenance,\n} from \"./project-config.js\";\nexport type {\n ProjectConfigInput,\n ProjectScope,\n} from \"./project-config-schema.js\";\nexport type { ScanSettings } from \"./scan-settings.js\";\nexport type { SeverityRubricSnapshot } from \"./severity-rubric.js\";\nexport { classifySeverity } from \"./classify-severity.js\";\nexport { suggestOwners, suggestOwnersFromScan } from \"./suggest-owners.js\";\nexport type {\n OwnerFinding,\n CodeownerIdentity,\n OwnerIdentity,\n OwnerSuggestion,\n OwnerSuggestions,\n SuggestOwnersOptions,\n} from \"./suggest-owners.js\";\nexport type {\n ClassifySeverityOptions,\n SeverityClassificationFinding,\n SeverityClassification,\n SeverityAssessment,\n} from \"./classify-severity.js\";\nexport {\n classifyScanSeverity,\n classifyScanDirectorySeverity,\n} from \"./classify-scan-severity.js\";\nexport type {\n ClassifyScanSeverityOptions,\n ScanSeverityClassification,\n} from \"./classify-scan-severity.js\";\nexport { runComponentScans } from \"./component-scan.js\";\nexport type {\n ComponentDeduplicationSummary,\n ComponentReceipt,\n ComponentScanOptions,\n ComponentScanEvent,\n ComponentScanResult,\n} from \"./component-scan.js\";\nexport { normalizeComponentPlan, planComponents } from \"./component-plan.js\";\nexport type {\n ComponentPlan,\n ComponentPlanningOptions,\n} from \"./component-plan.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type {\n ScanAccountRateLimit,\n ScanAccountRateLimitWindow,\n ScanCost,\n ScanSessionEvent,\n ScanUsageMeasurement,\n ScanUsageObservation,\n ScanWorkerEvent,\n} from \"./cost.js\";\nexport type { ScanPricingContext, ScanTokenUsage } from \"./cost-model.js\";\nexport type { DeepScanProgress } from \"./scan-progress.js\";\nexport type { CustomValidationResult } from \"./custom-validation.js\";\nexport type { ScanActivity, ScanActivityStatus } from \"./scan-activity.js\";\nexport { matchScanFindings } from \"./scan-comparison.js\";\nexport type {\n ScanComparisonInput,\n ScanComparisonOptions,\n ScanComparisonProgress,\n ScanComparisonResult,\n} from \"./scan-comparison.js\";\nexport type {\n CodexSecurityMetadata,\n DeepScanOptions,\n PatchOptions,\n PatchResult,\n ScanAuthMode,\n ScanAuthentication,\n ScanBudget,\n ScanLifecycle,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n ScanTrustedAccessStatus,\n ScanWarningDetails,\n ValidationOptions,\n ValidationResult,\n} from \"./api.js\";\nexport type {\n ScanPhase,\n ScanProgress,\n ScanWorkerPhase,\n ScanWorkerStatus,\n} from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n DeduplicationReviewError,\n IncompleteScanError,\n InvalidTargetError,\n LocalPluginBootstrapError,\n OutputDirectoryError,\n OutputDirectoryNotEmptyError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n SandboxUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type {\n DeduplicationReviewFailureCategory,\n DeduplicationReviewFailureMetadata,\n DeduplicationReviewStage,\n ProtectedScanPathKind,\n} from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport {\n resolveSecurityPolicyTarget,\n securityPolicyDiff,\n} from \"./security-policy.js\";\nexport type {\n SecurityPolicyDraft,\n SecurityPolicyOptions,\n SecurityPolicyPreflight,\n SecurityPolicyStage,\n SecurityPolicyTarget,\n} from \"./security-policy.js\";\nexport { checkScanPublication, publishScan } from \"./publish.js\";\nexport { publishScanToCustom } from \"./custom-publish.js\";\nexport type {\n PublishScanToCustomOptions,\n CustomPublicationResult,\n} from \"./custom-publish.js\";\nexport { deduplicateRecords } from \"./deduplication/records.js\";\nexport type {\n DeduplicateRecordsInput,\n DeduplicateRecordsOptions,\n DeduplicateRecordsResult,\n} from \"./deduplication/records.js\";\nexport type {\n DeduplicationReviewRequest,\n DeduplicationReviewAttribution,\n DeduplicationReviewRunner,\n} from \"./deduplication/review.js\";\nexport {\n deduplicateScan,\n deduplicateScanDirectory,\n} from \"./deduplication/scan.js\";\nexport type {\n DeduplicateScanDirectoryOptions,\n DeduplicateScanOptions,\n DeduplicateScanResult,\n} from \"./deduplication/scan.js\";\nexport type { DeduplicationRefusal } from \"./deduplication/deduplication.js\";\nexport type { FindingEmbeddingBinding } from \"./deduplication/local.js\";\nexport type {\n PublicationTelemetry,\n PublicationTelemetryObserver,\n} from \"./publication-telemetry.js\";\nexport type {\n DeduplicationDiagnostic,\n DeduplicationDiagnosticObserver,\n} from \"./deduplication/diagnostics.js\";\nexport type {\n FindingEmbedder,\n EmbeddingUsageObservation,\n EmbeddingUsageObserver,\n} from \"./server/embeddings.js\";\nexport {\n ExternalPublicationError,\n prepareExternalPublication,\n prepareNormalizedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport type {\n ExternalPublicationOptions,\n NormalizedExternalPublicationOptions,\n ExternalPublicationDependencies,\n ExternalPublicationPreview,\n ExternalPublicationProgress,\n ExternalPublicationResult,\n PreparedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport {\n prepareNormalizedLocalImport,\n listLocalExternalImports,\n listLocalExternalFindings,\n listLocalFindingPublications,\n selectLocalExternalFindings,\n} from \"./external-findings-local.js\";\nexport type {\n ExternalFindingProvenance,\n LocalExternalFindingSelection,\n SelectedLocalExternalFindings,\n StoredExternalImport,\n StoredFindingPublication,\n StoredExternalFinding,\n NormalizedLocalImportOptions,\n LocalExternalImportDependencies,\n LocalExternalImportPreview,\n LocalExternalImportResult,\n PreparedLocalExternalImport,\n} from \"./external-findings-local.js\";\nexport {\n NoPublishableFindingsError,\n type ExternalFinding,\n type ExternalFindings,\n type ExternalSourceRepository,\n} from \"./external-findings.js\";\nexport type {\n ExternalFindingEvidence,\n FindingImportRequest,\n FindingImportReceipt,\n ImportRepository,\n SourceReport,\n} from \"./external-import-models.js\";\nexport {\n normalizeGitHubCodeScanningAlerts,\n normalizeGitHubAdvisories,\n readGitHubFindings,\n} from \"./github-findings.js\";\nexport { importGitHubAdvisories } from \"./github-advisories.js\";\nexport { normalizeGitHubDependabotAlerts } from \"./github-dependabot-findings.js\";\nexport type {\n GitHubAdvisoryImportOptions,\n ImportedGitHubAdvisory,\n} from \"./github-advisories.js\";\nexport { importGitHubCodeScanningAlerts } from \"./github.js\";\nexport type {\n GitHubCodeScanningImportOptions,\n ImportedGitHubCodeScanningAlert,\n} from \"./github.js\";\nexport type {\n CheckScanPublicationOptions,\n CheckScanPublicationResult,\n PublishScanOptions,\n PublishScanProgress,\n PublishScanResult,\n} from \"./publish.js\";\nexport { ScanResult } from \"./result.js\";\nexport type {\n RepositoryFinding,\n ScanResultOptions,\n TurnResultMetadata,\n} from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport type { AbsolutePath } from \"./config-path.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n\nexport {\n classifySeverityRecords,\n classifySeverityRecordsInputSchema,\n} from \"./classify-severity-records.js\";\nexport type {\n ClassifySeverityRecordsInput,\n ClassifySeverityRecordsOptions,\n ClassifySeverityRecordsResult,\n CanonicalSeverityAssessment,\n SeverityClassificationReviewRequest,\n SeverityDiagnosticCode,\n SeverityRecordDiagnosticCode,\n} from \"./classify-severity-records.js\";\nexport { validateRecords } from \"./validation-records.js\";\nexport type {\n ValidateRecordsInput,\n ValidateRecordsOptions,\n ValidationReviewRequest,\n} from \"./validation-records.js\";\n\nexport {\n readOperationTelemetry,\n summarizeOperationTelemetry,\n} from \"./operation-telemetry.js\";\nexport type {\n OperationTelemetryEvent,\n OperationOutcome,\n OperationFailureCategory,\n} from \"./operation-telemetry.js\";\n\nexport {\n prepareLocalExternalImport,\n type LocalExternalImportOptions,\n} from \"./external-findings-import.js\";\nexport {\n prepareStoredFindingsPublication,\n type StoredFindingsPublication,\n type StoredFindingsPublicationGroup,\n} from \"./stored-findings-publication.js\";\nexport { readTenableFindings } from \"./tenable-findings.js\";\nexport { readCrowdStrikeFindings } from \"./crowdstrike-findings.js\";\nexport {\n normalizeOpenGrepFindings,\n readOpenGrepFindings,\n type OpenGrepImportOptions,\n} from \"./opengrep-findings.js\";\nexport { readSonarFindings, type SonarCapture } from \"./sonar-findings.js\";\nexport {\n collectSonarIssues,\n type SonarCollectionOptions,\n} from \"./sonar-collector.js\";\nexport {\n normalizeVeracodeFindings,\n readVeracodeFindings,\n} from \"./veracode-findings.js\";\nexport { normalizeTrivyFindings, readTrivyFindings } from \"./trivy-findings.js\";\nexport {\n normalizeBlackDuckFindings,\n readBlackDuckFindings,\n} from \"./blackduck-findings.js\";\nexport {\n normalizeContinuumFindings,\n readContinuumFindings,\n} from \"./continuum-findings.js\";\nexport { readCheckmarxFindings } from \"./checkmarx-findings.js\";\nexport {\n normalizeInspectorFindings,\n readInspectorFindings,\n} from \"./inspector-findings.js\";\nexport {\n normalizeSnykFindingsExport,\n normalizeSnykJson,\n normalizeSnykSarif,\n readSnykFindings,\n} from \"./snyk-findings.js\";\nexport {\n collectSnykIssues,\n normalizeSnykIssues,\n SNYK_REST_ISSUES_FORMAT,\n type CollectSnykIssuesOptions,\n type SnykIssuesExport,\n type SnykIssuesFindings,\n type SnykIssuesProduct,\n} from \"./snyk-rest-findings.js\";\nexport {\n normalizeSemgrepFindings,\n normalizeSemgrepSarif,\n readSemgrepFindings,\n type SemgrepImportOptions,\n} from \"./semgrep-findings.js\";\nexport { collectSemgrepPlatformFindings } from \"./semgrep-platform-collector.js\";\nexport { collectSelectedSemgrepGuardianFindings } from \"./semgrep-guardian-findings.js\";\nexport type {\n SemgrepPlatformOptions,\n SemgrepPlatformReport,\n} from \"./semgrep-platform-collector.js\";\nexport type { HostedScannerHttpOptions } from \"./hosted-scanner-http.js\";\nexport {\n normalizeSelectedSemgrepPlatformFindings,\n selectSemgrepPlatformFindings,\n normalizeSemgrepPlatformFindings,\n type SemgrepPlatformSelection,\n} from \"./semgrep-platform-findings.js\";\nexport {\n normalizeEndorFindings,\n normalizeEndorSarif,\n readEndorFindings,\n} from \"./endor-findings.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"inspector-findings.d.ts","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAkX5D,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,EAAE,oBAAoB,EAC5B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,CAAC,wBAAwB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CA0DhE;AA2KD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,gBAAgB,CAElB;AA+ED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
1
+ {"version":3,"file":"inspector-findings.d.ts","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAkX5D,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,EAAE,oBAAoB,EAC5B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,CAAC,wBAAwB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CA0DhE;AAsKD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,gBAAgB,CA4ClB;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
@@ -361,7 +361,7 @@ function manifestPath(path) {
361
361
  ? path
362
362
  : null;
363
363
  }
364
- function evidence({ native: finding, pkg, code }, id, source, target, previousProjection) {
364
+ function evidence({ native: finding, pkg, code }, id, source, target) {
365
365
  const { description, severity, remediation, firstObservedAt, lastObservedAt, updatedAt, status, } = finding;
366
366
  const { recommendation } = record(remediation, "Inspector remediation");
367
367
  record(recommendation ?? {}, "Inspector recommendation");
@@ -415,9 +415,7 @@ function evidence({ native: finding, pkg, code }, id, source, target, previousPr
415
415
  description: requiredText(description, "Inspector description"),
416
416
  severity: scannerSeverity(level),
417
417
  url: text(pkg?.sourceUrl),
418
- advisory_ids: previousProjection && pkg?.relatedVulnerabilities
419
- ? [...new Set(advisoryIds.concat(pkg.relatedVulnerabilities))]
420
- : advisoryIds,
418
+ advisory_ids: advisoryIds,
421
419
  packages,
422
420
  locations,
423
421
  source_updated_at: updatedAt === undefined ? null : timestamp(updatedAt),
@@ -427,7 +425,7 @@ function evidence({ native: finding, pkg, code }, id, source, target, previousPr
427
425
  finding: structuredClone(finding),
428
426
  },
429
427
  };
430
- const enrichment = code && !previousProjection
428
+ const enrichment = code
431
429
  ? {
432
430
  details: {
433
431
  kind: "sast",
@@ -441,13 +439,6 @@ function evidence({ native: finding, pkg, code }, id, source, target, previousPr
441
439
  return validateEnrichedExternalEvidence(base, target, enrichment);
442
440
  }
443
441
  export function normalizeInspectorFindings(input, sourceRepositoryUrl, target = "cloud", projectMap) {
444
- return normalizeReport(input, sourceRepositoryUrl, target, projectMap, false);
445
- }
446
- /** @internal Reconstruct the prior evidence when matching a pending publication. */
447
- export function normalizePreviousInspectorFindings(input, sourceRepositoryUrl, target = "cloud", projectMap) {
448
- return normalizeReport(input, sourceRepositoryUrl, target, projectMap, true);
449
- }
450
- function normalizeReport(input, sourceRepositoryUrl, target, projectMap, previousProjection) {
451
442
  const source = repositoryUrl(sourceRepositoryUrl);
452
443
  if (isRecord(input) &&
453
444
  (Object.hasOwn(input, "NextToken") || Object.hasOwn(input, "nextToken")))
@@ -462,30 +453,23 @@ function normalizeReport(input, sourceRepositoryUrl, target, projectMap, previou
462
453
  claims: repositoryClaims(finding),
463
454
  }));
464
455
  checkReportScope(rows, target, projectMap);
465
- function checkRetainedScope(result, removedIds) {
466
- if (!result.excluded.length || !result.findings.length)
467
- return;
468
- // Only surviving rows can supply shared provider and host evidence on replay.
469
- const skipped = new Set(result.excluded.map((row) => row.position));
470
- const retained = rows.filter((row) => !skipped.has(row.position));
471
- checkReportScope(retained, target, projectMap, (row, error) => {
472
- skipped.add(row.position);
473
- result.excluded.push({
474
- position: row.position,
475
- source_finding_id: identity(record(row.finding, "Inspector finding"))
476
- .arn,
477
- reason: errorMessage(error),
478
- });
456
+ const result = normalizeRecords(rows, ({ finding }, id) => evidence(selectedFinding(finding), id, source, target), ({ finding }) => identity(record(finding, "Inspector finding")).arn, target);
457
+ if (!result.excluded.length || !result.findings.length)
458
+ return result;
459
+ // Only surviving rows can supply shared provider and host evidence on replay.
460
+ const skipped = new Set(result.excluded.map((row) => row.position));
461
+ const retained = rows.filter((row) => !skipped.has(row.position));
462
+ checkReportScope(retained, target, projectMap, (row, error) => {
463
+ skipped.add(row.position);
464
+ result.excluded.push({
465
+ position: row.position,
466
+ source_finding_id: identity(record(row.finding, "Inspector finding")).arn,
467
+ reason: errorMessage(error),
479
468
  });
480
- result.findings = result.findings.filter((finding, i) => {
481
- if (!skipped.has(retained[i].position))
482
- return true;
483
- removedIds?.add(finding.source_finding_id);
484
- return false;
485
- });
486
- result.excluded.sort((a, b) => a.position - b.position);
487
- }
488
- return normalizeRecords(rows, ({ finding }, id) => evidence(selectedFinding(finding), id, source, target, previousProjection), ({ finding }) => identity(record(finding, "Inspector finding")).arn, target, { filter: checkRetainedScope });
469
+ });
470
+ result.findings = result.findings.filter((_, i) => !skipped.has(retained[i].position));
471
+ result.excluded.sort((a, b) => a.position - b.position);
472
+ return result;
489
473
  }
490
474
  export async function readInspectorFindings(path, sourceRepositoryUrl, target = "cloud", projectMap) {
491
475
  const mapping = projectMap && new Map(projectMap);
@@ -1 +1 @@
1
- {"version":3,"file":"inspector-findings.js","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,GAEjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,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,QAAQ,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,gBAAgB,CACrB,IAAI,EACJ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAClB,QAAQ,CACN,eAAe,CAAC,OAAO,CAAC,EACxB,EAAE,EACF,MAAM,EACN,MAAM,EACN,kBAAkB,CACnB,EACH,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,EACnE,MAAM,EACN,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAC/B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAY,EACZ,mBAA2B,EAC3B,MAAM,GAAyB,OAAO,EACtC,UAAwC;IAExC,MAAM,OAAO,GAAG,UAAU,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IAClD,OAAO,0BAA0B,CAC/B,MAAM,eAAe,CAAC,IAAI,CAAC,EAC3B,mBAAmB,EACnB,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport { z } from \"zod\";\nimport type {\n ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nimport {\n cloudRepositoryUrlKey,\n repositoryUrlKey,\n validateEnrichedExternalEvidence,\n type ExternalImportTarget,\n} from \"./external-import-contract.js\";\nimport { isGitHubCloudHost } from \"./git-remote.js\";\nimport { CodexSecurityError, errorMessage } from \"./errors.js\";\nimport type { Provider } from \"./external-import-models.js\";\nimport { isRecord } from \"./record.js\";\nimport {\n awsTimestampSeconds,\n concreteVersion,\n normalizeRecords,\n readScannerJson,\n record,\n repositoryFilePath,\n requiredText,\n scannerSeverity,\n strings,\n text,\n} from \"./scanner-import.js\";\n\ntype Native = Record<string, unknown>;\n\nconst listFindings = z.strictObject({ findings: z.array(z.unknown()) });\nconst format = \"aws-inspector2-list-findings/v1\";\nconst findingArn =\n /^(arn:(aws[a-zA-Z-]*):inspector2:([a-z]{2}(?:-gov)?-[a-z]+-\\d):(\\d{12})):finding\\/[a-f0-9]{32}$/u;\nconst integrationArn =\n /^arn:aws[a-zA-Z-]*:inspector2:[a-z]{2}(?:-gov)?-[a-z]+-\\d:\\d{12}:codesecurity-integration\\/[a-f0-9-]{36}$/u;\nconst projectSuffix =\n /^project-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/u;\nconst absoluteUrl = /^[a-z][a-z\\d+.-]*:\\/\\//iu;\n\nfunction repositoryUrl(value: unknown): string {\n const raw = requiredText(value, \"Inspector --source-repository-url\");\n const url = URL.parse(raw);\n const path = /^https?:\\/\\/[^/?#]+(\\/[^?#]+)$/iu.exec(raw)?.[1];\n if (\n !url ||\n !path ||\n url.username ||\n url.password ||\n /[\\s\\\\?#]|%(?:2f|5c)/iu.test(raw) ||\n path !== url.pathname ||\n !/^\\/[^/]+(?:\\/[^/]+)+\\/?$/u.test(path)\n )\n throw new Error(\n \"Use a complete HTTP(S) Inspector source repository URL with a namespace and repository, without credentials, query or fragment.\",\n );\n return raw;\n}\n\nfunction projectIntegration(projectArn: string): string {\n const separator = projectArn.lastIndexOf(\"/\");\n const parent = projectArn.slice(0, separator);\n if (\n !integrationArn.test(parent) ||\n !projectSuffix.test(projectArn.slice(separator + 1))\n )\n throw new Error(\"Expected a full Inspector repository project ARN.\");\n return parent;\n}\n\n/** @internal Validate an operator-supplied project binding. */\nexport function validateInspectorProjectMapping(\n projectArn: string,\n canonicalUrl: unknown,\n): string {\n projectIntegration(projectArn);\n return repositoryUrl(canonicalUrl);\n}\n\nfunction identity(finding: Native) {\n const arn = requiredText(finding[\"findingArn\"], \"Inspector finding ARN\");\n const match = findingArn.exec(arn);\n if (!match) throw new Error(\"Expected an Inspector2 finding ARN.\");\n if (finding[\"awsAccountId\"] !== match[4])\n throw new Error(\"Inspector finding ARN and AWS account do not match.\");\n return {\n arn,\n issuer: match[1]!,\n partition: match[2]!,\n region: match[3]!,\n account: match[4]!,\n };\n}\n\nfunction repositoryClaim(\n { issuer, partition, region, account }: ReturnType<typeof identity>,\n resource: Native,\n) {\n for (const [field, expected] of Object.entries({\n partition,\n region,\n provider: \"AWS\",\n providerAccountId: account,\n })) {\n if (resource[field] !== undefined && resource[field] !== expected)\n throw new Error(\n \"Inspector repository resource and finding scope do not match.\",\n );\n }\n const { codeRepository } = record(\n resource[\"details\"] ?? {},\n \"Inspector resource details\",\n );\n const repo = record(codeRepository ?? {}, \"Inspector codeRepository\");\n const optional = (field: string) =>\n repo[field] === undefined\n ? undefined\n : requiredText(repo[field], `Inspector codeRepository.${field}`);\n const nativeId = requiredText(\n resource[\"id\"],\n \"Inspector repository resource ID\",\n );\n let integration = optional(\"integrationArn\");\n if (\n integration !== undefined &&\n (!integration.startsWith(issuer + \":\") || !integrationArn.test(integration))\n )\n throw new Error(\n \"Inspector integration ARN does not match the finding scope.\",\n );\n if (nativeId.startsWith(\"arn:\")) {\n const parent = projectIntegration(nativeId);\n if (\n !parent.startsWith(issuer + \":\") ||\n (integration !== undefined && parent !== integration)\n )\n throw new Error(\n \"Inspector repository resource ARN does not match its project or integration.\",\n );\n integration = parent;\n }\n return {\n project: JSON.stringify([issuer, nativeId]),\n integration,\n provider: optional(\"providerType\"),\n nativeId,\n name: optional(\"projectName\"),\n };\n}\n\nfunction checkRepositoryMapping(\n { nativeId, name }: ReturnType<typeof repositoryClaim>,\n source: string,\n provider: string | undefined,\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n) {\n const hostname = new URL(source).hostname;\n const knownGitHub = isGitHubCloudHost(hostname);\n const gitlab = provider === \"GITLAB_SELF_MANAGED\";\n const github = provider === \"GITHUB\" || knownGitHub;\n if (\n hostname === \"gitlab.com\" ||\n (gitlab && knownGitHub) ||\n (provider !== undefined && !gitlab && provider !== \"GITHUB\")\n )\n throw new Error(\n \"Inspector repository provider does not match the selected mapping.\",\n );\n if (target === \"cloud\" && !github)\n throw new Error(\n \"Inspector Cloud requires a GitHub repository provider; self-managed GitLab is local only.\",\n );\n const urls = [nativeId, name].filter(\n (url): url is string => !!url && absoluteUrl.test(url),\n );\n const key = github && !projectMap ? cloudRepositoryUrlKey : repositoryUrlKey;\n const path = new URL(\n (github ? cloudRepositoryUrlKey : repositoryUrlKey)(source),\n ).pathname.slice(1);\n const slug = github ? name?.toLowerCase() : name;\n const matchesSlug =\n !slug ||\n absoluteUrl.test(slug) ||\n slug === path ||\n slug === posix.basename(path) ||\n (gitlab && projectMap && path.endsWith(\"/\" + slug));\n if (\n !matchesSlug ||\n urls.some((url) => key(repositoryUrl(url)) !== key(source))\n )\n throw new Error(\n \"Inspector native repository does not match --source-repository-url.\",\n );\n if (projectMap) {\n // repositoryClaim validated this ARN and its issuer before the lookup.\n const trustedUrl = nativeId.startsWith(\"arn:\")\n ? projectMap.get(nativeId)\n : undefined;\n if (trustedUrl === undefined)\n throw new Error(\n \"Inspector project ARN is missing from the trusted mapping.\",\n );\n if (\n repositoryUrlKey(repositoryUrl(trustedUrl)) !== repositoryUrlKey(source)\n )\n throw new Error(\n \"Inspector project ARN mapping does not match the source repository URL.\",\n );\n return true;\n }\n return urls.length > 0;\n}\n\nfunction repositoryClaims(finding: unknown) {\n if (!isRecord(finding) || !Array.isArray(finding[\"resources\"])) return [];\n const claims = [];\n let origin: ReturnType<typeof identity> | undefined;\n for (const resource of finding[\"resources\"]) {\n if (!isRecord(resource) || resource[\"type\"] !== \"CODE_REPOSITORY\") continue;\n origin ??= identity(finding);\n claims.push(repositoryClaim(origin, resource));\n }\n return claims;\n}\n\n/** Claims from the whole export must identify one project, including excluded rows. */\nfunction checkReportScope<\n T extends { claims: ReturnType<typeof repositoryClaims>; source: string },\n>(\n rows: readonly T[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n exclude: (row: T, error: unknown) => void = (_, error) => {\n throw error;\n },\n): string | undefined {\n const claims = rows.flatMap((row) => row.claims);\n function shared(field: \"project\" | \"integration\" | \"provider\") {\n const values = new Set(claims.map((claim) => claim[field]));\n values.delete(undefined);\n if (values.size > 1)\n throw new Error(\n \"Inspector export identifies more than one repository project or integration.\",\n );\n return values.values().next().value;\n }\n shared(\"project\");\n shared(\"integration\");\n const provider = shared(\"provider\");\n type Claim = ReturnType<typeof repositoryClaim>;\n // A bare project ID can recur across integrations in the same account and Region.\n const sharedProvider = claims.find(\n (claim) => claim.integration && claim.provider,\n )?.provider;\n const providerFor = (claim: Claim) =>\n claim.provider ?? (claim.integration ? sharedProvider : undefined);\n const missingHost = () =>\n new Error(\n \"Inspector needs a matching native repository URL or a trusted project ARN mapping to identify the Git host.\",\n );\n const needHost = [];\n let sharedHost = false;\n for (const row of rows) {\n try {\n // Only a fully verified row can supply evidence to another row.\n const scopedMatches = row.claims.flatMap((claim) => {\n const proven = checkRepositoryMapping(\n claim,\n row.source,\n providerFor(claim),\n target,\n projectMap,\n );\n if (claim.integration) return [proven];\n if (!proven) throw missingHost();\n return [];\n });\n if (scopedMatches.includes(true)) sharedHost = true;\n else if (scopedMatches.length) needHost.push(row);\n } catch (error) {\n exclude(row, error);\n }\n }\n if (!sharedHost) for (const row of needHost) exclude(row, missingHost());\n return claims.every((claim) => providerFor(claim) === provider)\n ? provider\n : undefined;\n}\n\nconst nonempty = z.string().regex(/\\S/u, \"Expected nonempty text.\");\nconst optionalValue = z.unknown().optional();\nconst absent = z.never().optional();\nconst vulnerablePackage = z.object({\n name: nonempty,\n version: nonempty,\n packageManager: optionalValue,\n epoch: optionalValue,\n release: optionalValue,\n fixedInVersion: optionalValue,\n filePath: optionalValue,\n sourceLayerHash: absent,\n sourceLambdaLayerArn: absent,\n});\nconst repositoryFinding = z.object({\n type: z.enum([\"PACKAGE_VULNERABILITY\", \"CODE_VULNERABILITY\"]),\n resources: z\n .array(\n z.object({\n type: z.literal(\"CODE_REPOSITORY\"),\n details: z.strictObject({ codeRepository: optionalValue }).nullish(),\n }),\n )\n .min(1),\n networkReachabilityDetails: absent,\n packageVulnerabilityDetails: z\n .object({\n vulnerabilityId: nonempty,\n source: nonempty,\n sourceUrl: optionalValue,\n relatedVulnerabilities: z.array(nonempty).nullish(),\n vulnerablePackages: z.array(vulnerablePackage).nullish(),\n })\n .optional(),\n codeVulnerabilityDetails: z\n .object({\n detectorName: nonempty,\n detectorId: nonempty,\n cwes: z.array(z.unknown()),\n filePath: z.object({\n fileName: optionalValue,\n filePath: optionalValue,\n startLine: optionalValue,\n endLine: optionalValue,\n }),\n sourceLambdaLayerArn: absent,\n })\n .optional(),\n});\nfunction selectedFinding(value: unknown) {\n const native = record(value, \"Inspector finding\");\n const parsed = repositoryFinding.safeParse(native);\n if (!parsed.success)\n throw new Error(\n `Expected an Inspector vulnerability on CODE_REPOSITORY resources. ${z.prettifyError(parsed.error)}`,\n );\n const {\n type,\n packageVulnerabilityDetails: pkg,\n codeVulnerabilityDetails: code,\n } = parsed.data;\n if (\n (pkg && type !== \"PACKAGE_VULNERABILITY\") ||\n (code && type !== \"CODE_VULNERABILITY\")\n )\n throw new Error(\n \"Inspector finding contains details for a different finding type.\",\n );\n return { native, pkg, code };\n}\n\nfunction isInspectorFinding(value: unknown, occurrenceId?: string): boolean {\n return (\n isRecord(value) &&\n typeof value[\"findingArn\"] === \"string\" &&\n findingArn.test(value[\"findingArn\"]) &&\n (occurrenceId === undefined || value[\"findingArn\"] === occurrenceId) &&\n Array.isArray(value[\"resources\"])\n );\n}\n\nfunction hasInspectorEvidence(\n sourceData: unknown,\n occurrenceId?: string,\n): boolean {\n return (\n isRecord(sourceData) &&\n (sourceData[\"format\"] === format ||\n isInspectorFinding(sourceData[\"finding\"], occurrenceId) ||\n isInspectorFinding(sourceData, occurrenceId))\n );\n}\n\nexport function inspectorReportRepository(\n provider: Provider,\n findings: readonly ExternalFinding[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n): (ExternalSourceRepository & { findingId: string }) | undefined {\n if (provider !== \"inspector\") {\n if (\n findings.some(({ evidence, source_finding_id }) =>\n hasInspectorEvidence(evidence.source_data, source_finding_id),\n )\n )\n throw new CodexSecurityError(\n \"Retained Inspector evidence requires the inspector provider.\",\n );\n return undefined;\n }\n const retained = [];\n for (const { source_finding_id: id, evidence } of findings) {\n const data = evidence.source_data;\n if (!isRecord(data) || data[\"format\"] !== format) {\n if (projectMap || hasInspectorEvidence(data) || findingArn.test(id))\n throw new Error(\n \"Expected retained Inspector ListFindings evidence for the finding ARN.\",\n );\n continue;\n }\n const source = repositoryUrl(data[\"sourceRepositoryUrl\"]);\n const { native: finding } = selectedFinding(data[\"finding\"]);\n if (finding[\"findingArn\"] !== id)\n throw new Error(\n \"Inspector source_finding_id does not match the retained finding ARN.\",\n );\n retained.push({\n source,\n claims: repositoryClaims(finding),\n id,\n declared: evidence.details?.repository?.url,\n });\n }\n const first = retained[0];\n if (!first) return undefined;\n // A supplied map owns the path casing on custom hosts.\n const github =\n checkReportScope(retained, target, projectMap) === \"GITHUB\" && !projectMap;\n const key =\n github || target === \"cloud\" ? cloudRepositoryUrlKey : repositoryUrlKey;\n const repository = key(first.source);\n for (const { source, declared } of retained) {\n if (key(source) !== repository)\n throw new Error(\n \"Inspector export identifies more than one source repository.\",\n );\n if (declared && key(declared) !== repository)\n throw new Error(\n \"Retained scanner repository does not match the normalized evidence repository.\",\n );\n }\n return {\n findingId: first.id,\n url: first.source,\n ...(github && { platform: \"github\" }),\n };\n}\n\nfunction timestamp(value: unknown): number {\n const seconds = awsTimestampSeconds(value);\n if (!Number.isFinite(seconds))\n throw new Error(\"Invalid Inspector timestamp.\");\n return Math.floor(seconds);\n}\n\nconst ecosystems = new Map(\n Object.entries({\n BUNDLER: \"rubygems\",\n GEMSPEC: \"rubygems\",\n CARGO: \"cargo\",\n COMPOSER: \"composer\",\n NPM: \"npm\",\n YARN: \"npm\",\n NODEPKG: \"npm\",\n NUGET: \"nuget\",\n DOTNET_CORE: \"nuget\",\n GOBINARY: \"go\",\n GOMOD: \"go\",\n JAR: \"java\",\n POM: \"maven\",\n PIP: \"pypi\",\n PIPENV: \"pypi\",\n POETRY: \"pypi\",\n PYTHONPKG: \"pypi\",\n }),\n);\n\nconst manifests = new Set([\n \"package.json\",\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"Cargo.toml\",\n \"Cargo.lock\",\n \"composer.json\",\n \"composer.lock\",\n \"Gemfile\",\n \"Gemfile.lock\",\n \"go.mod\",\n \"go.sum\",\n \"pom.xml\",\n \"build.gradle\",\n \"build.gradle.kts\",\n \"gradle.lockfile\",\n \"Pipfile\",\n \"Pipfile.lock\",\n \"poetry.lock\",\n \"pyproject.toml\",\n \"uv.lock\",\n \"packages.config\",\n \"packages.lock.json\",\n]);\n\nfunction manifestPath(path: string | null): string | null {\n if (!path) return null;\n const name = posix.basename(path);\n return manifests.has(name) ||\n /^requirements(?:[-_.].*)?\\.txt$/u.test(name) ||\n /\\.(?:csproj|fsproj|vbproj|gemspec)$/u.test(name)\n ? path\n : null;\n}\n\nfunction evidence(\n { native: finding, pkg, code }: ReturnType<typeof selectedFinding>,\n id: string,\n source: string,\n target: ExternalImportTarget,\n previousProjection: boolean,\n) {\n const {\n description,\n severity,\n remediation,\n firstObservedAt,\n lastObservedAt,\n updatedAt,\n status,\n } = finding;\n const { recommendation } = record(remediation, \"Inspector remediation\");\n record(recommendation ?? {}, \"Inspector recommendation\");\n requiredText(status, \"Inspector status\");\n timestamp(firstObservedAt);\n timestamp(lastObservedAt);\n const level = requiredText(severity, \"Inspector severity\").toLowerCase();\n const paths = new Set<string>();\n const packages = (pkg?.vulnerablePackages ?? []).map((item) => {\n const path = repositoryFilePath(item.filePath);\n if (path) paths.add(path);\n const ecosystem = ecosystems.get(text(item.packageManager) ?? \"\") ?? null;\n const version = (value: unknown) =>\n concreteVersion(value, ecosystem, item.packageManager === \"OS\");\n const fixed = version(item.fixedInVersion);\n const splitVersion =\n item.packageManager === \"OS\" &&\n (item.epoch != null || item.release != null);\n return {\n name: item.name,\n ecosystem,\n installed_version: splitVersion ? null : version(item.version),\n manifest_path: manifestPath(path),\n fixed_versions: fixed ? [fixed] : [],\n };\n });\n const locations: { path: string; line: number | null }[] = [...paths].map(\n (path) => ({ path, line: null }),\n );\n let endLine: number | null = null;\n if (code) {\n const { fileName, filePath, startLine, endLine: end } = code.filePath;\n const path = repositoryFilePath(filePath);\n if (path && posix.basename(path) === fileName) {\n const line =\n typeof startLine === \"number\" &&\n Number.isSafeInteger(startLine) &&\n startLine > 0\n ? startLine\n : null;\n locations.push({ path, line });\n if (\n line !== null &&\n typeof end === \"number\" &&\n Number.isSafeInteger(end) &&\n end >= line\n )\n endLine = end;\n }\n }\n const advisoryIds = pkg ? [pkg.vulnerabilityId] : [];\n const base = {\n title:\n text(finding[\"title\"]) ??\n pkg?.vulnerabilityId ??\n code?.detectorName ??\n id,\n description: requiredText(description, \"Inspector description\"),\n severity: scannerSeverity(level),\n url: text(pkg?.sourceUrl),\n advisory_ids:\n previousProjection && pkg?.relatedVulnerabilities\n ? [...new Set(advisoryIds.concat(pkg.relatedVulnerabilities))]\n : advisoryIds,\n packages,\n locations,\n source_updated_at: updatedAt === undefined ? null : timestamp(updatedAt),\n source_data: {\n format,\n sourceRepositoryUrl: source,\n finding: structuredClone(finding),\n },\n };\n const enrichment =\n code && !previousProjection\n ? {\n details: {\n kind: \"sast\",\n repository: { url: source },\n rule: { id: code.detectorId, name: code.detectorName },\n weakness_ids: strings(code.cwes),\n code: endLine === null ? null : { end_line: endLine },\n },\n }\n : undefined;\n return validateEnrichedExternalEvidence(base, target, enrichment);\n}\n\nexport function normalizeInspectorFindings(\n input: unknown,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): ExternalFindings {\n return normalizeReport(input, sourceRepositoryUrl, target, projectMap, false);\n}\n\n/** @internal Reconstruct the prior evidence when matching a pending publication. */\nexport function normalizePreviousInspectorFindings(\n input: unknown,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): ExternalFindings {\n return normalizeReport(input, sourceRepositoryUrl, target, projectMap, true);\n}\n\nfunction normalizeReport(\n input: unknown,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget,\n projectMap: ReadonlyMap<string, string> | undefined,\n previousProjection: boolean,\n): ExternalFindings {\n const source = repositoryUrl(sourceRepositoryUrl);\n if (\n isRecord(input) &&\n (Object.hasOwn(input, \"NextToken\") || Object.hasOwn(input, \"nextToken\"))\n )\n throw new Error(\n \"Inspector export has a continuation key; supply the complete paginated CLI JSON output.\",\n );\n const report = listFindings.safeParse(input);\n if (!report.success)\n throw new Error(\n \"Expected only a complete native Inspector ListFindings response with a findings array.\",\n );\n const rows = report.data.findings.map((finding, i) => ({\n finding,\n source,\n position: i + 1,\n claims: repositoryClaims(finding),\n }));\n checkReportScope(rows, target, projectMap);\n function checkRetainedScope(\n result: ExternalFindings,\n removedIds?: Set<string>,\n ) {\n if (!result.excluded.length || !result.findings.length) return;\n // Only surviving rows can supply shared provider and host evidence on replay.\n const skipped = new Set(result.excluded.map((row) => row.position));\n const retained = rows.filter((row) => !skipped.has(row.position));\n checkReportScope(retained, target, projectMap, (row, error) => {\n skipped.add(row.position);\n result.excluded.push({\n position: row.position,\n source_finding_id: identity(record(row.finding, \"Inspector finding\"))\n .arn,\n reason: errorMessage(error),\n });\n });\n result.findings = result.findings.filter((finding, i) => {\n if (!skipped.has(retained[i]!.position)) return true;\n removedIds?.add(finding.source_finding_id);\n return false;\n });\n result.excluded.sort((a, b) => a.position - b.position);\n }\n return normalizeRecords(\n rows,\n ({ finding }, id) =>\n evidence(\n selectedFinding(finding),\n id,\n source,\n target,\n previousProjection,\n ),\n ({ finding }) => identity(record(finding, \"Inspector finding\")).arn,\n target,\n { filter: checkRetainedScope },\n );\n}\n\nexport async function readInspectorFindings(\n path: string,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): Promise<ExternalFindings> {\n const mapping = projectMap && new Map(projectMap);\n return normalizeInspectorFindings(\n await readScannerJson(path),\n sourceRepositoryUrl,\n target,\n mapping,\n );\n}\n"]}
1
+ {"version":3,"file":"inspector-findings.js","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,GAEjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,IAAI,GACL,MAAM,qBAAqB,CAAC;AAI7B,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AACxE,MAAM,MAAM,GAAG,iCAAiC,CAAC;AACjD,MAAM,UAAU,GACd,kGAAkG,CAAC;AACrG,MAAM,cAAc,GAClB,4GAA4G,CAAC;AAC/G,MAAM,aAAa,GACjB,yEAAyE,CAAC;AAC5E,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C,SAAS,aAAa,CAAC,KAAc;IACnC,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,EAAE,mCAAmC,CAAC,CAAC;IACrE,MAAM,GAAG,GAAG,GAAG,CAAC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C;IACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAY,EACZ,mBAA2B,EAC3B,MAAM,GAAyB,OAAO,EACtC,UAAwC;IAExC,MAAM,OAAO,GAAG,UAAU,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IAClD,OAAO,0BAA0B,CAC/B,MAAM,eAAe,CAAC,IAAI,CAAC,EAC3B,mBAAmB,EACnB,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport { z } from \"zod\";\nimport type {\n ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nimport {\n cloudRepositoryUrlKey,\n repositoryUrlKey,\n validateEnrichedExternalEvidence,\n type ExternalImportTarget,\n} from \"./external-import-contract.js\";\nimport { isGitHubCloudHost } from \"./git-remote.js\";\nimport { CodexSecurityError, errorMessage } from \"./errors.js\";\nimport type { Provider } from \"./external-import-models.js\";\nimport { isRecord } from \"./record.js\";\nimport {\n awsTimestampSeconds,\n concreteVersion,\n normalizeRecords,\n readScannerJson,\n record,\n repositoryFilePath,\n requiredText,\n scannerSeverity,\n strings,\n text,\n} from \"./scanner-import.js\";\n\ntype Native = Record<string, unknown>;\n\nconst listFindings = z.strictObject({ findings: z.array(z.unknown()) });\nconst format = \"aws-inspector2-list-findings/v1\";\nconst findingArn =\n /^(arn:(aws[a-zA-Z-]*):inspector2:([a-z]{2}(?:-gov)?-[a-z]+-\\d):(\\d{12})):finding\\/[a-f0-9]{32}$/u;\nconst integrationArn =\n /^arn:aws[a-zA-Z-]*:inspector2:[a-z]{2}(?:-gov)?-[a-z]+-\\d:\\d{12}:codesecurity-integration\\/[a-f0-9-]{36}$/u;\nconst projectSuffix =\n /^project-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/u;\nconst absoluteUrl = /^[a-z][a-z\\d+.-]*:\\/\\//iu;\n\nfunction repositoryUrl(value: unknown): string {\n const raw = requiredText(value, \"Inspector --source-repository-url\");\n const url = URL.parse(raw);\n const path = /^https?:\\/\\/[^/?#]+(\\/[^?#]+)$/iu.exec(raw)?.[1];\n if (\n !url ||\n !path ||\n url.username ||\n url.password ||\n /[\\s\\\\?#]|%(?:2f|5c)/iu.test(raw) ||\n path !== url.pathname ||\n !/^\\/[^/]+(?:\\/[^/]+)+\\/?$/u.test(path)\n )\n throw new Error(\n \"Use a complete HTTP(S) Inspector source repository URL with a namespace and repository, without credentials, query or fragment.\",\n );\n return raw;\n}\n\nfunction projectIntegration(projectArn: string): string {\n const separator = projectArn.lastIndexOf(\"/\");\n const parent = projectArn.slice(0, separator);\n if (\n !integrationArn.test(parent) ||\n !projectSuffix.test(projectArn.slice(separator + 1))\n )\n throw new Error(\"Expected a full Inspector repository project ARN.\");\n return parent;\n}\n\n/** @internal Validate an operator-supplied project binding. */\nexport function validateInspectorProjectMapping(\n projectArn: string,\n canonicalUrl: unknown,\n): string {\n projectIntegration(projectArn);\n return repositoryUrl(canonicalUrl);\n}\n\nfunction identity(finding: Native) {\n const arn = requiredText(finding[\"findingArn\"], \"Inspector finding ARN\");\n const match = findingArn.exec(arn);\n if (!match) throw new Error(\"Expected an Inspector2 finding ARN.\");\n if (finding[\"awsAccountId\"] !== match[4])\n throw new Error(\"Inspector finding ARN and AWS account do not match.\");\n return {\n arn,\n issuer: match[1]!,\n partition: match[2]!,\n region: match[3]!,\n account: match[4]!,\n };\n}\n\nfunction repositoryClaim(\n { issuer, partition, region, account }: ReturnType<typeof identity>,\n resource: Native,\n) {\n for (const [field, expected] of Object.entries({\n partition,\n region,\n provider: \"AWS\",\n providerAccountId: account,\n })) {\n if (resource[field] !== undefined && resource[field] !== expected)\n throw new Error(\n \"Inspector repository resource and finding scope do not match.\",\n );\n }\n const { codeRepository } = record(\n resource[\"details\"] ?? {},\n \"Inspector resource details\",\n );\n const repo = record(codeRepository ?? {}, \"Inspector codeRepository\");\n const optional = (field: string) =>\n repo[field] === undefined\n ? undefined\n : requiredText(repo[field], `Inspector codeRepository.${field}`);\n const nativeId = requiredText(\n resource[\"id\"],\n \"Inspector repository resource ID\",\n );\n let integration = optional(\"integrationArn\");\n if (\n integration !== undefined &&\n (!integration.startsWith(issuer + \":\") || !integrationArn.test(integration))\n )\n throw new Error(\n \"Inspector integration ARN does not match the finding scope.\",\n );\n if (nativeId.startsWith(\"arn:\")) {\n const parent = projectIntegration(nativeId);\n if (\n !parent.startsWith(issuer + \":\") ||\n (integration !== undefined && parent !== integration)\n )\n throw new Error(\n \"Inspector repository resource ARN does not match its project or integration.\",\n );\n integration = parent;\n }\n return {\n project: JSON.stringify([issuer, nativeId]),\n integration,\n provider: optional(\"providerType\"),\n nativeId,\n name: optional(\"projectName\"),\n };\n}\n\nfunction checkRepositoryMapping(\n { nativeId, name }: ReturnType<typeof repositoryClaim>,\n source: string,\n provider: string | undefined,\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n) {\n const hostname = new URL(source).hostname;\n const knownGitHub = isGitHubCloudHost(hostname);\n const gitlab = provider === \"GITLAB_SELF_MANAGED\";\n const github = provider === \"GITHUB\" || knownGitHub;\n if (\n hostname === \"gitlab.com\" ||\n (gitlab && knownGitHub) ||\n (provider !== undefined && !gitlab && provider !== \"GITHUB\")\n )\n throw new Error(\n \"Inspector repository provider does not match the selected mapping.\",\n );\n if (target === \"cloud\" && !github)\n throw new Error(\n \"Inspector Cloud requires a GitHub repository provider; self-managed GitLab is local only.\",\n );\n const urls = [nativeId, name].filter(\n (url): url is string => !!url && absoluteUrl.test(url),\n );\n const key = github && !projectMap ? cloudRepositoryUrlKey : repositoryUrlKey;\n const path = new URL(\n (github ? cloudRepositoryUrlKey : repositoryUrlKey)(source),\n ).pathname.slice(1);\n const slug = github ? name?.toLowerCase() : name;\n const matchesSlug =\n !slug ||\n absoluteUrl.test(slug) ||\n slug === path ||\n slug === posix.basename(path) ||\n (gitlab && projectMap && path.endsWith(\"/\" + slug));\n if (\n !matchesSlug ||\n urls.some((url) => key(repositoryUrl(url)) !== key(source))\n )\n throw new Error(\n \"Inspector native repository does not match --source-repository-url.\",\n );\n if (projectMap) {\n // repositoryClaim validated this ARN and its issuer before the lookup.\n const trustedUrl = nativeId.startsWith(\"arn:\")\n ? projectMap.get(nativeId)\n : undefined;\n if (trustedUrl === undefined)\n throw new Error(\n \"Inspector project ARN is missing from the trusted mapping.\",\n );\n if (\n repositoryUrlKey(repositoryUrl(trustedUrl)) !== repositoryUrlKey(source)\n )\n throw new Error(\n \"Inspector project ARN mapping does not match the source repository URL.\",\n );\n return true;\n }\n return urls.length > 0;\n}\n\nfunction repositoryClaims(finding: unknown) {\n if (!isRecord(finding) || !Array.isArray(finding[\"resources\"])) return [];\n const claims = [];\n let origin: ReturnType<typeof identity> | undefined;\n for (const resource of finding[\"resources\"]) {\n if (!isRecord(resource) || resource[\"type\"] !== \"CODE_REPOSITORY\") continue;\n origin ??= identity(finding);\n claims.push(repositoryClaim(origin, resource));\n }\n return claims;\n}\n\n/** Claims from the whole export must identify one project, including excluded rows. */\nfunction checkReportScope<\n T extends { claims: ReturnType<typeof repositoryClaims>; source: string },\n>(\n rows: readonly T[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n exclude: (row: T, error: unknown) => void = (_, error) => {\n throw error;\n },\n): string | undefined {\n const claims = rows.flatMap((row) => row.claims);\n function shared(field: \"project\" | \"integration\" | \"provider\") {\n const values = new Set(claims.map((claim) => claim[field]));\n values.delete(undefined);\n if (values.size > 1)\n throw new Error(\n \"Inspector export identifies more than one repository project or integration.\",\n );\n return values.values().next().value;\n }\n shared(\"project\");\n shared(\"integration\");\n const provider = shared(\"provider\");\n type Claim = ReturnType<typeof repositoryClaim>;\n // A bare project ID can recur across integrations in the same account and Region.\n const sharedProvider = claims.find(\n (claim) => claim.integration && claim.provider,\n )?.provider;\n const providerFor = (claim: Claim) =>\n claim.provider ?? (claim.integration ? sharedProvider : undefined);\n const missingHost = () =>\n new Error(\n \"Inspector needs a matching native repository URL or a trusted project ARN mapping to identify the Git host.\",\n );\n const needHost = [];\n let sharedHost = false;\n for (const row of rows) {\n try {\n // Only a fully verified row can supply evidence to another row.\n const scopedMatches = row.claims.flatMap((claim) => {\n const proven = checkRepositoryMapping(\n claim,\n row.source,\n providerFor(claim),\n target,\n projectMap,\n );\n if (claim.integration) return [proven];\n if (!proven) throw missingHost();\n return [];\n });\n if (scopedMatches.includes(true)) sharedHost = true;\n else if (scopedMatches.length) needHost.push(row);\n } catch (error) {\n exclude(row, error);\n }\n }\n if (!sharedHost) for (const row of needHost) exclude(row, missingHost());\n return claims.every((claim) => providerFor(claim) === provider)\n ? provider\n : undefined;\n}\n\nconst nonempty = z.string().regex(/\\S/u, \"Expected nonempty text.\");\nconst optionalValue = z.unknown().optional();\nconst absent = z.never().optional();\nconst vulnerablePackage = z.object({\n name: nonempty,\n version: nonempty,\n packageManager: optionalValue,\n epoch: optionalValue,\n release: optionalValue,\n fixedInVersion: optionalValue,\n filePath: optionalValue,\n sourceLayerHash: absent,\n sourceLambdaLayerArn: absent,\n});\nconst repositoryFinding = z.object({\n type: z.enum([\"PACKAGE_VULNERABILITY\", \"CODE_VULNERABILITY\"]),\n resources: z\n .array(\n z.object({\n type: z.literal(\"CODE_REPOSITORY\"),\n details: z.strictObject({ codeRepository: optionalValue }).nullish(),\n }),\n )\n .min(1),\n networkReachabilityDetails: absent,\n packageVulnerabilityDetails: z\n .object({\n vulnerabilityId: nonempty,\n source: nonempty,\n sourceUrl: optionalValue,\n relatedVulnerabilities: z.array(nonempty).nullish(),\n vulnerablePackages: z.array(vulnerablePackage).nullish(),\n })\n .optional(),\n codeVulnerabilityDetails: z\n .object({\n detectorName: nonempty,\n detectorId: nonempty,\n cwes: z.array(z.unknown()),\n filePath: z.object({\n fileName: optionalValue,\n filePath: optionalValue,\n startLine: optionalValue,\n endLine: optionalValue,\n }),\n sourceLambdaLayerArn: absent,\n })\n .optional(),\n});\nfunction selectedFinding(value: unknown) {\n const native = record(value, \"Inspector finding\");\n const parsed = repositoryFinding.safeParse(native);\n if (!parsed.success)\n throw new Error(\n `Expected an Inspector vulnerability on CODE_REPOSITORY resources. ${z.prettifyError(parsed.error)}`,\n );\n const {\n type,\n packageVulnerabilityDetails: pkg,\n codeVulnerabilityDetails: code,\n } = parsed.data;\n if (\n (pkg && type !== \"PACKAGE_VULNERABILITY\") ||\n (code && type !== \"CODE_VULNERABILITY\")\n )\n throw new Error(\n \"Inspector finding contains details for a different finding type.\",\n );\n return { native, pkg, code };\n}\n\nfunction isInspectorFinding(value: unknown, occurrenceId?: string): boolean {\n return (\n isRecord(value) &&\n typeof value[\"findingArn\"] === \"string\" &&\n findingArn.test(value[\"findingArn\"]) &&\n (occurrenceId === undefined || value[\"findingArn\"] === occurrenceId) &&\n Array.isArray(value[\"resources\"])\n );\n}\n\nfunction hasInspectorEvidence(\n sourceData: unknown,\n occurrenceId?: string,\n): boolean {\n return (\n isRecord(sourceData) &&\n (sourceData[\"format\"] === format ||\n isInspectorFinding(sourceData[\"finding\"], occurrenceId) ||\n isInspectorFinding(sourceData, occurrenceId))\n );\n}\n\nexport function inspectorReportRepository(\n provider: Provider,\n findings: readonly ExternalFinding[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n): (ExternalSourceRepository & { findingId: string }) | undefined {\n if (provider !== \"inspector\") {\n if (\n findings.some(({ evidence, source_finding_id }) =>\n hasInspectorEvidence(evidence.source_data, source_finding_id),\n )\n )\n throw new CodexSecurityError(\n \"Retained Inspector evidence requires the inspector provider.\",\n );\n return undefined;\n }\n const retained = [];\n for (const { source_finding_id: id, evidence } of findings) {\n const data = evidence.source_data;\n if (!isRecord(data) || data[\"format\"] !== format) {\n if (projectMap || hasInspectorEvidence(data) || findingArn.test(id))\n throw new Error(\n \"Expected retained Inspector ListFindings evidence for the finding ARN.\",\n );\n continue;\n }\n const source = repositoryUrl(data[\"sourceRepositoryUrl\"]);\n const { native: finding } = selectedFinding(data[\"finding\"]);\n if (finding[\"findingArn\"] !== id)\n throw new Error(\n \"Inspector source_finding_id does not match the retained finding ARN.\",\n );\n retained.push({\n source,\n claims: repositoryClaims(finding),\n id,\n declared: evidence.details?.repository?.url,\n });\n }\n const first = retained[0];\n if (!first) return undefined;\n // A supplied map owns the path casing on custom hosts.\n const github =\n checkReportScope(retained, target, projectMap) === \"GITHUB\" && !projectMap;\n const key =\n github || target === \"cloud\" ? cloudRepositoryUrlKey : repositoryUrlKey;\n const repository = key(first.source);\n for (const { source, declared } of retained) {\n if (key(source) !== repository)\n throw new Error(\n \"Inspector export identifies more than one source repository.\",\n );\n if (declared && key(declared) !== repository)\n throw new Error(\n \"Retained scanner repository does not match the normalized evidence repository.\",\n );\n }\n return {\n findingId: first.id,\n url: first.source,\n ...(github && { platform: \"github\" }),\n };\n}\n\nfunction timestamp(value: unknown): number {\n const seconds = awsTimestampSeconds(value);\n if (!Number.isFinite(seconds))\n throw new Error(\"Invalid Inspector timestamp.\");\n return Math.floor(seconds);\n}\n\nconst ecosystems = new Map(\n Object.entries({\n BUNDLER: \"rubygems\",\n GEMSPEC: \"rubygems\",\n CARGO: \"cargo\",\n COMPOSER: \"composer\",\n NPM: \"npm\",\n YARN: \"npm\",\n NODEPKG: \"npm\",\n NUGET: \"nuget\",\n DOTNET_CORE: \"nuget\",\n GOBINARY: \"go\",\n GOMOD: \"go\",\n JAR: \"java\",\n POM: \"maven\",\n PIP: \"pypi\",\n PIPENV: \"pypi\",\n POETRY: \"pypi\",\n PYTHONPKG: \"pypi\",\n }),\n);\n\nconst manifests = new Set([\n \"package.json\",\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"Cargo.toml\",\n \"Cargo.lock\",\n \"composer.json\",\n \"composer.lock\",\n \"Gemfile\",\n \"Gemfile.lock\",\n \"go.mod\",\n \"go.sum\",\n \"pom.xml\",\n \"build.gradle\",\n \"build.gradle.kts\",\n \"gradle.lockfile\",\n \"Pipfile\",\n \"Pipfile.lock\",\n \"poetry.lock\",\n \"pyproject.toml\",\n \"uv.lock\",\n \"packages.config\",\n \"packages.lock.json\",\n]);\n\nfunction manifestPath(path: string | null): string | null {\n if (!path) return null;\n const name = posix.basename(path);\n return manifests.has(name) ||\n /^requirements(?:[-_.].*)?\\.txt$/u.test(name) ||\n /\\.(?:csproj|fsproj|vbproj|gemspec)$/u.test(name)\n ? path\n : null;\n}\n\nfunction evidence(\n { native: finding, pkg, code }: ReturnType<typeof selectedFinding>,\n id: string,\n source: string,\n target: ExternalImportTarget,\n) {\n const {\n description,\n severity,\n remediation,\n firstObservedAt,\n lastObservedAt,\n updatedAt,\n status,\n } = finding;\n const { recommendation } = record(remediation, \"Inspector remediation\");\n record(recommendation ?? {}, \"Inspector recommendation\");\n requiredText(status, \"Inspector status\");\n timestamp(firstObservedAt);\n timestamp(lastObservedAt);\n const level = requiredText(severity, \"Inspector severity\").toLowerCase();\n const paths = new Set<string>();\n const packages = (pkg?.vulnerablePackages ?? []).map((item) => {\n const path = repositoryFilePath(item.filePath);\n if (path) paths.add(path);\n const ecosystem = ecosystems.get(text(item.packageManager) ?? \"\") ?? null;\n const version = (value: unknown) =>\n concreteVersion(value, ecosystem, item.packageManager === \"OS\");\n const fixed = version(item.fixedInVersion);\n const splitVersion =\n item.packageManager === \"OS\" &&\n (item.epoch != null || item.release != null);\n return {\n name: item.name,\n ecosystem,\n installed_version: splitVersion ? null : version(item.version),\n manifest_path: manifestPath(path),\n fixed_versions: fixed ? [fixed] : [],\n };\n });\n const locations: { path: string; line: number | null }[] = [...paths].map(\n (path) => ({ path, line: null }),\n );\n let endLine: number | null = null;\n if (code) {\n const { fileName, filePath, startLine, endLine: end } = code.filePath;\n const path = repositoryFilePath(filePath);\n if (path && posix.basename(path) === fileName) {\n const line =\n typeof startLine === \"number\" &&\n Number.isSafeInteger(startLine) &&\n startLine > 0\n ? startLine\n : null;\n locations.push({ path, line });\n if (\n line !== null &&\n typeof end === \"number\" &&\n Number.isSafeInteger(end) &&\n end >= line\n )\n endLine = end;\n }\n }\n const advisoryIds = pkg ? [pkg.vulnerabilityId] : [];\n const base = {\n title:\n text(finding[\"title\"]) ??\n pkg?.vulnerabilityId ??\n code?.detectorName ??\n id,\n description: requiredText(description, \"Inspector description\"),\n severity: scannerSeverity(level),\n url: text(pkg?.sourceUrl),\n advisory_ids: advisoryIds,\n packages,\n locations,\n source_updated_at: updatedAt === undefined ? null : timestamp(updatedAt),\n source_data: {\n format,\n sourceRepositoryUrl: source,\n finding: structuredClone(finding),\n },\n };\n const enrichment = code\n ? {\n details: {\n kind: \"sast\",\n repository: { url: source },\n rule: { id: code.detectorId, name: code.detectorName },\n weakness_ids: strings(code.cwes),\n code: endLine === null ? null : { end_line: endLine },\n },\n }\n : undefined;\n return validateEnrichedExternalEvidence(base, target, enrichment);\n}\n\nexport function normalizeInspectorFindings(\n input: unknown,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): ExternalFindings {\n const source = repositoryUrl(sourceRepositoryUrl);\n if (\n isRecord(input) &&\n (Object.hasOwn(input, \"NextToken\") || Object.hasOwn(input, \"nextToken\"))\n )\n throw new Error(\n \"Inspector export has a continuation key; supply the complete paginated CLI JSON output.\",\n );\n const report = listFindings.safeParse(input);\n if (!report.success)\n throw new Error(\n \"Expected only a complete native Inspector ListFindings response with a findings array.\",\n );\n const rows = report.data.findings.map((finding, i) => ({\n finding,\n source,\n position: i + 1,\n claims: repositoryClaims(finding),\n }));\n checkReportScope(rows, target, projectMap);\n const result = normalizeRecords(\n rows,\n ({ finding }, id) => evidence(selectedFinding(finding), id, source, target),\n ({ finding }) => identity(record(finding, \"Inspector finding\")).arn,\n target,\n );\n if (!result.excluded.length || !result.findings.length) return result;\n // Only surviving rows can supply shared provider and host evidence on replay.\n const skipped = new Set(result.excluded.map((row) => row.position));\n const retained = rows.filter((row) => !skipped.has(row.position));\n checkReportScope(retained, target, projectMap, (row, error) => {\n skipped.add(row.position);\n result.excluded.push({\n position: row.position,\n source_finding_id: identity(record(row.finding, \"Inspector finding\")).arn,\n reason: errorMessage(error),\n });\n });\n result.findings = result.findings.filter(\n (_, i) => !skipped.has(retained[i]!.position),\n );\n result.excluded.sort((a, b) => a.position - b.position);\n return result;\n}\n\nexport async function readInspectorFindings(\n path: string,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): Promise<ExternalFindings> {\n const mapping = projectMap && new Map(projectMap);\n return normalizeInspectorFindings(\n await readScannerJson(path),\n sourceRepositoryUrl,\n target,\n mapping,\n );\n}\n"]}
@@ -10,5 +10,5 @@ export interface KnowledgeBaseSnapshot {
10
10
  readonly documents: Readonly<Record<string, string>>;
11
11
  }
12
12
  export declare function knowledgeBaseProtectedRoots(snapshot: KnowledgeBaseSnapshot, signal?: AbortSignal): Promise<string[]>;
13
- export declare function prepareKnowledgeBase(input: readonly string[] | KnowledgeBaseSnapshot, signal?: AbortSignal, directory?: string): Promise<PreparedKnowledgeBase>;
13
+ export declare function prepareKnowledgeBase(input: readonly string[] | KnowledgeBaseSnapshot, signal?: AbortSignal, directory?: string, repository?: string): Promise<PreparedKnowledgeBase>;
14
14
  //# sourceMappingURL=knowledge-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-base.d.ts","sourceRoot":"","sources":["../src/knowledge-base.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,IAAI,OA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