@openai/codex-security 0.8.2 → 0.8.3

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 (375) hide show
  1. package/README.md +43 -61
  2. package/_bundled_plugin/.app.json +4 -0
  3. package/_bundled_plugin/.mcp.json +1 -0
  4. package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
  5. package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
  6. package/_bundled_plugin/mcp/native/darwin-arm64/unix.node +0 -0
  7. package/_bundled_plugin/mcp/native/darwin-x64/unix.node +0 -0
  8. package/_bundled_plugin/mcp/native/linux-arm64-gnu/unix.node +0 -0
  9. package/_bundled_plugin/mcp/native/linux-arm64-musl/unix.node +0 -0
  10. package/_bundled_plugin/mcp/native/linux-x64-gnu/unix.node +0 -0
  11. package/_bundled_plugin/mcp/native/linux-x64-musl/unix.node +0 -0
  12. package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
  13. package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
  14. package/_bundled_plugin/mcp/permission-profile-preflight.mjs +46 -12
  15. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  16. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  17. package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
  18. package/_bundled_plugin/references/artifact-storage.md +1 -1
  19. package/_bundled_plugin/references/core-scan.md +14 -5
  20. package/_bundled_plugin/references/default-severity-rubric.md +28 -0
  21. package/_bundled_plugin/references/finding-detail-fields.md +1 -0
  22. package/_bundled_plugin/references/threat-model.md +1 -0
  23. package/_bundled_plugin/scripts/deep_scan_workbench.py +23 -112
  24. package/_bundled_plugin/scripts/finalize_scan_contract.py +167 -153
  25. package/_bundled_plugin/scripts/finding_preview.py +5 -29
  26. package/_bundled_plugin/scripts/posix_scan_local_files.py +187 -0
  27. package/_bundled_plugin/scripts/report_projection.py +87 -136
  28. package/_bundled_plugin/scripts/validate_scan_contract.py +2 -6
  29. package/_bundled_plugin/scripts/windows_scan_local_files.py +212 -55
  30. package/_bundled_plugin/scripts/workbench/retained_coverage.py +8 -24
  31. package/_bundled_plugin/scripts/workbench/saved_coverage.py +143 -231
  32. package/_bundled_plugin/scripts/workbench_cli.py +102 -13
  33. package/_bundled_plugin/scripts/workbench_constants.py +9 -0
  34. package/_bundled_plugin/scripts/workbench_db.py +186 -360
  35. package/_bundled_plugin/scripts/workbench_finding_workflows.py +86 -4
  36. package/_bundled_plugin/scripts/workbench_native_indexes.py +17 -21
  37. package/_bundled_plugin/scripts/workbench_remediation.py +495 -11
  38. package/_bundled_plugin/scripts/workbench_scan_history.py +22 -25
  39. package/_bundled_plugin/scripts/workbench_scan_start.py +1 -1
  40. package/_bundled_plugin/scripts/workbench_scan_usage.py +25 -52
  41. package/_bundled_plugin/scripts/workbench_schema.py +1 -1
  42. package/_bundled_plugin/scripts/workbench_setup.py +239 -0
  43. package/_bundled_plugin/scripts/workbench_source_scopes.py +15 -23
  44. package/_bundled_plugin/scripts/workbench_target.py +213 -20
  45. package/_bundled_plugin/scripts/workbench_validation.py +1 -9
  46. package/_bundled_plugin/shared/workbench-history-repairs.json +7 -0
  47. package/_bundled_plugin/shared/workbench-migrations.json +19 -0
  48. package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +1 -1
  49. package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +4 -68
  50. package/_bundled_plugin/skills/check-skills/SKILL.md +43 -0
  51. package/_bundled_plugin/skills/check-skills/agents/openai.yaml +4 -0
  52. package/_bundled_plugin/skills/cloud-findings/SKILL.md +2 -0
  53. package/_bundled_plugin/skills/fix-finding/SKILL.md +18 -1
  54. package/_bundled_plugin/skills/publish-findings/SKILL.md +64 -35
  55. package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +2 -21
  56. package/_bundled_plugin/skills/threat-model-visualize/scripts/build_explorer.py +14 -8
  57. package/_bundled_plugin/skills/track-findings/SKILL.md +5 -3
  58. package/_bundled_plugin/skills/triage-finding/references/github-rest-intake.md +22 -68
  59. package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +6 -4
  60. package/dist/api.d.ts +6 -1
  61. package/dist/api.d.ts.map +1 -1
  62. package/dist/api.js +411 -160
  63. package/dist/api.js.map +1 -1
  64. package/dist/auth.js +6 -1
  65. package/dist/auth.js.map +1 -1
  66. package/dist/blackduck-findings.d.ts +8 -0
  67. package/dist/blackduck-findings.d.ts.map +1 -0
  68. package/dist/blackduck-findings.js +305 -0
  69. package/dist/blackduck-findings.js.map +1 -0
  70. package/dist/bulk-scan-discovery.d.ts.map +1 -1
  71. package/dist/bulk-scan-discovery.js +51 -36
  72. package/dist/bulk-scan-discovery.js.map +1 -1
  73. package/dist/classify-severity-records.d.ts +5 -0
  74. package/dist/classify-severity-records.d.ts.map +1 -1
  75. package/dist/classify-severity-records.js +6 -8
  76. package/dist/classify-severity-records.js.map +1 -1
  77. package/dist/classify-severity.d.ts +4 -1
  78. package/dist/classify-severity.d.ts.map +1 -1
  79. package/dist/classify-severity.js +28 -9
  80. package/dist/classify-severity.js.map +1 -1
  81. package/dist/cli.d.ts +3 -0
  82. package/dist/cli.d.ts.map +1 -1
  83. package/dist/cli.js +608 -258
  84. package/dist/cli.js.map +1 -1
  85. package/dist/codex-prompt.d.ts +2 -0
  86. package/dist/codex-prompt.d.ts.map +1 -1
  87. package/dist/codex-prompt.js +6 -0
  88. package/dist/codex-prompt.js.map +1 -1
  89. package/dist/component-scan.d.ts.map +1 -1
  90. package/dist/component-scan.js +6 -5
  91. package/dist/component-scan.js.map +1 -1
  92. package/dist/config.d.ts +2 -1
  93. package/dist/config.d.ts.map +1 -1
  94. package/dist/config.js +162 -40
  95. package/dist/config.js.map +1 -1
  96. package/dist/continuum-findings.d.ts +7 -0
  97. package/dist/continuum-findings.d.ts.map +1 -0
  98. package/dist/continuum-findings.js +157 -0
  99. package/dist/continuum-findings.js.map +1 -0
  100. package/dist/contract-values.d.ts +28 -0
  101. package/dist/contract-values.d.ts.map +1 -0
  102. package/dist/contract-values.js +75 -0
  103. package/dist/contract-values.js.map +1 -0
  104. package/dist/contract.d.ts +2 -20
  105. package/dist/contract.d.ts.map +1 -1
  106. package/dist/contract.js +58 -669
  107. package/dist/contract.js.map +1 -1
  108. package/dist/cost-model.d.ts.map +1 -1
  109. package/dist/cost-model.js +1 -4
  110. package/dist/cost-model.js.map +1 -1
  111. package/dist/cost.d.ts +19 -1
  112. package/dist/cost.d.ts.map +1 -1
  113. package/dist/cost.js +2120 -39
  114. package/dist/cost.js.map +1 -1
  115. package/dist/custom-validation-prompt.d.ts +1 -1
  116. package/dist/custom-validation-prompt.d.ts.map +1 -1
  117. package/dist/custom-validation-prompt.js +5 -0
  118. package/dist/custom-validation-prompt.js.map +1 -1
  119. package/dist/custom-validation.d.ts +2 -0
  120. package/dist/custom-validation.d.ts.map +1 -1
  121. package/dist/custom-validation.js +4 -0
  122. package/dist/custom-validation.js.map +1 -1
  123. package/dist/deduplication/deduplication-prompts.d.ts +4 -4
  124. package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
  125. package/dist/deduplication/deduplication-prompts.js +2 -2
  126. package/dist/deduplication/deduplication-prompts.js.map +1 -1
  127. package/dist/deduplication/deduplication-reviewer.d.ts +14 -11
  128. package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
  129. package/dist/deduplication/deduplication-reviewer.js +11 -4
  130. package/dist/deduplication/deduplication-reviewer.js.map +1 -1
  131. package/dist/deduplication/deduplication.js.map +1 -1
  132. package/dist/deduplication/finding-schema.d.ts +19 -1
  133. package/dist/deduplication/finding-schema.d.ts.map +1 -1
  134. package/dist/deduplication/finding-schema.js +25 -0
  135. package/dist/deduplication/finding-schema.js.map +1 -1
  136. package/dist/deduplication/local.d.ts.map +1 -1
  137. package/dist/deduplication/local.js +3 -8
  138. package/dist/deduplication/local.js.map +1 -1
  139. package/dist/deduplication/records.d.ts +8 -2
  140. package/dist/deduplication/records.d.ts.map +1 -1
  141. package/dist/deduplication/records.js +36 -8
  142. package/dist/deduplication/records.js.map +1 -1
  143. package/dist/deep-scan.d.ts +11 -0
  144. package/dist/deep-scan.d.ts.map +1 -1
  145. package/dist/deep-scan.js +235 -4
  146. package/dist/deep-scan.js.map +1 -1
  147. package/dist/default-severity-rubric.d.ts +1 -2
  148. package/dist/default-severity-rubric.d.ts.map +1 -1
  149. package/dist/default-severity-rubric.js +2 -66
  150. package/dist/default-severity-rubric.js.map +1 -1
  151. package/dist/endor-findings.d.ts.map +1 -1
  152. package/dist/endor-findings.js +7 -37
  153. package/dist/endor-findings.js.map +1 -1
  154. package/dist/errors.js +1 -1
  155. package/dist/errors.js.map +1 -1
  156. package/dist/external-findings-import.d.ts.map +1 -1
  157. package/dist/external-findings-import.js +5 -11
  158. package/dist/external-findings-import.js.map +1 -1
  159. package/dist/external-findings-local.d.ts +9 -0
  160. package/dist/external-findings-local.d.ts.map +1 -1
  161. package/dist/external-findings-local.js +325 -179
  162. package/dist/external-findings-local.js.map +1 -1
  163. package/dist/external-findings-publish.d.ts +12 -0
  164. package/dist/external-findings-publish.d.ts.map +1 -1
  165. package/dist/external-findings-publish.js +1202 -214
  166. package/dist/external-findings-publish.js.map +1 -1
  167. package/dist/external-findings-read.d.ts +8 -0
  168. package/dist/external-findings-read.d.ts.map +1 -1
  169. package/dist/external-findings-read.js +65 -54
  170. package/dist/external-findings-read.js.map +1 -1
  171. package/dist/external-findings.d.ts +2 -0
  172. package/dist/external-findings.d.ts.map +1 -1
  173. package/dist/external-findings.js +111 -0
  174. package/dist/external-findings.js.map +1 -1
  175. package/dist/external-import-contract.d.ts +29 -1
  176. package/dist/external-import-contract.d.ts.map +1 -1
  177. package/dist/external-import-contract.js +314 -44
  178. package/dist/external-import-contract.js.map +1 -1
  179. package/dist/external-import-models.d.ts +1 -1
  180. package/dist/external-import-models.d.ts.map +1 -1
  181. package/dist/external-import-models.js.map +1 -1
  182. package/dist/finding-normalization.d.ts +1 -1
  183. package/dist/finding-normalization.d.ts.map +1 -1
  184. package/dist/finding-normalization.js +46 -11
  185. package/dist/finding-normalization.js.map +1 -1
  186. package/dist/finding-retrieval.d.ts +3 -3
  187. package/dist/finding-retrieval.d.ts.map +1 -1
  188. package/dist/finding-retrieval.js.map +1 -1
  189. package/dist/finding-workflow.d.ts +6 -1
  190. package/dist/finding-workflow.d.ts.map +1 -1
  191. package/dist/finding-workflow.js +2 -2
  192. package/dist/finding-workflow.js.map +1 -1
  193. package/dist/git-remote.d.ts +4 -0
  194. package/dist/git-remote.d.ts.map +1 -1
  195. package/dist/git-remote.js +20 -0
  196. package/dist/git-remote.js.map +1 -1
  197. package/dist/github-advisories.d.ts +3 -12
  198. package/dist/github-advisories.d.ts.map +1 -1
  199. package/dist/github-advisories.js +9 -29
  200. package/dist/github-advisories.js.map +1 -1
  201. package/dist/github-dependabot-findings.d.ts.map +1 -1
  202. package/dist/github-dependabot-findings.js +7 -16
  203. package/dist/github-dependabot-findings.js.map +1 -1
  204. package/dist/github-findings.d.ts.map +1 -1
  205. package/dist/github-findings.js +344 -56
  206. package/dist/github-findings.js.map +1 -1
  207. package/dist/github.d.ts +17 -7
  208. package/dist/github.d.ts.map +1 -1
  209. package/dist/github.js +43 -30
  210. package/dist/github.js.map +1 -1
  211. package/dist/host-protocol.d.ts +2 -2
  212. package/dist/host-protocol.d.ts.map +1 -1
  213. package/dist/host-protocol.js.map +1 -1
  214. package/dist/host-records-protocol.d.ts +10 -11
  215. package/dist/host-records-protocol.d.ts.map +1 -1
  216. package/dist/host-records-protocol.js +69 -9
  217. package/dist/host-records-protocol.js.map +1 -1
  218. package/dist/hosted-scan.d.ts +15 -0
  219. package/dist/hosted-scan.d.ts.map +1 -1
  220. package/dist/hosted-scan.js +55 -33
  221. package/dist/hosted-scan.js.map +1 -1
  222. package/dist/index.d.ts +7 -0
  223. package/dist/index.d.ts.map +1 -1
  224. package/dist/index.js +6 -0
  225. package/dist/index.js.map +1 -1
  226. package/dist/inspector-findings.d.ts.map +1 -1
  227. package/dist/inspector-findings.js +13 -18
  228. package/dist/inspector-findings.js.map +1 -1
  229. package/dist/knowledge-base.js +18 -5
  230. package/dist/knowledge-base.js.map +1 -1
  231. package/dist/local-git-metadata.d.ts +5 -0
  232. package/dist/local-git-metadata.d.ts.map +1 -0
  233. package/dist/local-git-metadata.js +131 -0
  234. package/dist/local-git-metadata.js.map +1 -0
  235. package/dist/multiscan.d.ts.map +1 -1
  236. package/dist/multiscan.js +22 -12
  237. package/dist/multiscan.js.map +1 -1
  238. package/dist/opengrep-findings.d.ts.map +1 -1
  239. package/dist/opengrep-findings.js +34 -20
  240. package/dist/opengrep-findings.js.map +1 -1
  241. package/dist/patch-tui.d.ts.map +1 -1
  242. package/dist/patch-tui.js +90 -35
  243. package/dist/patch-tui.js.map +1 -1
  244. package/dist/private-finding-import.d.ts +246 -0
  245. package/dist/private-finding-import.d.ts.map +1 -0
  246. package/dist/private-finding-import.js +387 -0
  247. package/dist/private-finding-import.js.map +1 -0
  248. package/dist/project-config.d.ts.map +1 -1
  249. package/dist/project-config.js +2 -2
  250. package/dist/project-config.js.map +1 -1
  251. package/dist/provider-profile.d.ts +10 -2
  252. package/dist/provider-profile.d.ts.map +1 -1
  253. package/dist/provider-profile.js +72 -10
  254. package/dist/provider-profile.js.map +1 -1
  255. package/dist/publication.js +7 -1
  256. package/dist/publication.js.map +1 -1
  257. package/dist/reader-selection.d.ts +13 -0
  258. package/dist/reader-selection.d.ts.map +1 -0
  259. package/dist/reader-selection.js +81 -0
  260. package/dist/reader-selection.js.map +1 -0
  261. package/dist/record.d.ts +6 -1
  262. package/dist/record.d.ts.map +1 -1
  263. package/dist/record.js +53 -2
  264. package/dist/record.js.map +1 -1
  265. package/dist/remediation.d.ts +5 -0
  266. package/dist/remediation.d.ts.map +1 -1
  267. package/dist/remediation.js +30 -0
  268. package/dist/remediation.js.map +1 -1
  269. package/dist/result.d.ts +2 -0
  270. package/dist/result.d.ts.map +1 -1
  271. package/dist/result.js +3 -1
  272. package/dist/result.js.map +1 -1
  273. package/dist/runtime.d.ts +2 -1
  274. package/dist/runtime.d.ts.map +1 -1
  275. package/dist/runtime.js +95 -52
  276. package/dist/runtime.js.map +1 -1
  277. package/dist/scan-activity.js +40 -17
  278. package/dist/scan-activity.js.map +1 -1
  279. package/dist/scan-comparison.d.ts +1 -1
  280. package/dist/scan-comparison.d.ts.map +1 -1
  281. package/dist/scan-comparison.js +11 -13
  282. package/dist/scan-comparison.js.map +1 -1
  283. package/dist/scan-dashboard.d.ts +1 -0
  284. package/dist/scan-dashboard.d.ts.map +1 -1
  285. package/dist/scan-dashboard.js +16 -37
  286. package/dist/scan-dashboard.js.map +1 -1
  287. package/dist/scan-executor.d.ts +2 -0
  288. package/dist/scan-executor.d.ts.map +1 -1
  289. package/dist/scan-executor.js.map +1 -1
  290. package/dist/scan-history-renderer.d.ts.map +1 -1
  291. package/dist/scan-history-renderer.js +22 -9
  292. package/dist/scan-history-renderer.js.map +1 -1
  293. package/dist/scan-logs.d.ts.map +1 -1
  294. package/dist/scan-logs.js +5 -5
  295. package/dist/scan-logs.js.map +1 -1
  296. package/dist/scanner-import.d.ts +46 -6
  297. package/dist/scanner-import.d.ts.map +1 -1
  298. package/dist/scanner-import.js +208 -42
  299. package/dist/scanner-import.js.map +1 -1
  300. package/dist/scanner-repository-url.d.ts +14 -0
  301. package/dist/scanner-repository-url.d.ts.map +1 -0
  302. package/dist/scanner-repository-url.js +67 -0
  303. package/dist/scanner-repository-url.js.map +1 -0
  304. package/dist/semgrep-findings.d.ts.map +1 -1
  305. package/dist/semgrep-findings.js +20 -48
  306. package/dist/semgrep-findings.js.map +1 -1
  307. package/dist/semgrep-platform-findings.d.ts +12 -0
  308. package/dist/semgrep-platform-findings.d.ts.map +1 -0
  309. package/dist/semgrep-platform-findings.js +198 -0
  310. package/dist/semgrep-platform-findings.js.map +1 -0
  311. package/dist/severity-rubric.d.ts +20 -0
  312. package/dist/severity-rubric.d.ts.map +1 -0
  313. package/dist/severity-rubric.js +73 -0
  314. package/dist/severity-rubric.js.map +1 -0
  315. package/dist/severity-store.js +15 -5
  316. package/dist/severity-store.js.map +1 -1
  317. package/dist/snyk-findings.d.ts.map +1 -1
  318. package/dist/snyk-findings.js +21 -20
  319. package/dist/snyk-findings.js.map +1 -1
  320. package/dist/sonar-collector.d.ts +16 -0
  321. package/dist/sonar-collector.d.ts.map +1 -0
  322. package/dist/sonar-collector.js +383 -0
  323. package/dist/sonar-collector.js.map +1 -0
  324. package/dist/sonar-findings.d.ts +49 -0
  325. package/dist/sonar-findings.d.ts.map +1 -0
  326. package/dist/sonar-findings.js +288 -0
  327. package/dist/sonar-findings.js.map +1 -0
  328. package/dist/sonar-import.d.ts +111 -0
  329. package/dist/sonar-import.d.ts.map +1 -0
  330. package/dist/sonar-import.js +279 -0
  331. package/dist/sonar-import.js.map +1 -0
  332. package/dist/suggest-owners.d.ts.map +1 -1
  333. package/dist/suggest-owners.js +2 -1
  334. package/dist/suggest-owners.js.map +1 -1
  335. package/dist/targets.d.ts +3 -0
  336. package/dist/targets.d.ts.map +1 -1
  337. package/dist/targets.js +18 -12
  338. package/dist/targets.js.map +1 -1
  339. package/dist/terminal-columns.d.ts +4 -0
  340. package/dist/terminal-columns.d.ts.map +1 -0
  341. package/dist/terminal-columns.js +19 -0
  342. package/dist/terminal-columns.js.map +1 -0
  343. package/dist/validation-records.d.ts +0 -3
  344. package/dist/validation-records.d.ts.map +1 -1
  345. package/dist/validation-records.js +0 -16
  346. package/dist/validation-records.js.map +1 -1
  347. package/dist/veracode-findings.d.ts +7 -0
  348. package/dist/veracode-findings.d.ts.map +1 -0
  349. package/dist/veracode-findings.js +371 -0
  350. package/dist/veracode-findings.js.map +1 -0
  351. package/dist/windows-path.d.ts.map +1 -1
  352. package/dist/windows-path.js +1 -0
  353. package/dist/windows-path.js.map +1 -1
  354. package/dist/wiz-csv.d.ts +2 -2
  355. package/dist/wiz-csv.d.ts.map +1 -1
  356. package/dist/wiz-csv.js +1 -3
  357. package/dist/wiz-csv.js.map +1 -1
  358. package/dist/wiz-findings.d.ts +10 -2
  359. package/dist/wiz-findings.d.ts.map +1 -1
  360. package/dist/wiz-findings.js +88 -49
  361. package/dist/wiz-findings.js.map +1 -1
  362. package/docs/classify-severity-records.md +1 -1
  363. package/docs/cli.md +310 -477
  364. package/docs/dedupe-records.md +10 -0
  365. package/docs/findings-service.md +21 -8
  366. package/docs/hosted-scans.md +16 -1
  367. package/package.json +8 -9
  368. package/schemas/external-findings.schema.json +12 -1
  369. package/schemas/hosted-scan-v2.fixture.json +16 -1
  370. package/_bundled_plugin/scripts/validate_tracking_source.py +0 -82
  371. package/_bundled_plugin/scripts/workbench_local_dedupe.py +0 -136
  372. package/dist/deduplication/records-protocol.d.ts +0 -4
  373. package/dist/deduplication/records-protocol.d.ts.map +0 -1
  374. package/dist/deduplication/records-protocol.js +0 -49
  375. package/dist/deduplication/records-protocol.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"external-findings-local.js","sourceRoot":"","sources":["../src/external-findings-local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EAAE,iBAAiB,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7C,SAA8C,EAC9C,YAAY,GAAoC,EAAE;IAElD,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACtC,sBAAsB,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,SAAS,CAAC,EAAE,KAAK,SAAS;QAAE,eAAe,CAAC,SAAS,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAC5E,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAChD,SAAS,CAAC,UAAU,EACpB,YAAY,EACZ,MAAM,CACP,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE;QAClC,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;QACtC,OAAO,CAAC,YAAY,CAAC,YAAY,IAAI,YAAY,CAAC,CAChD,OAAO,EACP,CAAC,wBAAwB,CAAC,EAC1B,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CACjD,CAAC;IACJ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,UAAU,CAAuC,CAAC;AAClE,CAAC","sourcesContent":["import { lstat, readFile, realpath, stat } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, resolve, sep } from \"node:path\";\nimport { isNumberObject } from \"node:util/types\";\nimport { environmentEntry } from \"./auth.js\";\nimport { CodexSecurityError } from \"./errors.js\";\nimport {\n forwardExternalImportSetting,\n requireExternalImports,\n} from \"./external-imports-feature.js\";\nimport {\n snapshotImportOptions,\n type ExternalFindings,\n type ExternalSourceRepository,\n} from \"./external-findings.js\";\nimport {\n cloudRepositoryUrlKey,\n repositoryUrlKey,\n validateExternalReport,\n} from \"./external-import-contract.js\";\nimport type {\n ExternalFindingEvidence,\n Provider,\n} from \"./external-import-models.js\";\nimport { isGitHubCloudHost, parseGitRemote } from \"./git-remote.js\";\nimport { inspectorReportRepository } from \"./inspector-findings.js\";\nimport { isRecord } from \"./record.js\";\nimport { dependabotRepository } from \"./github-dependabot-findings.js\";\nimport {\n bundledPluginRoot,\n canonicalConfigPath,\n canonicalizeModelSafePath,\n expandHome,\n requireOutputOutsideRepositories,\n runWorkbench,\n workbenchEnvironment,\n type WorkbenchCommandOptions,\n} from \"./runtime.js\";\nimport {\n abortable,\n gitMarkerRoot,\n gitOutput,\n gitProtectionRoots,\n normalizeRepository,\n nullIfMissingPath,\n} from \"./targets.js\";\n\n/** A scanner source record, independent of a Codex assessment or completed scan. */\nexport interface StoredExternalFinding {\n id: string;\n repository: string;\n provider: Provider;\n sourceKey: string;\n sourceFindingId: string;\n evidence: ExternalFindingEvidence;\n assessment: { state: \"not_assessed\" };\n version: number;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface NormalizedLocalImportOptions {\n /** Local checkout or source directory to associate with these records. */\n repository: string;\n provider: Provider;\n /** Stable scanner organization/project/branch namespace across imports. */\n sourceKey: string;\n /** Full Inspector project ARNs mapped to independently verified repository URLs. */\n inspectorProjectMap?: ReadonlyMap<string, string>;\n}\n\nexport interface LocalExternalImportDependencies {\n environment?: NodeJS.ProcessEnv;\n signal?: AbortSignal;\n runWorkbench?: typeof runWorkbench;\n /** Repository references supplied by a reader outside its projected evidence. */\n sourceRepositories?: readonly ExternalSourceRepository[];\n}\n\nexport interface LocalExternalImportPreview extends ExternalFindings {\n repository: string;\n source: { provider: Provider; source_key: string };\n}\n\nexport interface LocalExternalImportResult {\n repository: string;\n read: number;\n report?: ExternalFindings[\"report\"];\n ready: number;\n excluded: ExternalFindings[\"excluded\"];\n findings: StoredExternalFinding[];\n counts: { created: number; updated: number; unchanged: number };\n}\n\nexport interface PreparedLocalExternalImport {\n preview: LocalExternalImportPreview;\n import(): Promise<LocalExternalImportResult>;\n}\n\nfunction requireIdentity(\n value: unknown,\n field: string,\n): asserts value is string {\n if (typeof value !== \"string\" || !value.trim() || value.includes(\"\\0\"))\n throw new CodexSecurityError(\n `${field} must be nonempty and contain no NUL characters.`,\n );\n}\n\nconst gitTransportPorts: Readonly<Record<string, string>> = {\n \"http:\": \"80\",\n \"https:\": \"443\",\n \"ssh:\": \"22\",\n \"git+ssh:\": \"22\",\n \"ssh+git:\": \"22\",\n \"git:\": \"9418\",\n \"ftp:\": \"21\",\n \"ftps:\": \"990\",\n};\n\n/** Compare transport forms without changing retained scanner evidence. */\nfunction remoteRepository(\n value: string,\n provider: Provider,\n bound: boolean,\n): { key: string; account?: string; homeRelative?: boolean } | undefined {\n if (/^[A-Za-z]:[\\\\/]/u.test(value)) return undefined;\n const transport = bound\n ? /^(?:ssh|git\\+ssh|ssh\\+git|git):\\/\\/([^/]*)(.*)$/isu.exec(value)\n : null;\n const authority = transport?.[1];\n const http = bound && /^https?:\\/\\//iu.test(value.trimStart());\n // Git decodes the authority before locating its path. An encoded delimiter\n // cannot prove a match to another spelling through WHATWG URL's hostname.\n if (\n authority &&\n (/%2f|[?#]/iu.test(authority) ||\n authority.slice(authority.lastIndexOf(\"@\") + 1).includes(\"%\"))\n )\n return { key: value };\n let remote;\n try {\n remote = parseGitRemote(value);\n } catch {\n return transport || http ? { key: \"\\0\" + value } : undefined;\n }\n if (!remote || !Object.hasOwn(gitTransportPorts, remote.url.protocol))\n return undefined;\n const { url, path, scpStyle } = remote;\n const ssh = url.protocol.includes(\"ssh\");\n const protocol = url.protocol === \"http:\" ? \"http:\" : \"https:\";\n const githubSshOverHttps =\n ssh &&\n url.hostname.toLowerCase() === \"ssh.github.com\" &&\n url.port === \"443\";\n const hostname = githubSshOverHttps ? \"github.com\" : url.hostname;\n const port =\n githubSshOverHttps || url.port === gitTransportPorts[url.protocol]\n ? \"\"\n : url.port;\n // A GitHub source identifies a case-insensitive repository on custom Enterprise\n // hosts too; other providers can refer to VCS hosts with case-sensitive paths.\n const key = provider === \"github\" ? cloudRepositoryUrlKey : repositoryUrlKey;\n const origin = `${protocol}//${hostname}${port ? `:${port}` : \"\"}/`;\n if (!bound) return { key: key(origin + path) };\n\n if (!ssh && url.protocol !== \"git:\") {\n if (url.protocol === \"http:\" || url.protocol === \"https:\") {\n // libcurl and WHATWG differ on backslashes and encoded dot segments.\n const raw = /^https?:\\/\\/[^/\\\\?#\\s]+(\\/[^\\\\?#]*)?(?:[?#].*)?$/iu.exec(\n value,\n );\n if (!raw || /\\/(?:%2e|\\.%2e|%2e\\.|%2e%2e)(?:\\/|$)/iu.test(raw[1] ?? \"\"))\n return { key: \"\\0\" + value };\n }\n const suffix = /[?#].*$/su.exec(value)?.[0] ?? \"\";\n // HTTP sends the query and omits fragment text from repository requests.\n if (suffix && ![\"http:\", \"https:\"].includes(url.protocol))\n return { key: key(origin + path) + \"\\0\" };\n return {\n key:\n key(origin + path) + suffix.replace(/#.*$/su, \"#\").replace(/\\/$/u, \"\"),\n };\n }\n\n // Git passes the original path (including dot segments, '?' and '#') to upload-pack.\n const literal = (raw: string) => {\n const bytes = Buffer.from(raw).toString(\"latin1\");\n return scpStyle\n ? bytes\n : bytes.replace(/%(?!00)([\\da-f]{2})/giu, (_, hex: string) =>\n String.fromCharCode(parseInt(hex, 16)),\n );\n };\n if (!scpStyle && !transport) return { key: value };\n const gitPath = literal(transport?.[2] ?? path);\n const login = scpStyle\n ? /^([^@/:\\s?#]+)@/u.exec(value)?.[1]\n : /^(.*)@/u.exec(authority ?? \"\")?.[1];\n const homeRelative =\n /^\\/?~(?:\\/|$)/u.test(gitPath) || (scpStyle && !/^[~/]/u.test(gitPath));\n const suffix = /[?#].*$/su.exec(gitPath);\n // Express upload-pack bytes as a URL path for comparison with the HTTP source.\n const name = gitPath\n .slice(0, suffix?.index)\n .replace(/^\\//u, \"\")\n .replace(\n /[%\\x00-\\x20\\x7f-\\xff]/gu,\n (byte) =>\n \"%\" + byte.charCodeAt(0).toString(16).toUpperCase().padStart(2, \"0\"),\n );\n const repository = suffix\n ? key(origin + name + \"?\") +\n \"\\0\" +\n suffix[0].replace(/\\/$/u, \"\").replace(/\\.git$/u, \"\")\n : key(origin + name);\n return {\n key: repository,\n account: ssh && login ? literal(login) : undefined,\n // GitHub serves the same repository path through its SCP and SSH URLs.\n homeRelative:\n ssh && provider !== \"github\" && !isGitHubCloudHost(hostname.toLowerCase())\n ? homeRelative\n : undefined,\n };\n}\n\nasync function bareMetadataRoots(\n repository: string,\n signal?: AbortSignal,\n): Promise<string[]> {\n const roots: string[] = [];\n let directory = repository;\n for (;;) {\n signal?.throwIfAborted();\n const present = async (name: string) =>\n (await abortable(\n () => lstat(join(directory, name)).catch(nullIfMissingPath),\n signal,\n )) !== null;\n // Git also discovers bare repositories and linked metadata without .git.\n const head = await abortable(\n () => lstat(join(directory, \"HEAD\")).catch(nullIfMissingPath),\n signal,\n );\n if (\n (head?.isFile() || head?.isSymbolicLink()) &&\n ((await present(\"commondir\")) ||\n ((await present(\"objects\")) && (await present(\"refs\"))))\n )\n roots.push(directory);\n const parent = dirname(directory);\n if (parent === directory) return roots;\n directory = parent;\n }\n}\n\nasync function metadataPointer(\n path: string,\n prefix: string,\n context: { directory: string; environment: NodeJS.ProcessEnv },\n signal?: AbortSignal,\n): Promise<string | undefined> {\n const metadata = await abortable(\n () => stat(path).catch(nullIfMissingPath),\n signal,\n );\n if (!metadata?.isFile()) return undefined;\n const text = await abortable(() => readFile(path, \"utf8\"), signal);\n if (!text.startsWith(prefix) || (prefix === \"\" && text.length === 0))\n return undefined;\n const payload = text.slice(prefix.length).replace(/[\\r\\n]+$/u, \"\");\n if (prefix !== \"\" && payload.length === 0) return undefined;\n // Git checks emptiness before consuming the path as a NUL-terminated string.\n const value = payload.split(\"\\0\", 1)[0]!;\n // Preserve filesystem traversal through links before '..'.\n let target = isAbsolute(value) ? value : `${dirname(path)}${sep}${value}`;\n if (process.platform === \"win32\") {\n const drive = /^[A-Za-z]:(?![\\\\/])/u.exec(value)?.[0].toUpperCase();\n if (drive !== undefined) {\n const directory =\n context.directory.slice(0, 2).toUpperCase() === drive\n ? context.directory\n : environmentEntry(context.environment, `=${drive}`) || `${drive}\\\\`;\n target = resolve(directory, value.slice(2));\n } else if (isAbsolute(value)) target = resolve(context.directory, value);\n }\n return (\n (await abortable(\n () => realpath(target).catch(nullIfMissingPath),\n signal,\n )) ?? undefined\n );\n}\n\nasync function associatedMetadataRoots(\n directory: string,\n context: { directory: string; environment: NodeJS.ProcessEnv },\n signal?: AbortSignal,\n configurationDirectory?: string,\n): Promise<string[]> {\n const head = await abortable(\n () => lstat(join(directory, \"HEAD\")).catch(nullIfMissingPath),\n signal,\n );\n if (!head || (!head.isFile() && !head.isSymbolicLink())) return [];\n const commonMarker = join(directory, \"commondir\");\n const hasCommon = await abortable(\n () => lstat(commonMarker).catch(nullIfMissingPath),\n signal,\n );\n const common = hasCommon\n ? await metadataPointer(commonMarker, \"\", context, signal)\n : undefined;\n if (hasCommon && common === undefined) return [];\n const storage = common ?? directory;\n for (const name of [\"objects\", \"refs\"]) {\n const metadata = await abortable(\n () => stat(join(storage, name)).catch(nullIfMissingPath),\n signal,\n );\n if (!metadata?.isDirectory()) return [];\n }\n const roots = common === undefined ? [directory] : [directory, common];\n if (\n process.platform === \"win32\" &&\n configurationDirectory !== undefined &&\n configurationDirectory !== context.directory\n ) {\n // Git rereads commondir after changing to the discovered repository root.\n roots.push(\n ...(await associatedMetadataRoots(\n directory,\n {\n ...context,\n directory: await abortable(\n () => canonicalConfigPath(configurationDirectory),\n signal,\n ),\n },\n signal,\n )),\n );\n }\n return roots;\n}\n\nasync function localGitProtectionRoots(\n repository: string,\n environment: NodeJS.ProcessEnv,\n signal?: AbortSignal,\n): Promise<string[]> {\n const roots = new Set(\n await abortable(() => gitProtectionRoots(repository, signal), signal),\n );\n const context = {\n directory: await abortable(() => canonicalConfigPath(repository), signal),\n environment,\n };\n const paths = new Set([resolve(repository), context.directory]);\n for (const path of paths) {\n for (const root of await bareMetadataRoots(path, signal)) {\n roots.add(root);\n for (const associated of await associatedMetadataRoots(\n root,\n context,\n signal,\n root,\n ))\n roots.add(associated);\n }\n let directory = path;\n for (;;) {\n signal?.throwIfAborted();\n const marker = join(directory, \".git\");\n const metadata = await abortable(\n () => stat(marker).catch(nullIfMissingPath),\n signal,\n );\n if (metadata !== null) {\n roots.add(directory);\n const gitDirectory = metadata.isDirectory()\n ? await abortable(() => realpath(marker), signal)\n : await metadataPointer(marker, \"gitdir: \", context, signal);\n if (gitDirectory !== undefined)\n for (const associated of await associatedMetadataRoots(\n gitDirectory,\n context,\n signal,\n directory,\n ))\n roots.add(associated);\n }\n const parent = dirname(directory);\n if (parent === directory) break;\n directory = parent;\n }\n }\n for (const root of [...roots])\n roots.add(await abortable(() => canonicalConfigPath(root), signal));\n return [...roots];\n}\n\nasync function hasGitMetadata(\n repository: string,\n signal?: AbortSignal,\n): Promise<boolean> {\n return (\n (await abortable(\n () => gitMarkerRoot(repository, signal, \"nearest\"),\n signal,\n )) !== null || (await bareMetadataRoots(repository, signal)).length !== 0\n );\n}\n\nasync function requireMatchingRepository(\n repository: string,\n provider: Provider,\n sources: readonly ExternalSourceRepository[],\n protectedRoots: WorkbenchCommandOptions[\"protectedRoot\"],\n environment: WorkbenchCommandOptions[\"environment\"],\n signal?: AbortSignal,\n): Promise<void> {\n if (sources.length === 0) return;\n if (!(await hasGitMetadata(repository, signal))) return;\n const gitProtectedRoots = [\n ...(typeof protectedRoots === \"string\"\n ? [protectedRoots]\n : (protectedRoots ?? [])),\n await abortable(() => canonicalConfigPath(process.cwd()), signal),\n ];\n const readGit = (args: readonly string[]) =>\n abortable(\n () =>\n gitOutput(\n repository,\n args,\n signal,\n { LC_ALL: \"C\" },\n undefined,\n \"utf8\",\n gitProtectedRoots,\n environment,\n ),\n signal,\n );\n let remoteNames: string;\n try {\n remoteNames = await readGit([\"remote\"]);\n } catch (error) {\n signal?.throwIfAborted();\n // A local source directory need not be a Git checkout.\n if (\n error instanceof Error &&\n \"code\" in error &&\n error.code === 128 &&\n \"stderr\" in error &&\n typeof error.stderr === \"string\" &&\n (error.stderr.trimEnd() ===\n \"fatal: not a git repository (or any of the parent directories): .git\" ||\n /^fatal: not a git repository \\(or any parent up to mount point [^\\r\\n]+\\)\\r?\\nStopping at filesystem boundary \\(GIT_DISCOVERY_ACROSS_FILESYSTEM not set\\)\\.$/u.test(\n error.stderr.trimEnd(),\n ))\n )\n return;\n throw error;\n }\n const remotes: string[] = [];\n for (const name of remoteNames.split(/\\r?\\n/u).filter(Boolean)) {\n const urls = await readGit([\"remote\", \"get-url\", \"--all\", \"--\", name]);\n remotes.push(...urls.split(/\\r?\\n/u));\n }\n const identity = (value: string, platform: Provider) =>\n remoteRepository(value, platform, provider === \"inspector\");\n const githubRepositories = new Set(\n sources.flatMap((source) => {\n if (source.platform !== \"github\") return [];\n const key = identity(source.url, \"github\")?.key;\n return key === undefined ? [] : [key];\n }),\n );\n for (const source of sources) {\n const githubKey = identity(source.url, \"github\")?.key;\n const sourceProvider =\n source.platform === \"github\" ||\n (githubKey !== undefined && githubRepositories.has(githubKey))\n ? \"github\"\n : provider;\n const targets = remotes.flatMap(\n (remote) => identity(remote, sourceProvider) ?? [],\n );\n if (!targets.length) continue;\n const target = identity(source.url, sourceProvider);\n if (\n !target ||\n !targets.some(\n ({ key, account, homeRelative }) =>\n key === target.key &&\n (homeRelative === undefined ||\n target.homeRelative === undefined ||\n homeRelative === target.homeRelative) &&\n ((homeRelative === false && target.homeRelative === false) ||\n account === undefined ||\n target.account === undefined ||\n account === target.account),\n )\n )\n throw new CodexSecurityError(\n `Imported repository ${JSON.stringify(source.url)} does not match a configured remote of ${repository}. Select the matching local repository.`,\n );\n }\n}\n\nasync function localContext(\n selectedRepository: string,\n dependencies: LocalExternalImportDependencies,\n mode: \"import\" | \"read\" = \"import\",\n) {\n dependencies.signal?.throwIfAborted();\n const selected = dependencies.environment ?? process.env;\n const environment = workbenchEnvironment(selected);\n forwardExternalImportSetting(selected, environment);\n requireExternalImports(environment);\n const path = expandHome(selectedRepository, environment);\n const repository =\n mode === \"read\"\n ? await abortable(() => canonicalConfigPath(path), dependencies.signal)\n : await normalizeRepository(path, dependencies.signal);\n const protectedRoot = [\n ...new Set([\n repository,\n ...(await abortable(\n () => localGitProtectionRoots(path, environment, dependencies.signal),\n dependencies.signal,\n )),\n ...(await abortable(\n () =>\n localGitProtectionRoots(\n process.cwd(),\n environment,\n dependencies.signal,\n ),\n dependencies.signal,\n )),\n ]),\n ];\n requireOutputOutsideRepositories(\n protectedRoot,\n await abortable(\n () => canonicalizeModelSafePath(environment.CODEX_SECURITY_STATE_DIR),\n dependencies.signal,\n ),\n \"runtime\",\n );\n return {\n repository,\n options: {\n pluginRoot: await abortable(\n () => bundledPluginRoot(),\n dependencies.signal,\n ),\n environment,\n protectedRoot,\n signal: dependencies.signal,\n failureMessage: \"Could not access imported local findings\",\n },\n };\n}\n\n/** Prepare scanner evidence without writing state or performing a security assessment. */\nexport async function prepareNormalizedLocalImport(\n input: ExternalFindings,\n options: NormalizedLocalImportOptions,\n dependencies: LocalExternalImportDependencies = {},\n): Promise<PreparedLocalExternalImport> {\n dependencies.signal?.throwIfAborted();\n requireExternalImports(dependencies.environment);\n return prepareLocalImport(\n input,\n snapshotImportOptions(options),\n dependencies,\n );\n}\n\n/** @internal Prepare evidence using settings captured by either local import entrypoint. */\nexport async function prepareLocalImport(\n input: ExternalFindings,\n options: NormalizedLocalImportOptions,\n dependencies: LocalExternalImportDependencies,\n): Promise<PreparedLocalExternalImport> {\n requireIdentity(options.sourceKey, \"Source key\");\n const current = structuredClone(input);\n validateExternalReport(current.report);\n let dependabotSource: string | undefined;\n const identities = new Set<string>();\n for (const finding of current.findings) {\n requireIdentity(finding.source_finding_id, \"Source finding id\");\n if (identities.has(finding.source_finding_id))\n throw new CodexSecurityError(\n `Duplicate source finding id ${JSON.stringify(finding.source_finding_id)}.`,\n );\n identities.add(finding.source_finding_id);\n if (!isRecord(finding.evidence))\n throw new CodexSecurityError(\"Imported evidence must be an object.\");\n if (options.provider !== \"github\") continue;\n const native = dependabotRepository(finding);\n if (!native) continue;\n const claimed = finding.evidence.details?.repository?.url;\n if (\n claimed &&\n cloudRepositoryUrlKey(claimed) !== cloudRepositoryUrlKey(native)\n )\n throw new CodexSecurityError(\n \"The normalized repository does not match the original Dependabot alert.\",\n );\n if (dependabotSource && dependabotSource !== native)\n throw new CodexSecurityError(\n \"Select Dependabot alerts from only one GitHub host and repository.\",\n );\n dependabotSource = native;\n }\n const { repository, options: workbenchOptions } = await localContext(\n options.repository,\n dependencies,\n );\n const sources = new Map<string, ExternalSourceRepository>();\n for (const finding of current.findings) {\n const url = finding.evidence.details?.repository?.url;\n if (url) sources.set(url, { url });\n }\n const inspector = inspectorReportRepository(\n options.provider,\n current.findings,\n \"local\",\n options.inspectorProjectMap,\n );\n if (inspector) {\n const platform = inspector.platform ?? options.provider;\n const native = remoteRepository(inspector.url, platform, true);\n for (const url of sources.keys()) {\n if (!native || remoteRepository(url, platform, true)?.key !== native.key)\n throw new CodexSecurityError(\n `Imported repository ${JSON.stringify(url)} does not match the retained Inspector repository ${JSON.stringify(inspector.url)}.`,\n );\n }\n }\n for (const source of [\n ...(inspector ? [inspector] : []),\n ...(dependencies.sourceRepositories ?? []),\n ]) {\n // A reader's platform must not loosen an operator-supplied Inspector map.\n if (sources.get(source.url)?.platform !== \"github\")\n sources.set(\n source.url,\n options.inspectorProjectMap ? { url: source.url } : source,\n );\n }\n if (dependabotSource)\n sources.set(dependabotSource, {\n url: dependabotSource,\n platform: \"github\",\n });\n await requireMatchingRepository(\n repository,\n options.provider,\n [...sources.values()],\n workbenchOptions.protectedRoot,\n workbenchOptions.environment,\n dependencies.signal,\n );\n dependencies.signal?.throwIfAborted();\n const preview = {\n ...structuredClone(current),\n repository,\n source: { provider: options.provider, source_key: options.sourceKey },\n };\n const payload = JSON.stringify(\n {\n repository,\n provider: options.provider,\n sourceKey: options.sourceKey,\n findings: current.findings,\n },\n (_key, value: unknown) => {\n if (isNumberObject(value)) value = +value;\n if (typeof value === \"number\" && !Number.isFinite(value))\n throw new TypeError(\n \"Stored finding JSON cannot contain non-finite numbers.\",\n );\n return value;\n },\n );\n return {\n preview,\n async import() {\n dependencies.signal?.throwIfAborted();\n const protectedRoot = [\n ...new Set([\n ...workbenchOptions.protectedRoot,\n ...(await abortable(\n () =>\n localGitProtectionRoots(\n process.cwd(),\n workbenchOptions.environment,\n dependencies.signal,\n ),\n dependencies.signal,\n )),\n ]),\n ];\n requireOutputOutsideRepositories(\n protectedRoot,\n await abortable(\n () =>\n canonicalizeModelSafePath(\n workbenchOptions.environment.CODEX_SECURITY_STATE_DIR,\n ),\n dependencies.signal,\n ),\n \"runtime\",\n );\n const result = await abortable(() => {\n dependencies.signal?.throwIfAborted();\n return (dependencies.runWorkbench ?? runWorkbench)(\n { ...workbenchOptions, protectedRoot },\n [\"store-external-findings\"],\n payload,\n );\n }, dependencies.signal);\n return {\n repository,\n read: current.read,\n ...(current.report === undefined\n ? {}\n : { report: structuredClone(current.report) }),\n ready: current.findings.length,\n excluded: structuredClone(current.excluded),\n findings: result[\"findings\"] as unknown as StoredExternalFinding[],\n counts: result[\"counts\"] as LocalExternalImportResult[\"counts\"],\n };\n },\n };\n}\n\n/** Read imported source records, including evidence that has not been assessed by Codex. */\nexport async function listLocalExternalFindings(\n selection: { repository: string; id?: string },\n dependencies: LocalExternalImportDependencies = {},\n): Promise<StoredExternalFinding[]> {\n dependencies.signal?.throwIfAborted();\n requireExternalImports(dependencies.environment);\n if (selection.id !== undefined) requireIdentity(selection.id, \"Finding id\");\n const { repository, options } = await localContext(\n selection.repository,\n dependencies,\n \"read\",\n );\n const result = await abortable(() => {\n dependencies.signal?.throwIfAborted();\n return (dependencies.runWorkbench ?? runWorkbench)(\n options,\n [\"list-external-findings\"],\n JSON.stringify({ repository, id: selection.id }),\n );\n }, dependencies.signal);\n return result[\"findings\"] as unknown as StoredExternalFinding[];\n}\n"]}
1
+ {"version":3,"file":"external-findings-local.js","sourceRoot":"","sources":["../src/external-findings-local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAA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,MAAM,CAAC,QAAQ,CAAwC;aAChE,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,SAA8C,EAC9C,YAAY,GAAoC,EAAE;IAElD,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACtC,sBAAsB,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,SAAS,CAAC,EAAE,KAAK,SAAS;QAAE,eAAe,CAAC,SAAS,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAC5E,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAChD,SAAS,CAAC,UAAU,EACpB,YAAY,EACZ,MAAM,CACP,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE;QAClC,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;QACtC,OAAO,CAAC,YAAY,CAAC,YAAY,IAAI,YAAY,CAAC,CAChD,OAAO,EACP,CAAC,wBAAwB,CAAC,EAC1B,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CACjD,CAAC;IACJ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,UAAU,CAAuC,CAAC;AAClE,CAAC","sourcesContent":["import { CodexSecurityError } from \"./errors.js\";\nimport {\n forwardExternalImportSetting,\n requireExternalImports,\n} from \"./external-imports-feature.js\";\nimport {\n cloneImportPreview,\n snapshotImportOptions,\n snapshotNormalizedFindings,\n snapshotSourceRepositories,\n type ExternalFindings,\n type ExternalSourceRepository,\n} from \"./external-findings.js\";\nimport {\n cloudRepositoryUrlKey,\n requireSafeJsonInteger,\n repositoryUrlKey,\n} from \"./external-import-contract.js\";\nimport type {\n ExternalFindingEvidence,\n Provider,\n} from \"./external-import-models.js\";\nimport { localFindingRepositories } from \"./external-findings-read.js\";\nimport {\n hasGitMetadata,\n localGitProtectionRoots,\n importGitProtectionRoots,\n} from \"./local-git-metadata.js\";\nimport {\n blackDuckReportRepositories,\n projectedBlackDuckRepositoryUrl,\n} from \"./blackduck-findings.js\";\nimport {\n azureReposHttpsUrl,\n isGitHubCloudHost,\n isGitHubSshOverHttps,\n isGitSsh,\n parseGitRemote,\n} from \"./git-remote.js\";\nimport { continuumReportRepositories } from \"./continuum-findings.js\";\nimport { veracodeReportRepositories } from \"./veracode-findings.js\";\nimport { inspectorReportRepository } from \"./inspector-findings.js\";\nimport { declaredScannerRepositoryUrl } from \"./scanner-repository-url.js\";\nimport { sonarRepositoryUrls } from \"./sonar-findings.js\";\nimport { isRecord } from \"./record.js\";\nimport { dependabotRepository } from \"./github-dependabot-findings.js\";\nimport {\n bundledPluginRoot,\n canonicalConfigPath,\n canonicalizeModelSafePath,\n expandHome,\n requireOutputOutsideRepositories,\n runWorkbench,\n workbenchEnvironment,\n type WorkbenchCommandOptions,\n} from \"./runtime.js\";\nimport {\n abortable,\n enclosingGitWorktreeRoot,\n gitOutput,\n normalizeRepository,\n} from \"./targets.js\";\n\n/** A scanner source record, independent of a Codex assessment or completed scan. */\nexport interface StoredExternalFinding {\n id: string;\n repository: string;\n provider: Provider;\n sourceKey: string;\n sourceFindingId: string;\n evidence: ExternalFindingEvidence;\n assessment: { state: \"not_assessed\" };\n version: number;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface NormalizedLocalImportOptions {\n /** Local checkout or source directory to associate with these records. */\n repository: string;\n provider: Provider;\n /** Stable scanner organization/project/branch namespace across imports. */\n sourceKey: string;\n /** Explicitly verified Sonar repository when a checkout uses an SSH host alias. */\n sourceRepositoryUrl?: string;\n /** Full Inspector project ARNs mapped to independently verified repository URLs. */\n inspectorProjectMap?: ReadonlyMap<string, string>;\n}\n\nexport interface LocalExternalImportDependencies {\n environment?: NodeJS.ProcessEnv;\n signal?: AbortSignal;\n runWorkbench?: typeof runWorkbench;\n /** Repository references supplied by a reader outside its projected evidence. */\n sourceRepositories?: readonly ExternalSourceRepository[];\n}\n\nexport interface LocalExternalImportPreview extends ExternalFindings {\n repository: string;\n source: { provider: Provider; source_key: string };\n}\n\nexport interface LocalExternalImportResult {\n repository: string;\n read: number;\n report?: ExternalFindings[\"report\"];\n ready: number;\n excluded: ExternalFindings[\"excluded\"];\n findings: StoredExternalFinding[];\n counts: { created: number; updated: number; unchanged: number };\n}\n\nexport interface PreparedLocalExternalImport {\n /** Every declared source matched a configured Git remote of the checkout. */\n matchesRepositoryRemote: boolean;\n preview: LocalExternalImportPreview;\n import(): Promise<LocalExternalImportResult>;\n}\n\nfunction requireIdentity(\n value: unknown,\n field: string,\n): asserts value is string {\n if (typeof value !== \"string\" || !value.trim() || value.includes(\"\\0\"))\n throw new CodexSecurityError(\n `${field} must be nonempty and contain no NUL characters.`,\n );\n}\n\nfunction checkStoredNumber(value: number): void {\n if (!Number.isFinite(value))\n throw new TypeError(\n \"Stored finding JSON cannot contain non-finite numbers.\",\n );\n requireSafeJsonInteger(value, \"Stored finding JSON\");\n}\n\nconst gitTransportPorts: Readonly<Record<string, string>> = {\n \"http:\": \"80\",\n \"https:\": \"443\",\n \"ssh:\": \"22\",\n \"git+ssh:\": \"22\",\n \"ssh+git:\": \"22\",\n \"git:\": \"9418\",\n \"ftp:\": \"21\",\n \"ftps:\": \"990\",\n};\n\n/** Compare transport forms without changing retained scanner evidence. */\ninterface RemoteRepositoryIdentity {\n key: string;\n account?: string;\n homeRelative?: boolean;\n}\n\nfunction sonarHostedGit(hostname: string) {\n return (\n isGitHubCloudHost(hostname) ||\n hostname === \"gitlab.com\" ||\n hostname === \"bitbucket.org\"\n );\n}\n\nfunction sonarHostedHostname(hostname: string) {\n const name = hostname.toLowerCase().replace(/\\.$/u, \"\");\n return sonarHostedGit(name) ||\n [\"ssh.github.com\", \"ssh.dev.azure.com\", \"dev.azure.com\"].includes(name)\n ? name\n : undefined;\n}\n\nfunction remoteRepository(\n value: string,\n provider: Provider,\n bound: boolean,\n platform: Provider = provider,\n possibleSshHost?: string,\n): RemoteRepositoryIdentity | undefined {\n if (/^[A-Za-z]:[\\\\/]/u.test(value)) return undefined;\n const transport = bound\n ? /^(?:ssh|git\\+ssh|ssh\\+git|git):\\/\\/([^/]*)(.*)$/isu.exec(value)\n : null;\n const authority = transport?.[1];\n const http = bound && /^https?:\\/\\//iu.test(value.trimStart());\n // Git decodes the authority before locating its path. An encoded delimiter\n // cannot prove a match to another spelling through WHATWG URL's hostname.\n if (\n authority &&\n (/%2f|[?#]/iu.test(authority) ||\n authority.slice(authority.lastIndexOf(\"@\") + 1).includes(\"%\"))\n )\n return { key: value };\n let remote;\n try {\n remote = parseGitRemote(value);\n } catch {\n return transport || http ? { key: \"\\0\" + value } : undefined;\n }\n if (!remote || !Object.hasOwn(gitTransportPorts, remote.url.protocol))\n return undefined;\n const { url, path, scpStyle } = remote;\n const ssh = isGitSsh(url.protocol);\n const protocol = url.protocol === \"http:\" ? \"http:\" : \"https:\";\n const hosted = sonarHostedHostname(url.hostname);\n if (provider === \"sonar\" && hosted) url.hostname = hosted;\n const githubSshOverHttps = isGitHubSshOverHttps(url);\n let hostname = githubSshOverHttps ? \"github.com\" : url.hostname;\n // An unresolved SSH name can be a local Host alias. Only substitute the\n // supplied hostname when checking the path of an unverified manual mapping.\n if (possibleSshHost && ssh && (!hosted || hosted === \"dev.azure.com\"))\n hostname = sonarHostedHostname(possibleSshHost) ?? possibleSshHost;\n const port =\n githubSshOverHttps || url.port === gitTransportPorts[url.protocol]\n ? \"\"\n : url.port;\n // A GitHub source identifies a case-insensitive repository on custom Enterprise\n // hosts too; other providers can refer to VCS hosts with case-sensitive paths.\n const key = platform === \"github\" ? cloudRepositoryUrlKey : repositoryUrlKey;\n const origin = `${protocol}//${hostname}${port ? `:${port}` : \"\"}/`;\n if (!bound) return { key: key(origin + path) };\n\n if (!ssh && url.protocol !== \"git:\") {\n if (url.protocol === \"http:\" || url.protocol === \"https:\") {\n // libcurl and WHATWG differ on backslashes and encoded dot segments.\n const raw = /^https?:\\/\\/[^/\\\\?#\\s]+(\\/[^\\\\?#]*)?(?:[?#].*)?$/iu.exec(\n value,\n );\n if (!raw || /\\/(?:%2e|\\.%2e|%2e\\.|%2e%2e)(?:\\/|$)/iu.test(raw[1] ?? \"\"))\n return { key: \"\\0\" + value };\n }\n const suffix = /[?#].*$/su.exec(value)?.[0] ?? \"\";\n // HTTP sends the query and omits fragment text from repository requests.\n if (suffix && ![\"http:\", \"https:\"].includes(url.protocol))\n return { key: key(origin + path) + \"\\0\" };\n return {\n key:\n key(origin + path) + suffix.replace(/#.*$/su, \"#\").replace(/\\/$/u, \"\"),\n };\n }\n\n // Git passes the original path (including dot segments, '?' and '#') to upload-pack.\n const literal = (raw: string) => {\n const bytes = Buffer.from(raw).toString(\"latin1\");\n return scpStyle\n ? bytes\n : bytes.replace(/%(?!00)([\\da-f]{2})/giu, (_, hex: string) =>\n String.fromCharCode(parseInt(hex, 16)),\n );\n };\n if (!scpStyle && !transport) return { key: value };\n const gitPath = literal(transport?.[2] ?? path);\n const login = scpStyle\n ? /^([^@/:\\s?#]+)@/u.exec(value)?.[1]\n : /^(.*)@/u.exec(authority ?? \"\")?.[1];\n const homeRelative =\n /^\\/?~(?:\\/|$)/u.test(gitPath) || (scpStyle && !/^[~/]/u.test(gitPath));\n const suffix = /[?#].*$/su.exec(gitPath);\n // Express upload-pack bytes as a URL path for comparison with the HTTP source.\n const name = gitPath\n .slice(0, suffix?.index)\n .replace(/^\\//u, \"\")\n .replace(\n /[%\\x00-\\x20\\x7f-\\xff]/gu,\n (byte) =>\n \"%\" + byte.charCodeAt(0).toString(16).toUpperCase().padStart(2, \"0\"),\n );\n // Azure's generated SCP clone URL spells spaces as %20, even though Git sends SCP paths literally.\n const azure =\n provider === \"sonar\" && !(scpStyle && path.startsWith(\"/\"))\n ? azureReposHttpsUrl(\n url,\n scpStyle ? name.replace(/%2520/gu, \"%20\") : name,\n )\n : undefined;\n const repository = suffix\n ? key(origin + name + \"?\") +\n \"\\0\" +\n suffix[0].replace(/\\/$/u, \"\").replace(/\\.git$/u, \"\")\n : key(azure ?? origin + name);\n return {\n key: repository,\n account: ssh && login ? literal(login) : undefined,\n // GitHub serves the same repository path through its SCP and SSH URLs.\n homeRelative:\n ssh && platform !== \"github\" && !isGitHubCloudHost(hostname.toLowerCase())\n ? homeRelative\n : undefined,\n };\n}\n\nfunction matchingRemote(\n left: RemoteRepositoryIdentity,\n right: RemoteRepositoryIdentity,\n) {\n return (\n left.key === right.key &&\n (left.homeRelative === undefined ||\n right.homeRelative === undefined ||\n left.homeRelative === right.homeRelative) &&\n ((left.homeRelative === false && right.homeRelative === false) ||\n left.account === undefined ||\n right.account === undefined ||\n left.account === right.account)\n );\n}\n\n/** A credential-free Sonar repository binding from a supported Git fetch transport. */\nexport function sonarRepositoryForRemote(origin: string): string | undefined {\n try {\n if (/[\\s\\\\\\p{Cc}?#]/u.test(origin)) return;\n const remote = parseGitRemote(origin);\n if (!remote) return;\n const { url } = remote;\n // Git dispatches remote helpers by the literal scheme, while URL lowercases it.\n if (!remote.scpStyle && !origin.startsWith(url.protocol + \"//\")) return;\n // Git passes literal SSH paths to upload-pack. URL.pathname collapses dot segments.\n const path = remote.scpStyle\n ? remote.path\n : /^[^:/]+:\\/\\/[^/]+\\/(.+)$/u.exec(origin)?.[1];\n if (!path) return;\n const hostname = url.hostname.toLowerCase();\n let candidate: string | undefined;\n if (url.protocol === \"http:\" || url.protocol === \"https:\") {\n candidate = `${url.origin}/${path}`;\n } else if (url.username === \"git\" && isGitHubSshOverHttps(url)) {\n candidate = `https://github.com/${path}`;\n } else if (\n isGitSsh(url.protocol) &&\n url.username === \"git\" &&\n (!url.port || url.port === \"22\") &&\n sonarHostedGit(hostname)\n ) {\n candidate = `https://${hostname}/${path}`;\n } else {\n candidate = azureReposHttpsUrl(url, path);\n }\n if (!candidate) return;\n const source = declaredScannerRepositoryUrl(\n candidate.replace(/\\.git$/iu, \"\"),\n \"Sonar\",\n \"local\",\n );\n const candidateRemote = remoteRepository(origin, \"sonar\", true);\n const target = remoteRepository(source, \"sonar\", true);\n if (isGitSsh(url.protocol) && candidateRemote?.account !== \"git\") return;\n return candidateRemote && target && matchingRemote(candidateRemote, target)\n ? source\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Use the same executable and configuration boundaries for every Git query proving a binding. */\nexport function boundSonarWorktree(\n repository: string,\n protectedRoots: string | readonly string[],\n environment: NodeJS.ProcessEnv | undefined,\n signal?: AbortSignal,\n) {\n return enclosingGitWorktreeRoot(repository, signal, {\n requireIfPresent: true,\n readGit: (directory, args) =>\n gitOutput(\n directory,\n args,\n signal,\n undefined,\n undefined,\n \"utf8\",\n protectedRoots,\n environment,\n ),\n });\n}\n\nfunction localRepositoryPlatform(\n provider: Provider,\n sources: readonly ExternalSourceRepository[],\n bound: boolean,\n) {\n const githubKey = (url: string) =>\n remoteRepository(url, provider, bound, \"github\")?.key;\n const githubRepositories = new Set(\n sources.flatMap((source) => {\n if (source.platform !== \"github\") return [];\n const key = githubKey(source.url);\n return key === undefined ? [] : [key];\n }),\n );\n return (source: ExternalSourceRepository): Provider => {\n if (source.platform === \"github\") return \"github\";\n if (githubRepositories.size === 0) return provider;\n const key = githubKey(source.url);\n return key !== undefined && githubRepositories.has(key)\n ? \"github\"\n : provider;\n };\n}\n\nfunction sameScannerRepositories(\n remotes: Iterable<RemoteRepositoryIdentity>,\n): boolean {\n let known: RemoteRepositoryIdentity | undefined;\n for (const remote of remotes) {\n if (known && !matchingRemote(known, remote)) return false;\n // HTTPS does not specify the login or path interpretation carried by SSH.\n known = {\n key: remote.key,\n account: remote.account ?? known?.account,\n homeRelative: remote.homeRelative ?? known?.homeRelative,\n };\n }\n return true;\n}\n\n/** @internal */\nexport interface ConfiguredFetchRemote {\n name: string;\n url: string;\n}\n\n/** @internal Effective fetch URLs from the selected, protected checkout. */\nexport async function configuredFetchRemotes(\n repository: string,\n provider: Provider,\n protectedRoots: WorkbenchCommandOptions[\"protectedRoot\"],\n environment: WorkbenchCommandOptions[\"environment\"],\n signal?: AbortSignal,\n): Promise<ConfiguredFetchRemote[]> {\n if (!(await hasGitMetadata(repository, signal))) return [];\n const gitProtectedRoots = [\n ...(typeof protectedRoots === \"string\"\n ? [protectedRoots]\n : (protectedRoots ?? [])),\n ];\n // The Sonar caller includes the discovered Git roots for both checkouts.\n if (provider !== \"sonar\")\n gitProtectedRoots.push(\n await abortable(() => canonicalConfigPath(process.cwd()), signal),\n );\n if (\n provider === \"sonar\" &&\n !(await boundSonarWorktree(\n repository,\n gitProtectedRoots,\n environment,\n signal,\n ))\n )\n return [];\n const readGit = (args: readonly string[]) =>\n abortable(\n () =>\n gitOutput(\n repository,\n args,\n signal,\n { LC_ALL: \"C\" },\n undefined,\n \"utf8\",\n gitProtectedRoots,\n environment,\n ),\n signal,\n );\n let remoteNames: string;\n try {\n remoteNames = await readGit([\"remote\"]);\n } catch (error) {\n signal?.throwIfAborted();\n // A local source directory need not be a Git checkout.\n if (\n error instanceof Error &&\n \"code\" in error &&\n error.code === 128 &&\n \"stderr\" in error &&\n typeof error.stderr === \"string\" &&\n (error.stderr.trimEnd() ===\n \"fatal: not a git repository (or any of the parent directories): .git\" ||\n /^fatal: not a git repository \\(or any parent up to mount point [^\\r\\n]+\\)\\r?\\nStopping at filesystem boundary \\(GIT_DISCOVERY_ACROSS_FILESYSTEM not set\\)\\.$/u.test(\n error.stderr.trimEnd(),\n ))\n )\n return [];\n throw error;\n }\n const remotes: ConfiguredFetchRemote[] = [];\n for (const name of remoteNames.split(/\\r?\\n/u).filter(Boolean)) {\n if (provider === \"sonar\") {\n // Git fetches from only the first URL, after insteadOf rewrites.\n const url = await readGit([\"remote\", \"get-url\", \"--\", name]);\n if (/[\\r\\n]/u.test(url))\n throw new CodexSecurityError(\n \"A configured Git remote URL contains a line break. Configure each fetch URL as a separate Git value.\",\n );\n remotes.push({ name, url });\n } else {\n const urls = await readGit([\"remote\", \"get-url\", \"--all\", \"--\", name]);\n for (const url of urls.split(/\\r?\\n/u)) remotes.push({ name, url });\n }\n }\n return remotes;\n}\n\nasync function requireMatchingRepository(\n repository: string,\n provider: Provider,\n sources: readonly ExternalSourceRepository[],\n strictSources: ReadonlyMap<string, Provider>,\n strictPlatformFor: (source: ExternalSourceRepository) => Provider,\n protectedRoots: WorkbenchCommandOptions[\"protectedRoot\"],\n environment: WorkbenchCommandOptions[\"environment\"],\n signal?: AbortSignal,\n possibleSshHost?: string,\n fetchRemotes?: readonly ConfiguredFetchRemote[],\n): Promise<boolean> {\n if (sources.length === 0) return false;\n const remotes =\n fetchRemotes ??\n (await configuredFetchRemotes(\n repository,\n provider,\n protectedRoots,\n environment,\n signal,\n ));\n const boundProvider =\n provider === \"sonar\" ||\n provider === \"continuum\" ||\n provider === \"inspector\" ||\n provider === \"blackduck\" ||\n provider === \"veracode\";\n const loosePlatformFor = localRepositoryPlatform(provider, sources, false);\n const comparable: string[] = [];\n const unverified: string[] = [];\n for (const { url: remote } of remotes) {\n const verified =\n provider === \"sonar\" ? sonarRepositoryForRemote(remote) : remote;\n if (verified) comparable.push(verified);\n else if (!/[\\s\\\\\\p{Cc}?#]/u.test(remote)) unverified.push(remote);\n }\n let allSourcesMatched = true;\n for (const source of sources) {\n const bound = boundProvider || strictSources.has(source.url);\n const platform = bound\n ? (strictSources.get(source.url) ?? strictPlatformFor(source))\n : loosePlatformFor(source);\n const identity = (url: string) =>\n remoteRepository(url, provider, bound, platform);\n const targets = comparable.flatMap((remote) => identity(remote) ?? []);\n const target = identity(source.url);\n if (target && targets.some((remote) => matchingRemote(remote, target)))\n continue;\n allSourcesMatched = false;\n // A custom SSH upstream can agree with a manual mapping even when a\n // recognized HTTPS remote points at a fork. It cannot prove a Cloud binding.\n const configured = unverified.flatMap(\n (remote) =>\n remoteRepository(remote, provider, bound, platform, possibleSshHost) ??\n [],\n );\n if (target && configured.some((remote) => matchingRemote(remote, target)))\n continue;\n if (targets.length || configured.length)\n throw new CodexSecurityError(\n `Imported repository ${JSON.stringify(source.url)} does not match a configured remote of ${repository}. Select the matching local repository.`,\n );\n }\n return allSourcesMatched;\n}\n\nexport function sonarCheckoutMatchesSource(\n repository: string,\n url: string,\n protectedRoots: readonly string[],\n environment: NodeJS.ProcessEnv,\n signal?: AbortSignal,\n) {\n return requireMatchingRepository(\n repository,\n \"sonar\",\n [{ url }],\n new Map(),\n () => \"sonar\",\n [...protectedRoots],\n environment,\n signal,\n );\n}\n\nasync function localContext(\n selectedRepository: string,\n dependencies: LocalExternalImportDependencies,\n mode: \"import\" | \"read\" = \"import\",\n) {\n dependencies.signal?.throwIfAborted();\n const selected = dependencies.environment ?? process.env;\n const environment = workbenchEnvironment(selected);\n forwardExternalImportSetting(selected, environment);\n requireExternalImports(environment);\n const path = expandHome(selectedRepository, environment);\n const repository =\n mode === \"read\"\n ? await abortable(() => canonicalConfigPath(path), dependencies.signal)\n : await normalizeRepository(path, dependencies.signal);\n const protectedRoot = [\n ...new Set([\n repository,\n ...(await abortable(\n () => importGitProtectionRoots(path, environment, dependencies.signal),\n dependencies.signal,\n )),\n ]),\n ];\n requireOutputOutsideRepositories(\n protectedRoot,\n await abortable(\n () => canonicalizeModelSafePath(environment.CODEX_SECURITY_STATE_DIR),\n dependencies.signal,\n ),\n \"runtime\",\n );\n return {\n repository,\n options: {\n pluginRoot: await abortable(\n () => bundledPluginRoot(),\n dependencies.signal,\n ),\n environment,\n protectedRoot,\n signal: dependencies.signal,\n failureMessage: \"Could not access imported local findings\",\n },\n };\n}\n\n/** Prepare scanner evidence without writing state or performing a security assessment. */\nexport async function prepareNormalizedLocalImport(\n input: ExternalFindings,\n options: NormalizedLocalImportOptions,\n dependencies: LocalExternalImportDependencies = {},\n): Promise<PreparedLocalExternalImport> {\n dependencies.signal?.throwIfAborted();\n requireExternalImports(dependencies.environment);\n return prepareLocalImport(\n input,\n snapshotImportOptions(options),\n dependencies,\n );\n}\n\n/** @internal Prepare evidence using settings captured by either local import entrypoint. */\nexport async function prepareLocalImport(\n input: ExternalFindings,\n options: NormalizedLocalImportOptions,\n dependencies: LocalExternalImportDependencies,\n readerSources = snapshotSourceRepositories(dependencies.sourceRepositories),\n parsedSources: readonly ExternalSourceRepository[] = [],\n fetchRemotes?: readonly ConfiguredFetchRemote[],\n): Promise<PreparedLocalExternalImport> {\n requireIdentity(options.sourceKey, \"Source key\");\n const current = snapshotNormalizedFindings(input, checkStoredNumber);\n let dependabotSource: string | undefined;\n const identities = new Set<string>();\n for (const finding of current.findings) {\n requireIdentity(finding.source_finding_id, \"Source finding id\");\n if (identities.has(finding.source_finding_id))\n throw new CodexSecurityError(\n `Duplicate source finding id ${JSON.stringify(finding.source_finding_id)}.`,\n );\n identities.add(finding.source_finding_id);\n if (!isRecord(finding.evidence))\n throw new CodexSecurityError(\"Imported evidence must be an object.\");\n if (options.provider !== \"github\") continue;\n const native = dependabotRepository(finding);\n if (!native) continue;\n const claimed = finding.evidence.details?.repository?.url;\n if (\n claimed &&\n cloudRepositoryUrlKey(claimed) !== cloudRepositoryUrlKey(native)\n )\n throw new CodexSecurityError(\n \"The normalized repository does not match the original Dependabot alert.\",\n );\n if (dependabotSource && dependabotSource !== native)\n throw new CodexSecurityError(\n \"Select Dependabot alerts from only one GitHub host and repository.\",\n );\n dependabotSource = native;\n }\n const { repository, options: workbenchOptions } = await localContext(\n options.repository,\n dependencies,\n );\n const sources = new Map<string, ExternalSourceRepository>();\n const references = [...readerSources, ...parsedSources];\n const inspector = inspectorReportRepository(\n options.provider,\n current.findings,\n \"local\",\n options.inspectorProjectMap,\n );\n const projected =\n options.provider === \"blackduck\"\n ? []\n : current.findings.filter((finding) =>\n projectedBlackDuckRepositoryUrl(finding, \"local\"),\n );\n const mixed = projected.length > 0 && readerSources.length > 0;\n const nativeSources = new Map(\n (mixed ? current.findings : projected)\n .filter(\n ({ evidence }) =>\n options.provider !== \"endor\" ||\n isRecord(evidence.source_data?.[\"runContext\"]),\n )\n .map(\n (finding) =>\n [\n finding,\n localFindingRepositories(options.provider, finding),\n ] as const,\n ),\n );\n const platformFor = localRepositoryPlatform(\n options.provider,\n options.inspectorProjectMap\n ? []\n : [\n ...references,\n ...Array.from(nativeSources.values()).flat(),\n ...(inspector ? [inspector] : []),\n ],\n true,\n );\n const identify = (url: string) =>\n remoteRepository(url, options.provider, true, platformFor({ url })) ?? {\n key: url,\n };\n // A hint from an independent reader applies across projected rows. A native\n // GitHub asset in one row only identifies the platform of that row's claims.\n const operatorPlatform = localRepositoryPlatform(\n options.provider,\n readerSources,\n true,\n );\n const sameRepositories = (urls: Iterable<string>) =>\n sameScannerRepositories(Array.from(urls, identify));\n const bound = blackDuckReportRepositories(\n options.provider,\n current.findings,\n \"local\",\n sameRepositories,\n );\n for (const repositories of [\n veracodeReportRepositories,\n continuumReportRepositories,\n ]) {\n for (const source of repositories(\n options.provider,\n current.findings,\n \"local\",\n sameRepositories,\n ).values()) {\n sources.set(source.url, source);\n }\n }\n const strictSources = new Map<string, Provider>();\n const known = new Set<string>(parsedSources.map(({ url }) => url));\n for (const finding of current.findings) {\n const { evidence, source_finding_id: id } = finding;\n const url = evidence.details?.repository?.url;\n if (url) sources.set(url, { url });\n const retained = bound.get(id);\n const native = nativeSources.get(finding) ?? [];\n if (retained) {\n const claims = [\n retained.url,\n ...(url ? [url] : []),\n ...native.map((ref) => ref.url),\n ];\n const rowPlatform = (claim: string) =>\n options.provider !== \"wiz\"\n ? platformFor({ url: claim })\n : native.some((source) => source.platform === \"github\")\n ? \"github\"\n : operatorPlatform({ url: claim });\n if (\n !sameScannerRepositories(\n claims.map(\n (claim) =>\n remoteRepository(\n claim,\n options.provider,\n true,\n rowPlatform(claim),\n ) ?? {\n key: claim,\n },\n ),\n )\n )\n throw new CodexSecurityError(\n \"The retained scanner repository does not match the original provider finding.\",\n );\n for (const source of [retained, ...native])\n sources.set(source.url, source);\n for (const claim of claims) {\n const platform = rowPlatform(claim);\n if (!strictSources.has(claim) || platform !== \"github\")\n strictSources.set(claim, platform);\n }\n }\n for (const source of native) known.add(source.url);\n }\n if (mixed) {\n // A caller reference with no matching row spelling can still be a Git alias.\n const rows = [...sources.keys(), ...known].map(identify);\n const byKey = Map.groupBy(rows, (remote) => remote.key);\n const represented = new Set(rows.map((remote) => JSON.stringify(remote)));\n const aliases = readerSources\n .map(({ url }) => identify(url))\n .filter((remote) => !represented.has(JSON.stringify(remote)));\n for (const [key, group] of Map.groupBy(aliases, (remote) => remote.key)) {\n const candidates = byKey.get(key);\n if (!candidates || !sameScannerRepositories([...candidates, ...group]))\n throw new CodexSecurityError(\n \"Reader repository does not match a source in the normalized findings.\",\n );\n }\n }\n if (strictSources.size && options.provider !== \"blackduck\") {\n const keys = new Set(\n Array.from(strictSources.keys(), (url) => identify(url).key),\n );\n for (const source of references)\n if (!strictSources.has(source.url) && keys.has(identify(source.url).key))\n strictSources.set(source.url, platformFor(source));\n }\n if (inspector) {\n const platform = inspector.platform ?? options.provider;\n const native = remoteRepository(\n inspector.url,\n options.provider,\n true,\n platform,\n );\n for (const url of sources.keys()) {\n if (\n !native ||\n remoteRepository(url, options.provider, true, platform)?.key !==\n native.key\n )\n throw new CodexSecurityError(\n `Imported repository ${JSON.stringify(url)} does not match the retained Inspector repository ${JSON.stringify(inspector.url)}.`,\n );\n }\n }\n for (const source of [...(inspector ? [inspector] : []), ...references]) {\n // A reader's platform must not loosen an operator-supplied Inspector map.\n if (sources.get(source.url)?.platform !== \"github\")\n sources.set(\n source.url,\n options.inspectorProjectMap ? { url: source.url } : source,\n );\n }\n const sonarSources = sonarRepositoryUrls(\n options.provider,\n current.findings,\n current.report,\n \"local\",\n );\n const manualSource =\n options.provider === \"sonar\" && options.sourceRepositoryUrl\n ? declaredScannerRepositoryUrl(\n options.sourceRepositoryUrl,\n \"Sonar\",\n \"local\",\n )\n : undefined;\n if (manualSource) sonarSources.add(manualSource);\n for (const url of sonarSources)\n if (!sources.has(url)) sources.set(url, { url });\n if (sonarSources.size && !sameRepositories(sources.keys()))\n throw new CodexSecurityError(\n manualSource\n ? \"The Sonar evidence does not match the declared source repository.\"\n : \"The retained Sonar repository does not match the other source repository claims.\",\n );\n if (\n options.provider === \"blackduck\" &&\n current.findings.length &&\n sources.size > 1 &&\n !sameScannerRepositories(Array.from(sources.keys(), identify))\n )\n throw new CodexSecurityError(\n \"Black Duck occurrences must belong to the same project version and source repository.\",\n );\n if (dependabotSource)\n sources.set(dependabotSource, {\n url: dependabotSource,\n platform: \"github\",\n });\n const selected = manualSource ? new URL(manualSource) : undefined;\n const matchesRepositoryRemote = await requireMatchingRepository(\n repository,\n options.provider,\n [...sources.values()],\n strictSources,\n platformFor,\n workbenchOptions.protectedRoot,\n workbenchOptions.environment,\n dependencies.signal,\n selected?.protocol === \"https:\" ? selected.hostname : undefined,\n fetchRemotes,\n );\n dependencies.signal?.throwIfAborted();\n const preview = {\n ...cloneImportPreview(current),\n repository,\n source: { provider: options.provider, source_key: options.sourceKey },\n };\n const payload = JSON.stringify({\n repository,\n provider: options.provider,\n sourceKey: options.sourceKey,\n findings: current.findings.map(({ source_finding_id, evidence }) => ({\n source_finding_id,\n evidence,\n })),\n });\n return {\n matchesRepositoryRemote,\n preview,\n async import() {\n dependencies.signal?.throwIfAborted();\n const protectedRoot = [\n ...new Set([\n ...workbenchOptions.protectedRoot,\n ...(await abortable(\n () =>\n localGitProtectionRoots(\n process.cwd(),\n workbenchOptions.environment,\n dependencies.signal,\n ),\n dependencies.signal,\n )),\n ]),\n ];\n requireOutputOutsideRepositories(\n protectedRoot,\n await abortable(\n () =>\n canonicalizeModelSafePath(\n workbenchOptions.environment.CODEX_SECURITY_STATE_DIR,\n ),\n dependencies.signal,\n ),\n \"runtime\",\n );\n const result = await abortable(() => {\n dependencies.signal?.throwIfAborted();\n return (dependencies.runWorkbench ?? runWorkbench)(\n { ...workbenchOptions, protectedRoot },\n [\"store-external-findings\"],\n payload,\n );\n }, dependencies.signal);\n return {\n repository,\n read: current.read,\n ...(current.report === undefined\n ? {}\n : snapshotNormalizedFindings({ report: current.report })),\n ready: current.findings.length,\n excluded: structuredClone(current.excluded),\n findings: result[\"findings\"] as unknown as StoredExternalFinding[],\n counts: result[\"counts\"] as LocalExternalImportResult[\"counts\"],\n };\n },\n };\n}\n\n/** Read imported source records, including evidence that has not been assessed by Codex. */\nexport async function listLocalExternalFindings(\n selection: { repository: string; id?: string },\n dependencies: LocalExternalImportDependencies = {},\n): Promise<StoredExternalFinding[]> {\n dependencies.signal?.throwIfAborted();\n requireExternalImports(dependencies.environment);\n if (selection.id !== undefined) requireIdentity(selection.id, \"Finding id\");\n const { repository, options } = await localContext(\n selection.repository,\n dependencies,\n \"read\",\n );\n const result = await abortable(() => {\n dependencies.signal?.throwIfAborted();\n return (dependencies.runWorkbench ?? runWorkbench)(\n options,\n [\"list-external-findings\"],\n JSON.stringify({ repository, id: selection.id }),\n );\n }, dependencies.signal);\n return result[\"findings\"] as unknown as StoredExternalFinding[];\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { type PrivateImportFormat, type PrivateImportJob } from "./private-finding-import.js";
1
2
  import { CodexSecurityError } from "./errors.js";
2
3
  import { type ExternalFindingsReaderOptions } from "./external-findings-read.js";
3
4
  import { type ExternalFindings } from "./external-findings.js";
@@ -51,6 +52,8 @@ export interface ExternalPublicationResult {
51
52
  verified: number;
52
53
  error?: string;
53
54
  savedSubmission?: string;
55
+ /** Private jobs expose aggregate outcomes before assessment or publication. */
56
+ privateJob?: PrivateImportJob;
54
57
  }
55
58
  /** Preserve accepted work in CLI JSON output when publication cannot finish. */
56
59
  export declare class ExternalPublicationError extends CodexSecurityError {
@@ -65,11 +68,20 @@ export interface ExternalPublicationPreview extends ExternalFindings {
65
68
  source: FindingImportRequest["source"];
66
69
  resumed: boolean;
67
70
  requests: FindingImportRequest[];
71
+ privateImport?: {
72
+ format: PrivateImportFormat;
73
+ contextVersion: string;
74
+ sha256: string;
75
+ bytes: number;
76
+ retryOfJobId?: string;
77
+ };
68
78
  }
69
79
  export interface PreparedExternalPublication {
70
80
  preview: ExternalPublicationPreview;
71
81
  publish(): Promise<ExternalPublicationResult>;
72
82
  }
83
+ export declare function externalPublicationStateDirectory(environment: NodeJS.ProcessEnv): string;
84
+ export declare function writeAtomicJson(path: string, value: unknown): Promise<void>;
73
85
  export declare function prepareExternalPublication(path: string, options: ExternalPublicationOptions, dependencies?: ExternalPublicationDependencies): Promise<PreparedExternalPublication>;
74
86
  /** Prepare normalized provider evidence without reading a vendor export. */
75
87
  export declare function prepareNormalizedExternalPublication(input: ExternalFindings, options: NormalizedExternalPublicationOptions, dependencies?: ExternalPublicationDependencies): Promise<PreparedExternalPublication>;
@@ -1 +1 @@
1
- {"version":3,"file":"external-findings-publish.d.ts","sourceRoot":"","sources":["../src/external-findings-publish.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAOjD,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AAIrC,oFAAoF;AACpF,MAAM,WAAW,oCAAoC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnD;AAED,oEAAoE;AACpE,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,oCAAoC,EACpC,UAAU,CACX;IACC,QAAQ,EAAE,6BAA6B,CAAC,UAAU,CAAC,CAAC;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,qEAAqE;AACrE,MAAM,WAAW,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