vigievuln 1.3.2 → 1.4.0

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/CHANGELOG.md +63 -0
  2. package/README.md +34 -19
  3. package/completions/vigievuln.bash +14 -3
  4. package/completions/vigievuln.zsh +11 -8
  5. package/data/fingerprints/index.js +80 -0
  6. package/data/fingerprints/interpreters/javascript/bun.json +23 -0
  7. package/data/fingerprints/interpreters/javascript/deno.json +10 -0
  8. package/data/fingerprints/interpreters/javascript/electron.json +20 -0
  9. package/data/fingerprints/interpreters/javascript/gjs.json +8 -0
  10. package/data/fingerprints/interpreters/javascript/javascriptcore.json +14 -0
  11. package/data/fingerprints/interpreters/javascript/jscgtk.json +10 -0
  12. package/data/fingerprints/interpreters/javascript/node.json +26 -0
  13. package/data/fingerprints/interpreters/javascript/nwjs.json +8 -0
  14. package/data/fingerprints/interpreters/javascript/webkitgtk.json +10 -0
  15. package/data/fingerprints/interpreters/javascript/wpewebkit.json +10 -0
  16. package/data/fingerprints/interpreters/languages/dotnet.json +8 -0
  17. package/data/fingerprints/interpreters/languages/erlang.json +9 -0
  18. package/data/fingerprints/interpreters/languages/gawk.json +10 -0
  19. package/data/fingerprints/interpreters/languages/guile.json +9 -0
  20. package/data/fingerprints/interpreters/languages/java.json +8 -0
  21. package/data/fingerprints/interpreters/languages/julia.json +9 -0
  22. package/data/fingerprints/interpreters/languages/lua.json +11 -0
  23. package/data/fingerprints/interpreters/languages/luajit.json +10 -0
  24. package/data/fingerprints/interpreters/languages/perl.json +11 -0
  25. package/data/fingerprints/interpreters/languages/php.json +22 -0
  26. package/data/fingerprints/interpreters/languages/powershell.json +17 -0
  27. package/data/fingerprints/interpreters/languages/pypy.json +8 -0
  28. package/data/fingerprints/interpreters/languages/python.json +24 -0
  29. package/data/fingerprints/interpreters/languages/r.json +9 -0
  30. package/data/fingerprints/interpreters/languages/racket.json +9 -0
  31. package/data/fingerprints/interpreters/languages/raku.json +8 -0
  32. package/data/fingerprints/interpreters/languages/ruby.json +21 -0
  33. package/data/fingerprints/interpreters/languages/tcl.json +9 -0
  34. package/data/fingerprints/interpreters/shells/bash.json +10 -0
  35. package/data/fingerprints/interpreters/shells/dash.json +8 -0
  36. package/data/fingerprints/interpreters/shells/fish.json +9 -0
  37. package/data/fingerprints/interpreters/shells/ksh.json +8 -0
  38. package/data/fingerprints/interpreters/shells/zsh.json +9 -0
  39. package/data/fingerprints/services/databases/clickhouse.json +8 -0
  40. package/data/fingerprints/services/databases/elasticsearch.json +8 -0
  41. package/data/fingerprints/services/databases/etcd.json +9 -0
  42. package/data/fingerprints/services/databases/mariadb.json +9 -0
  43. package/data/fingerprints/services/databases/memcached.json +9 -0
  44. package/data/fingerprints/services/databases/mongo.json +8 -0
  45. package/data/fingerprints/services/databases/mysql.json +9 -0
  46. package/data/fingerprints/services/databases/opensearch.json +8 -0
  47. package/data/fingerprints/services/databases/postgres.json +18 -0
  48. package/data/fingerprints/services/databases/redis.json +9 -0
  49. package/data/fingerprints/services/databases/valkey.json +8 -0
  50. package/data/fingerprints/services/dns-directory/bind.json +8 -0
  51. package/data/fingerprints/services/dns-directory/dnsmasq.json +8 -0
  52. package/data/fingerprints/services/dns-directory/slapd.json +8 -0
  53. package/data/fingerprints/services/dns-directory/unbound.json +8 -0
  54. package/data/fingerprints/services/mail/cyrus.json +8 -0
  55. package/data/fingerprints/services/mail/dovecot.json +8 -0
  56. package/data/fingerprints/services/mail/exim.json +9 -0
  57. package/data/fingerprints/services/mail/opendkim.json +8 -0
  58. package/data/fingerprints/services/mail/opensmtpd.json +8 -0
  59. package/data/fingerprints/services/mail/postfix.json +8 -0
  60. package/data/fingerprints/services/mail/rspamd.json +8 -0
  61. package/data/fingerprints/services/mail/sendmail.json +8 -0
  62. package/data/fingerprints/services/messaging/kafka.json +8 -0
  63. package/data/fingerprints/services/messaging/mosquitto.json +8 -0
  64. package/data/fingerprints/services/messaging/nats.json +9 -0
  65. package/data/fingerprints/services/messaging/rabbitmq.json +8 -0
  66. package/data/fingerprints/services/remote-access/dropbear.json +8 -0
  67. package/data/fingerprints/services/remote-access/openssh.json +10 -0
  68. package/data/fingerprints/services/remote-access/proftpd.json +8 -0
  69. package/data/fingerprints/services/remote-access/samba.json +8 -0
  70. package/data/fingerprints/services/remote-access/vsftpd.json +8 -0
  71. package/data/fingerprints/services/web-proxies/apache.json +18 -0
  72. package/data/fingerprints/services/web-proxies/caddy.json +9 -0
  73. package/data/fingerprints/services/web-proxies/envoy.json +8 -0
  74. package/data/fingerprints/services/web-proxies/haproxy.json +10 -0
  75. package/data/fingerprints/services/web-proxies/lighttpd.json +8 -0
  76. package/data/fingerprints/services/web-proxies/nginx.json +14 -0
  77. package/data/fingerprints/services/web-proxies/squid.json +8 -0
  78. package/data/fingerprints/services/web-proxies/tomcat.json +8 -0
  79. package/data/fingerprints/services/web-proxies/traefik.json +9 -0
  80. package/data/fingerprints/services/web-proxies/varnish.json +8 -0
  81. package/lib/README.md +51 -0
  82. package/lib/{coverage-diagnostics.js → advisories/coverage-diagnostics.js} +1 -1
  83. package/lib/{cve-match.js → advisories/cve-match.js} +17 -12
  84. package/lib/{advisory-fixes.js → advisories/fixes.js} +1 -1
  85. package/lib/{advisory-freshness.js → advisories/freshness.js} +5 -1
  86. package/lib/{gap-adjudicate.js → advisories/gap-adjudicate.js} +3 -3
  87. package/lib/{native-package-match.js → advisories/native-package-match.js} +20 -11
  88. package/lib/{native-source-prepare.js → advisories/native-source-prepare.js} +15 -12
  89. package/lib/{native-advisories.js → advisories/native.js} +15 -13
  90. package/lib/{advisory-store-sqlite.js → advisories/store-sqlite.js} +5 -5
  91. package/lib/{advisory-store.js → advisories/store.js} +2 -2
  92. package/lib/{application-exports.js → applications/exports.js} +1 -1
  93. package/lib/{application-inventory.js → applications/inventory.js} +3 -1
  94. package/lib/applications/layout.js +199 -0
  95. package/lib/{application-providers → applications}/live-snapshot.js +10 -10
  96. package/lib/{application-plugins → applications/plugins}/drupal.js +2 -2
  97. package/lib/applications/plugins/ghost.js +36 -0
  98. package/lib/{application-plugins → applications/plugins}/index.js +1 -1
  99. package/lib/{application-plugins → applications/plugins}/prestashop.js +73 -15
  100. package/lib/applications/plugins/redmine.js +24 -0
  101. package/lib/{application-plugins → applications/plugins}/runner.js +89 -59
  102. package/lib/{application-plugins → applications/plugins}/spip.js +4 -4
  103. package/lib/{application-plugins → applications/plugins}/symfony.js +1 -1
  104. package/lib/{application-plugins → applications/plugins}/typo3.js +2 -2
  105. package/lib/{application-plugins → applications/plugins}/wave2-common.js +1 -1
  106. package/lib/{application-plugins → applications/plugins}/wordpress.js +52 -18
  107. package/lib/{application-providers → applications}/snapshot-cache.js +1 -1
  108. package/lib/{cms-snapshot-warm.js → applications/snapshot-warm.js} +21 -8
  109. package/lib/artifacts/access-warnings.js +24 -0
  110. package/lib/artifacts/applications.js +39 -8
  111. package/lib/artifacts/component-scope.js +12 -3
  112. package/lib/artifacts/cve-view.js +8 -5
  113. package/lib/artifacts/disk-wasm.mjs +3 -0
  114. package/lib/artifacts/disk.js +188 -0
  115. package/lib/artifacts/elf-product.js +215 -0
  116. package/lib/artifacts/enrichment.js +31 -17
  117. package/lib/artifacts/go-main-identity.js +135 -36
  118. package/lib/artifacts/go-publisher-advisories.js +4 -3
  119. package/lib/artifacts/image-products.js +181 -0
  120. package/lib/artifacts/index.js +36 -13
  121. package/lib/artifacts/install-version.js +44 -0
  122. package/lib/artifacts/inventory-scope.js +53 -3
  123. package/lib/artifacts/pe-product.js +28 -0
  124. package/lib/artifacts/product-advisories.js +212 -0
  125. package/lib/artifacts/product-catalog.js +67 -0
  126. package/lib/artifacts/release-catalogues.js +149 -0
  127. package/lib/artifacts/release-versions.js +101 -0
  128. package/lib/artifacts/remediation-report.js +1 -1
  129. package/lib/artifacts/report-inventory.js +17 -2
  130. package/lib/artifacts/report-path.js +29 -0
  131. package/lib/artifacts/report.js +85 -32
  132. package/lib/artifacts/retire.js +3 -3
  133. package/lib/artifacts/risk-report.js +12 -8
  134. package/lib/artifacts/sbom.js +33 -4
  135. package/lib/artifacts/scan.js +316 -69
  136. package/lib/artifacts/system-apps.js +98 -0
  137. package/lib/artifacts/system-maintenance.js +101 -0
  138. package/lib/artifacts/system-module-updates.js +104 -0
  139. package/lib/artifacts/system-report.js +232 -0
  140. package/lib/{airgap-project.js → cache/airgap-project.js} +25 -10
  141. package/lib/{cache-archive-sqlite.js → cache/archive.js} +6 -5
  142. package/lib/{cache-db.js → cache/db.js} +1 -1
  143. package/lib/{dump-format.js → cache/dump-format.js} +2 -2
  144. package/lib/{json-cache.js → cache/json.js} +1 -1
  145. package/lib/{proxy-cache.js → cache/proxy-cache.js} +9 -9
  146. package/lib/{proxy-scope.js → cache/proxy-scope.js} +1 -1
  147. package/lib/{record-freshness.js → cache/record-freshness.js} +1 -1
  148. package/lib/{cache-repository.js → cache/repository.js} +1 -1
  149. package/lib/{resource-cache → cache/resource}/engine.js +23 -16
  150. package/lib/{resource-cache → cache/resource}/fs-store.js +2 -2
  151. package/lib/{resource-cache → cache/resource}/sqlite-store.js +3 -3
  152. package/lib/{resource-cache → cache/resource}/validate.js +20 -5
  153. package/lib/{sqlite-driver.js → cache/sqlite-driver.js} +7 -5
  154. package/lib/certs/scan.js +17 -11
  155. package/lib/cli-collect.js +262 -0
  156. package/lib/cli-command-routing.js +30 -13
  157. package/lib/cli-groups.js +1 -1
  158. package/lib/cli-image.js +158 -47
  159. package/lib/cli-project-commands.js +10 -10
  160. package/lib/cli-setup.js +8 -8
  161. package/lib/cli-watch.js +3 -3
  162. package/lib/codecs/binary/elf-metadata.js +6 -0
  163. package/lib/codecs/binary/metadata.js +1 -1
  164. package/lib/codecs/binary/pe-metadata.js +47 -11
  165. package/lib/codecs/binary/scan.js +12 -4
  166. package/lib/codecs/binary.codec.js +1 -1
  167. package/lib/codecs/composer/platform.js +2 -2
  168. package/lib/codecs/composer/registry.js +12 -18
  169. package/lib/codecs/composer.codec.js +6 -5
  170. package/lib/codecs/go/parse.js +1 -1
  171. package/lib/codecs/go/registry.js +7 -7
  172. package/lib/codecs/go.codec.js +2 -2
  173. package/lib/codecs/gradle/parse.js +1 -1
  174. package/lib/codecs/gradle/versionless.js +2 -2
  175. package/lib/codecs/gradle.codec.js +7 -7
  176. package/lib/codecs/index.js +1 -1
  177. package/lib/{maven-airgap.js → codecs/maven/airgap.js} +4 -4
  178. package/lib/{maven-bom.js → codecs/maven/bom.js} +3 -3
  179. package/lib/codecs/maven/jar-scan.js +4 -4
  180. package/lib/{maven-license.js → codecs/maven/license.js} +2 -2
  181. package/lib/{core.js → codecs/maven/pom.js} +22 -11
  182. package/lib/{maven-reactor.js → codecs/maven/reactor.js} +18 -12
  183. package/lib/{transitive.js → codecs/maven/transitive.js} +79 -34
  184. package/lib/{maven-version.js → codecs/maven/version.js} +1 -1
  185. package/lib/codecs/maven.codec.js +18 -14
  186. package/lib/codecs/npm/collect.js +55 -8
  187. package/lib/codecs/npm/manifest-kind.js +16 -0
  188. package/lib/codecs/npm/parse.js +23 -7
  189. package/lib/codecs/npm/registry.js +28 -14
  190. package/lib/codecs/npm.codec.js +5 -5
  191. package/lib/codecs/nuget/registry.js +7 -7
  192. package/lib/codecs/nuget.codec.js +4 -4
  193. package/lib/codecs/pypi/registry.js +7 -7
  194. package/lib/codecs/pypi.codec.js +4 -4
  195. package/lib/codecs/recipes.js +2 -2
  196. package/lib/codecs/ruby/registry.js +7 -7
  197. package/lib/codecs/ruby.codec.js +2 -2
  198. package/lib/config.js +1 -1
  199. package/lib/{attribution.js → findings/attribution.js} +3 -3
  200. package/lib/findings/cve-descriptions.js +144 -0
  201. package/lib/{cve-record-coverage.js → findings/cve-record-coverage.js} +46 -41
  202. package/lib/{diff.js → findings/diff.js} +0 -0
  203. package/lib/{finding-enrichment.js → findings/enrichment.js} +45 -32
  204. package/lib/{eu-refs.js → findings/eu-refs.js} +3 -3
  205. package/lib/{gate.js → findings/gate.js} +1 -1
  206. package/lib/{malware.js → findings/malware.js} +30 -7
  207. package/lib/{merge-sources.js → findings/merge.js} +57 -9
  208. package/lib/{priority.js → findings/priority.js} +3 -3
  209. package/lib/findings/risk-evidence.js +24 -0
  210. package/lib/findings/severity.js +16 -0
  211. package/lib/{finding-summary.js → findings/summary.js} +5 -2
  212. package/lib/{suppress.js → findings/suppress.js} +2 -2
  213. package/lib/images/local-docker.js +72 -0
  214. package/lib/{image-network.js → images/network.js} +26 -16
  215. package/lib/{image-references.js → images/references.js} +29 -11
  216. package/lib/{image-registry.js → images/registry.js} +18 -9
  217. package/lib/{source-image-scan.js → images/source-scan.js} +3 -3
  218. package/lib/images/temp-roots.js +23 -0
  219. package/lib/{image-update.js → images/update.js} +3 -3
  220. package/lib/{dep-record.js → inventory/dep-record.js} +2 -2
  221. package/lib/{deps-descriptor.js → inventory/deps-descriptor.js} +3 -3
  222. package/lib/{descriptor-refs.js → inventory/descriptor-refs.js} +1 -1
  223. package/lib/{embedded.js → inventory/embedded.js} +4 -3
  224. package/lib/{license-policy.js → inventory/license-policy.js} +2 -2
  225. package/lib/{manifest-copy.js → inventory/manifest-copy.js} +2 -2
  226. package/lib/{module-names.js → inventory/module-names.js} +1 -1
  227. package/lib/{package-versions.js → inventory/package-versions.js} +2 -2
  228. package/lib/{parallel-walk.js → inventory/parallel-walk.js} +1 -1
  229. package/lib/{path-filter.js → inventory/path-filter.js} +1 -1
  230. package/lib/{private-deps.js → inventory/private-deps.js} +1 -1
  231. package/lib/{project-descriptor.js → inventory/project-descriptor.js} +3 -0
  232. package/lib/{purl.js → inventory/purl.js} +2 -2
  233. package/lib/{unmanaged.js → inventory/unmanaged.js} +6 -3
  234. package/lib/{commercial-support.js → maintenance/commercial-support.js} +5 -5
  235. package/lib/{outdated.js → maintenance/outdated.js} +20 -20
  236. package/lib/options-env.js +1 -1
  237. package/lib/{system-inventory/alpine-tracker.js → providers/alpine/tracker.js} +27 -7
  238. package/lib/{certfr.js → providers/certfr/enrich.js} +9 -9
  239. package/lib/{cve-download.js → providers/cveproject/download.js} +56 -36
  240. package/lib/{cve-legacy-ranges.js → providers/cveproject/legacy-ranges.js} +1 -1
  241. package/lib/{cve-npm-proxy.js → providers/cveproject/npm-proxy.js} +5 -5
  242. package/lib/{cve-packages-proxy.js → providers/cveproject/packages-proxy.js} +6 -6
  243. package/lib/{cve-version-verdict.js → providers/cveproject/version-verdict.js} +2 -2
  244. package/lib/{system-inventory/current-debian.js → providers/debian/current.js} +6 -6
  245. package/lib/{system-inventory/historical-debian.js → providers/debian/historical.js} +6 -6
  246. package/lib/providers/{debian.js → debian/index.js} +1 -0
  247. package/lib/{application-providers/drupal-advisories.js → providers/drupal/advisories.js} +13 -36
  248. package/lib/providers/{drupal.js → drupal/index.js} +4 -0
  249. package/lib/providers/{eol.js → eol/index.js} +1 -1
  250. package/lib/{epss.js → providers/epss/enrich.js} +16 -13
  251. package/lib/providers/{epss.js → epss/index.js} +2 -2
  252. package/lib/{euvd.js → providers/euvd/enrich.js} +13 -13
  253. package/lib/{system-inventory/freexian-ela.js → providers/freexian/ela.js} +6 -6
  254. package/lib/providers/{freexian.js → freexian/index.js} +3 -3
  255. package/lib/{system-inventory/freexian-release-evidence.js → providers/freexian/release-evidence.js} +8 -5
  256. package/lib/{system-inventory/freexian-tracker.js → providers/freexian/tracker.js} +33 -9
  257. package/lib/{gcve-feed.js → providers/gcve/feed.js} +4 -4
  258. package/lib/{gcve.js → providers/gcve/id.js} +1 -1
  259. package/lib/{gcve-index.js → providers/gcve/local-index.js} +4 -4
  260. package/lib/{application-providers/github-advisories.js → providers/github/advisories.js} +6 -2
  261. package/lib/providers/{github.js → github/index.js} +3 -1
  262. package/lib/{github-publisher-maven.js → providers/github/publisher-maven.js} +1 -1
  263. package/lib/providers/{go.js → go/index.js} +1 -1
  264. package/lib/{hash-id.js → providers/hashid/identify.js} +7 -7
  265. package/lib/providers/{hashid.js → hashid/index.js} +1 -1
  266. package/lib/providers/index.js +18 -13
  267. package/lib/{kev.js → providers/kev/enrich.js} +12 -9
  268. package/lib/{maven-cache.js → providers/maven/cache.js} +3 -3
  269. package/lib/providers/{maven.js → maven/index.js} +5 -3
  270. package/lib/{maven-presence.js → providers/maven/presence.js} +5 -5
  271. package/lib/{maven-repo.js → providers/maven/repo.js} +38 -21
  272. package/lib/providers/mit-kerberos/index.js +6 -0
  273. package/lib/{system-inventory/nginx-advisories.js → providers/nginx/advisories.js} +3 -3
  274. package/lib/providers/{npm.js → npm/index.js} +1 -1
  275. package/lib/providers/{nuget.js → nuget/index.js} +1 -1
  276. package/lib/{cpe.js → providers/nvd/cpe.js} +35 -47
  277. package/lib/{nvd.js → providers/nvd/enrich.js} +41 -40
  278. package/lib/providers/{nvd.js → nvd/index.js} +18 -4
  279. package/lib/{nvd-package-ranges.js → providers/nvd/package-ranges.js} +38 -22
  280. package/lib/{osv-db.js → providers/osv/db.js} +18 -16
  281. package/lib/providers/{osv.js → osv/index.js} +1 -1
  282. package/lib/{osv.js → providers/osv/query.js} +150 -80
  283. package/lib/providers/package-releases/index.js +26 -0
  284. package/lib/{packagist-audit.js → providers/packagist/audit.js} +31 -11
  285. package/lib/providers/{packagist.js → packagist/index.js} +1 -1
  286. package/lib/{proxy-throttle.js → providers/proxy-throttle.js} +17 -9
  287. package/lib/providers/{pypi.js → pypi/index.js} +1 -1
  288. package/lib/providers/redhat/bzip2.js +167 -0
  289. package/lib/providers/redhat/errata.js +75 -0
  290. package/lib/providers/redhat/index.js +10 -0
  291. package/lib/providers/redhat/oval.js +70 -0
  292. package/lib/providers/redhat/unfixed.js +127 -0
  293. package/lib/{registries.js → providers/registries.js} +4 -4
  294. package/lib/{retire.js → providers/retire/scan.js} +18 -18
  295. package/lib/providers/{ruby.js → ruby/index.js} +1 -1
  296. package/lib/providers/rubysec/advisories.js +177 -0
  297. package/lib/providers/rubysec/index.js +9 -0
  298. package/lib/{snyk.js → providers/snyk/client.js} +2 -2
  299. package/lib/{application-providers/spip-advisories.js → providers/spip/advisories.js} +5 -13
  300. package/lib/{vigievuln-advisories.js → providers/vigievuln/advisories.js} +4 -4
  301. package/lib/providers/wolfi/index.js +10 -0
  302. package/lib/providers/wolfi/secdb.js +47 -0
  303. package/lib/{application-providers/wordfence-client.js → providers/wordfence/client.js} +4 -4
  304. package/lib/providers/{wordfence.js → wordfence/index.js} +1 -1
  305. package/lib/{application-providers/wordfence-projection.js → providers/wordfence/projection.js} +14 -5
  306. package/lib/{resource-cache/wordfence.js → providers/wordfence/resource-cache.js} +2 -2
  307. package/lib/{application-providers/wordfence-v3.js → providers/wordfence/v3.js} +4 -5
  308. package/lib/providers/{wordpress.js → wordpress/index.js} +5 -0
  309. package/lib/providers/wpvulnerability/assess.js +181 -0
  310. package/lib/providers/wpvulnerability/index.js +12 -0
  311. package/lib/{charts.js → reports/charts.js} +25 -18
  312. package/lib/{csaf-export.js → reports/csaf-export.js} +16 -11
  313. package/lib/{cve-report.js → reports/cve-report.js} +453 -228
  314. package/lib/reports/detail.js +55 -0
  315. package/lib/{i18n.js → reports/i18n.js} +38 -2
  316. package/lib/{report-integrity.js → reports/integrity.js} +1 -1
  317. package/lib/{json-export.js → reports/json-export.js} +95 -24
  318. package/lib/{report-notices.js → reports/notices.js} +11 -6
  319. package/lib/{sarif-export.js → reports/sarif-export.js} +15 -10
  320. package/lib/{sbom-export.js → reports/sbom-export.js} +16 -11
  321. package/lib/{scan-completeness.js → scan/completeness.js} +1 -1
  322. package/lib/scan/coverage.js +114 -0
  323. package/lib/{provenance.js → scan/provenance.js} +12 -5
  324. package/lib/scan/reliability.js +157 -0
  325. package/lib/{source-health.js → scan/source-health.js} +52 -20
  326. package/lib/{source-profile.js → scan/source-profile.js} +3 -3
  327. package/lib/{hosted-proxy.js → service/hosted-proxy.js} +3 -3
  328. package/lib/{project-client.js → service/project-client.js} +20 -2
  329. package/lib/source-input.js +58 -0
  330. package/lib/system-inventory/advisories.js +89 -16
  331. package/lib/system-inventory/collect.js +33 -10
  332. package/lib/system-inventory/distribution-sources.js +32 -15
  333. package/lib/system-inventory/package-applicability.js +51 -0
  334. package/lib/system-inventory/targeted.js +8 -5
  335. package/lib/ui.js +11 -0
  336. package/package.json +49 -2
  337. package/vigievuln.js +483 -352
  338. package/lib/cache-archive.js +0 -676
  339. package/lib/osv-legacy.js +0 -57
  340. package/lib/risk-evidence.js +0 -18
  341. package/lib/scan-coverage.js +0 -61
  342. /package/lib/{application-plugins → applications/plugins}/joomla.js +0 -0
  343. /package/lib/{application-plugins → applications/plugins}/laravel.js +0 -0
  344. /package/lib/{application-plugins → applications/plugins}/magento.js +0 -0
  345. /package/lib/{application-plugins → applications/plugins}/plugin.interface.js +0 -0
  346. /package/lib/{application-plugins → applications/plugins}/select.js +0 -0
  347. /package/lib/{advisory-compression.js → cache/advisory-compression.js} +0 -0
  348. /package/lib/{compression-dictionary.js → cache/compression-dictionary.js} +0 -0
  349. /package/lib/{cache-directory.js → cache/directory.js} +0 -0
  350. /package/lib/{cache-policy.js → cache/policy.js} +0 -0
  351. /package/lib/{resource-cache → cache/resource}/snapshot-projection.js +0 -0
  352. /package/lib/{cache-startup.js → cache/startup.js} +0 -0
  353. /package/lib/{ruby-version.js → codecs/ruby/version.js} +0 -0
  354. /package/lib/{applicability-evidence.js → findings/applicability-evidence.js} +0 -0
  355. /package/lib/{line-stream.js → inventory/line-stream.js} +0 -0
  356. /package/lib/{package-metadata.js → inventory/package-metadata.js} +0 -0
  357. /package/lib/providers/{alpine.js → alpine/index.js} +0 -0
  358. /package/lib/providers/{certfr.js → certfr/index.js} +0 -0
  359. /package/lib/{native-cna-identities.js → providers/cveproject/cna-identities.js} +0 -0
  360. /package/lib/providers/{euvd.js → euvd/index.js} +0 -0
  361. /package/lib/providers/{gcve.js → gcve/index.js} +0 -0
  362. /package/lib/providers/{kev.js → kev/index.js} +0 -0
  363. /package/lib/providers/{nginx.js → nginx/index.js} +0 -0
  364. /package/lib/{nvd-bulk.js → providers/nvd/bulk.js} +0 -0
  365. /package/lib/providers/{osvdb.js → osvdb/index.js} +0 -0
  366. /package/lib/{request-failure.js → providers/request-failure.js} +0 -0
  367. /package/lib/providers/{retire.js → retire/index.js} +0 -0
  368. /package/lib/providers/{vigievuln.js → vigievuln/index.js} +0 -0
  369. /package/lib/{application-providers/wp-checksums.js → providers/wordpress/checksums.js} +0 -0
  370. /package/lib/{report-time.js → reports/time.js} +0 -0
  371. /package/lib/{xlsx-export.js → reports/xlsx-export.js} +0 -0
  372. /package/lib/{diagnostics.js → scan/diagnostics.js} +0 -0
  373. /package/lib/{account-client.js → service/account-client.js} +0 -0
  374. /package/lib/{account-session.js → service/account-session.js} +0 -0
  375. /package/lib/{account-terms.js → service/account-terms.js} +0 -0
@@ -0,0 +1,262 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const {Command} = require('commander');
6
+ const {inventoryTarget, writeSnapshot} = require('./artifacts/scan');
7
+ const {openArtifact} = require('./artifacts');
8
+ const {discoverImageReferences, bindImageDefinitions} = require('./images/references');
9
+
10
+ // A regular SQLite read-only connection can create WAL shared-memory files.
11
+ // Immutable mode cannot consult outstanding journals, so report those as incomplete.
12
+ function openRpmSqlite(file) {
13
+ for (const suffix of ['-wal', '-journal']) {
14
+ if (fs.statSync(file + suffix, {throwIfNoEntry:false})?.size > 0)
15
+ throw Error('RPM database has an outstanding journal; use a consistent snapshot');
16
+ }
17
+ return require('./cache/sqlite-driver').openSqlite(file, {readonly:true, immutable:true});
18
+ }
19
+
20
+ // Kernel and virtual filesystems expose files whose read blocks forever (/proc/kmsg,
21
+ // debugfs event streams); network and user-space mounts are not this system's own content.
22
+ const SKIPPED_MOUNT_TYPES = /^(?:proc|sysfs|devtmpfs|devpts|cgroup2?|securityfs|debugfs|tracefs|autofs|overlay|nsfs|mqueue|fusectl|rpc_pipefs|bpf|pstore|configfs|hugetlbfs|binfmt_misc|efivarfs|selinuxfs|nfs4?|nfsd|cifs|smb3?|9p|ceph|glusterfs|lustre|afs|fuse(?:\.\S+)?) /;
23
+ function hostExclusions(root, extra = []) {
24
+ const excluded = new Set(['proc', 'sys', 'dev', 'run', 'var/lib/docker', 'var/lib/containerd', 'var/lib/containers/storage']
25
+ .map(p => path.join(root, p)));
26
+ // --exclude-path: absolute, or relative to the collected root.
27
+ for (const p of extra || []) excluded.add(path.isAbsolute(p) ? path.resolve(p) : path.resolve(root, p));
28
+ if (process.platform === 'linux') {
29
+ // Also prune bind-mounted virtual filesystems and nested overlay mounts.
30
+ const mountInfo = fs.readFileSync('/proc/self/mountinfo', 'utf8');
31
+ for (const line of mountInfo.split('\n')) {
32
+ const [mount, info] = line.split(' - ');
33
+ if (!info || !SKIPPED_MOUNT_TYPES.test(info)) continue;
34
+ const dir = mount.split(' ')[4].replace(/\\([0-7]{3})/g, (_, n) => String.fromCharCode(parseInt(n, 8)));
35
+ if (dir !== root && !path.relative(root, dir).startsWith('..')) excluded.add(dir);
36
+ }
37
+ }
38
+ return excluded;
39
+ }
40
+
41
+ const lockParsers = {
42
+ 'composer.lock': ['composer', file => require('./codecs/composer/parse').parseComposerLock(file)],
43
+ 'package-lock.json': ['npm', file => require('./codecs/npm/parse').parsePackageLock(file)],
44
+ 'npm-shrinkwrap.json': ['npm', file => require('./codecs/npm/parse').parsePackageLock(file)],
45
+ 'pnpm-lock.yaml': ['npm', file => require('./codecs/npm/parse').parsePnpmLock(file)],
46
+ 'yarn.lock': ['npm', file => require('./codecs/npm/parse').parseYarnLockV1(file)],
47
+ 'Gemfile.lock': ['ruby', file => require('./codecs/ruby/parse').parseGemfileLockFile(file)],
48
+ 'poetry.lock': ['pypi', file => require('./codecs/pypi/parse').parsePoetryLock(file)],
49
+ 'uv.lock': ['pypi', file => require('./codecs/pypi/parse').parseUvLock(file)],
50
+ 'pdm.lock': ['pypi', file => require('./codecs/pypi/parse').parsePdmLock(file)],
51
+ 'Pipfile.lock': ['pypi', file => require('./codecs/pypi/parse').parsePipfileLock(file)],
52
+ 'gradle.lockfile': ['maven', file => require('./codecs/gradle/parse').parseGradleLockfile(fs.readFileSync(file,'utf8'))],
53
+ 'packages.lock.json': ['nuget', file => require('./codecs/nuget/parse').parsePackagesLockJson(file)],
54
+ };
55
+ const projectManifests = new Set(['package.json','composer.json','pyproject.toml','pom.xml','go.mod',
56
+ 'Gemfile','build.gradle','build.gradle.kts','Pipfile','requirements.txt']);
57
+
58
+ const progress = { files: 0, last: '' };
59
+ async function collectTarget(target, options) {
60
+ const warnings = [], descriptors = [], certificateFiles = [];
61
+ let incomplete = false, count = 0;
62
+ const result = await inventoryTarget(target, {...options, openRpmSqlite, redactParseErrors:true, async onInventoryFile(file, name, deps) {
63
+ progress.files++; progress.last = path.dirname(file);
64
+ if (require('./certs/sniff').isCandidate(name)) certificateFiles.push(file);
65
+ const isLock = Object.hasOwn(lockParsers, name);
66
+ if (!isLock && !projectManifests.has(name) && !/\.(?:cs|fs|vb)proj$/i.test(name)) return;
67
+ const relative = path.relative(target.root, file).split(path.sep).join('/');
68
+ if (!require('./artifacts/component-scope').isSystemProjectPath(relative)) return;
69
+ descriptors.push(relative);
70
+ if (!isLock) return;
71
+ try {
72
+ if (fs.statSync(file).size > 64 * 1024 * 1024) throw Error('lockfile exceeds size limit');
73
+ const [ecosystem, parse] = lockParsers[name];
74
+ for (const item of (await parse(file)).deps) {
75
+ const version = require('./inventory/deps-descriptor').cleanVersion(ecosystem === 'npm'
76
+ ? require('./codecs/npm/parse').normaliseNpmVersion(item.version) : item.version);
77
+ if (!version || !item.name) { incomplete = true; continue; }
78
+ const dep = require('./inventory/dep-record').makeDepRecord({
79
+ ecosystem, namespace:item.vendor || item.group, name:ecosystem === 'composer' ? item.pkg : item.name,
80
+ version, isDev:item.isDev, scope:item.scope, provenance:'lockfile', manifestPath:relative,
81
+ });
82
+ if (item.managerRelations?.length === 1) dep.managerRelation = item.managerRelations[0];
83
+ else if (ecosystem === 'npm' && Object.hasOwn(item,'depth'))
84
+ dep.managerRelation = item.depth === 0 ? 'direct' : item.depth > 0 ? 'transitive' : 'unknown';
85
+ dep.coordKey = JSON.stringify(['lockfile', relative, dep.ecosystem, dep.namespace, dep.name, version, dep.isDev]);
86
+ if (!deps.has(dep.coordKey)) count++;
87
+ deps.set(dep.coordKey, dep);
88
+ }
89
+ } catch (error) {
90
+ incomplete = true;
91
+ // Parser errors can quote source lines. Return only a bounded category.
92
+ const cause = error.code === 'EACCES' ? 'permission denied' :
93
+ error.message === 'lockfile exceeds size limit' ? 'file exceeds 64 MiB' :
94
+ /pnpm-lock parse failed/.test(error.message) ? 'invalid pnpm YAML' :
95
+ /JSON|package-lock parse failed/.test(error.message) ? 'invalid JSON' : 'unrecognized lockfile contents';
96
+ warnings.push({type:'dependency-coverage', capability:'inventory', manifestPath:relative,
97
+ message:'Could not inventory lockfile (' + cause + '): ' + relative});
98
+ }
99
+ }});
100
+ result.metadata.projectDescriptors = descriptors.sort();
101
+ await require('./artifacts/system-apps').inventoryApplications(target.root, result, descriptors, options.skipInventoryDir);
102
+ const projectRoots = new Set(result.metadata.systemApplications.applications.map(app=>app.root));
103
+ const certs = [], failures = [];
104
+ for (const file of certificateFiles) {
105
+ const relative = path.relative(target.root,file).split(path.sep).join('/');
106
+ if (!require('./artifacts/component-scope').isSystemProjectPath(relative)) continue;
107
+ let dir = path.posix.dirname(relative);
108
+ while (dir !== '.' && !projectRoots.has(dir)) dir = path.posix.dirname(dir);
109
+ if (!projectRoots.has(dir)) continue;
110
+ try { certs.push(...require('./certs/scan').inspectCertificateFile(file,path.basename(file),relative)); }
111
+ catch { failures.push(relative); }
112
+ }
113
+ result.metadata.projectCertificates = certs;
114
+ result.coverage.push({artifactTargetId:result.id,capability:'inventory',collector:'project-certificates',
115
+ execution:failures.length ? 'partial' : 'completed',result:'inventoried',count:certs.length,
116
+ ...(failures.length ? {reason:failures.length+' unreadable certificate/key candidate(s)'} : {})});
117
+ result.warnings = require('./artifacts/access-warnings').foldAccessWarnings([...result.warnings, ...warnings]);
118
+ result.coverage.push({artifactTargetId:result.id, capability:'inventory', collector:'project-lockfiles',
119
+ execution:incomplete ? 'partial' : 'completed', result:incomplete ? 'indeterminate' : 'inventoried', count});
120
+ return result;
121
+ }
122
+
123
+ async function run(args) {
124
+ const command = new Command('vigievuln system collect')
125
+ .description('Collect a local filesystem and optional local images. Write a portable inventory for auditor-side assessment.')
126
+ .argument('[input]', 'Linux filesystem root, local Docker/OCI archive or VM disk', '/')
127
+ .option('--images', 'inspect locally available images declared by the collected projects')
128
+ .requiredOption('-o, --output <file>', 'destination inventory JSON')
129
+ .option('--docker', 'collect every image in the local Docker Engine cache')
130
+ .option('--docker-socket <path>', 'Docker Engine Unix socket', '/var/run/docker.sock')
131
+ .option('--image <path...>', 'additional local image archives, OCI layouts or extracted directories')
132
+ .option('--projects <directory>', 'limit Dockerfile and YAML image declaration discovery to this directory')
133
+ .option('--exclude-path <path...>', 'directories to leave out, absolute or relative to the collected root (the collection kit itself, a data volume)');
134
+ command.parse(args, {from:'user'});
135
+ const opts = command.opts(), input = fs.realpathSync(command.args[0] || '/'), output = path.resolve(opts.output);
136
+ // A collection that runs for more than 30 s says so on stderr, so a caller can tell a
137
+ // long inventory from a hung one.
138
+ const startedAt = Date.now();
139
+ const heartbeat = setInterval(() => console.error(`· collecting: ${Math.round((Date.now() - startedAt) / 1000)} s, ${progress.files} file(s) examined${progress.last ? ', in ' + progress.last : ''}`), 30000);
140
+ heartbeat.unref();
141
+ const images = [...new Set((opts.image || []).map(p => path.resolve(p)))];
142
+ const existing = fs.statSync(output, {throwIfNoEntry:false});
143
+ if (existing && (!existing.isFile() || [input,...images].some(p => {
144
+ const stat=fs.statSync(p,{throwIfNoEntry:false});
145
+ return stat && stat.dev===existing.dev && stat.ino===existing.ino;
146
+ }))) throw Error('output must be a separate inventory file');
147
+
148
+ const targets = new Map(), references = [];
149
+ let partial = false;
150
+ async function addInput(file, source, primary, engineImage) {
151
+ const directory = fs.statSync(file).isDirectory();
152
+ const plain = directory && !fs.existsSync(path.join(file,'oci-layout'));
153
+ const disk = require('./artifacts/disk');
154
+ const opened = plain ? {targets:[{root:fs.realpathSync(file),kind:'rootfs',metadata:{format:'directory',source}}],cleanup() {}}
155
+ : !directory && disk.isDisk(file) ? await disk.openDisk(file) : await openArtifact(file);
156
+ try {
157
+ for (const target of opened.targets) {
158
+ if (target.id && targets.has(target.id)) {
159
+ const meta=targets.get(target.id).metadata;
160
+ (meta.localSources ||= []).push(source);
161
+ if (engineImage) meta.localDocker=engineImage;
162
+ continue;
163
+ }
164
+ const excluded=hostExclusions(target.root, opts.excludePath);
165
+ if (plain && primary) for (const image of images) {
166
+ if (fs.statSync(image,{throwIfNoEntry:false})?.isDirectory()) excluded.add(fs.realpathSync(image));
167
+ }
168
+ const skipInventoryDir = dir => excluded.has(dir);
169
+ const inventory=primary
170
+ ? await collectTarget(target,{source,systemSource:[source,target.metadata.partition],skipInventoryDir})
171
+ : await inventoryTarget(target,{source,openRpmSqlite,redactParseErrors:true,skipInventoryDir});
172
+ if (target.metadata.diskFormat && target.metadata.warnings.length) partial = true;
173
+ targets.set(inventory.id,inventory);
174
+ inventory.metadata.localSources=[source];
175
+ if(primary && plain && fs.realpathSync(target.root)==='/')inventory.metadata.hostname=require('node:os').hostname();
176
+ if (engineImage) inventory.metadata.localDocker=engineImage;
177
+ if (!primary) continue;
178
+ inventory.metadata.inspectLocalImages = Boolean(opts.images || opts.docker || images.length);
179
+ let projects=target.root;
180
+ if (opts.projects) {
181
+ projects=fs.realpathSync(plain ? opts.projects : path.join(target.root,opts.projects));
182
+ const relative=path.relative(target.root,projects);
183
+ if (relative==='..' || relative.startsWith('..'+path.sep) || !fs.statSync(projects).isDirectory())
184
+ throw Error('--projects must be a directory within the collected root');
185
+ }
186
+ const prefix=path.relative(target.root,projects);
187
+ const discovery=discoverImageReferences(projects,{
188
+ skipInventoryDir:dir=>skipInventoryDir(dir) || !require('./artifacts/component-scope').isSystemProjectPath(path.relative(target.root,dir)),
189
+ deploymentYamlOnly:true, redactParseErrors:true
190
+ });
191
+ for (const ref of discovery.references) references.push({...ref, id:inventory.id+'/'+ref.id,
192
+ declaredInTargetId:inventory.id, path:path.join(prefix,ref.path).split(path.sep).join('/')});
193
+ inventory.metadata.excludedDirectories=[...excluded].map(dir=>path.relative(target.root,dir)).sort();
194
+ inventory.metadata.definitionDiscovery={source:prefix || '.',status:discovery.warnings.length?'incomplete':'no-match'};
195
+ inventory.warnings = require('./artifacts/access-warnings').foldAccessWarnings([...inventory.warnings, ...discovery.warnings.map(w=>({...w,capability:'inventory'}))]);
196
+ }
197
+ } finally {await opened.cleanup();}
198
+ }
199
+ await addInput(input,input,true);
200
+ const host=targets.values().next().value;
201
+ let missingImage=false;
202
+ function failed(source,error) {
203
+ partial=true;
204
+ missingImage=true;
205
+ host.warnings.push({type:'dependency-coverage',capability:'inventory',message:source+': '+error.message});
206
+ }
207
+ for (const image of images) {
208
+ try {await addInput(image,image,false);} catch(error) {failed(image,error);}
209
+ }
210
+ function normalized(ref) {
211
+ try {
212
+ const {registry,repository,reference}=require('./images/registry').parseReference(ref);
213
+ return JSON.stringify([registry,repository,reference]);
214
+ } catch {return null;}
215
+ }
216
+ function localNames() {
217
+ const result=new Map();
218
+ for (const target of targets.values()) {
219
+ const meta=target.metadata;
220
+ for (const ref of [...(meta.tags || []),...(meta.localDocker?.tags || []),...(meta.localDocker?.repoDigests || [])]) {
221
+ const key=normalized(ref);
222
+ if (!key) continue;
223
+ if (!result.has(key)) result.set(key,new Set());
224
+ result.get(key).add(target.id);
225
+ }
226
+ }
227
+ return result;
228
+ }
229
+ const known=localNames();
230
+ const wanted=new Set(references.filter(r=>!r.unresolved?.length).map(r=>normalized(r.reference)).filter(k=>k && !known.has(k)));
231
+ if (opts.docker || (opts.images && wanted.size)) {
232
+ const selected=image=>opts.docker || [...(image.RepoTags || []),...(image.RepoDigests || [])].some(r=>wanted.has(normalized(r)));
233
+ try {await require('./images/local-docker').collectImages(opts.dockerSocket,(f,s,m)=>addInput(f,s,false,m),failed,selected);}
234
+ catch(error) {failed('Local Docker Engine',error);}
235
+ }
236
+ const all=[...targets.values()], names=localNames();
237
+ for (const ref of references) ref.localImageCandidates=[...(names.get(normalized(ref.reference)) || [])];
238
+ const declarations=bindImageDefinitions(all,references);
239
+ for (const target of all) {
240
+ const owned=declarations.filter(ref=>ref.declaredInTargetId===target.id);
241
+ if (owned.length) target.metadata.declarations=owned;
242
+ else delete target.metadata.declarations;
243
+ if (target.metadata.definitions?.length && target.metadata.definitionDiscovery?.status!=='incomplete')
244
+ target.metadata.definitionDiscovery={...target.metadata.definitionDiscovery,status:'matched'};
245
+ if (opts.images) for (const ref of owned) {
246
+ if (!ref.boundArtifactIds.length && !ref.localImageCandidates.length)
247
+ failed(ref.path,Error('Declared image unavailable locally: '+ref.declared));
248
+ }
249
+ }
250
+ if (missingImage) host.coverage.push({artifactTargetId:host.id,capability:'inventory',collector:'local-images',execution:'partial',result:'indeterminate'});
251
+ await writeSnapshot(output, all, {compact:true, validate:true});
252
+ console.log(`Inventory: ${output} (${all.length} target(s))`);
253
+ const filename = './' + path.basename(output);
254
+ const argument = /^[a-zA-Z0-9_./-]+$/.test(filename) ? filename : "'" + filename.replaceAll("'", "'\\''") + "'";
255
+ console.log('On the auditor machine: vigievuln system scan ' + argument + ' --report-output ./rapport');
256
+ if (partial) {for (const w of host.warnings) console.error(w.message); process.exitCode = 2;}
257
+ }
258
+ async function collectSystemTarget(target,options={}) {
259
+ const excluded=hostExclusions(target.root,options.excludePath);
260
+ return collectTarget(target,{...options,systemSource:[options.source||target.metadata.source,target.metadata.partition],skipInventoryDir:dir=>excluded.has(dir)});
261
+ }
262
+ module.exports = {run,collectSystemTarget};
@@ -2,31 +2,48 @@
2
2
 
3
3
  const COMMAND_HELP = `
4
4
  Commands:
5
- scan <dir> [options] scan a source tree (alias of -s <dir>)
6
- image <archive|rootfs> [options] scan an image natively; image --help
7
- setup configure sources and proxy
5
+ scan <path|zip|descriptor.json> scan project sources or offline extracts
6
+ system collect [root] -o <file> collect a local system inventory (default root: /)
7
+ system scan <json|path|image|archive|disk> assess a system or image
8
8
  watch <dir> --name <name>|--id <id> collect and upload a project
9
9
  watch <dir> --export <file> export descriptor locally
10
10
  login | logout | whoami aliases of auth login | logout | status
11
- config show show masked configuration
11
+ setup | config show configure or inspect sources
12
12
  cache export|import <file> transfer the complete local cache
13
13
  cache prepare <descriptor|inventory> --output <file> prepare an offline archive online
14
- watch --help: privacy, safe updates; free account: 1 project,
15
- 100 distinct direct coordinates (versions count once). Legacy commands remain supported.`;
14
+ watch --help: privacy, safe updates; free account: 1 project, 100 distinct direct coordinates (versions count once).`;
16
15
 
17
16
  function routeArguments(input) {
18
17
  const args = [...input], command = args[0];
19
18
  const auth = { login: 'login', logout: 'logout', whoami: 'status' };
20
19
  if (Object.hasOwn(auth, command)) return { args: ['auth', auth[command], ...args.slice(1)] };
20
+ if (['collect','analyse','image'].includes(command))
21
+ throw Error(command+' has been removed. Use vigievuln system '+(command==='collect'?'collect':'scan')+'.');
22
+ if(args.some(a=>/^(?:-s|--src|--source)(?:=|$)/.test(a)))
23
+ throw Error('Source flags have been removed. Use vigievuln scan <input>.');
24
+ if(command==='system'){
25
+ if(args.length===1 || ['--help','-h'].includes(args[1]))return {help:'Usage: vigievuln system collect [root] -o collect.json\n vigievuln system scan <json|path|image|archive|disk> [options]'};
26
+ if(!['collect','scan'].includes(args[1]))throw Error('system expects collect or scan');
27
+ return {args};
28
+ }
21
29
  if (command === 'scan') {
22
30
  const rest = args.slice(1);
23
- if (rest[0] && !rest[0].startsWith('-')) {
24
- const source = rest.shift();
25
- if (rest.some(a => /^(--src|--source)(=|$)|^-s/.test(a)))
26
- throw new Error('scan accepts either <dir> or --src/--source, not both');
27
- return { args: ['--src', source, ...rest] };
31
+ if(rest[0] && !rest[0].startsWith('-')){
32
+ const source=rest.shift();
33
+ if(rest.some(a=>/^--(?:import-anonymized|prepare-offline)(?:=|$)/.test(a)))throw Error('scan input conflicts with an explicitly selected descriptor');
34
+ let descriptor=false;
35
+ if(/\.json$/i.test(source) && require('node:fs').existsSync(source)){
36
+ const fs=require('node:fs');
37
+ if(fs.statSync(source).size>128*1024*1024)throw Error('Source descriptor exceeds size limit');
38
+ const document=JSON.parse(fs.readFileSync(source,'utf8'));
39
+ if(document.schema==='vigievuln-artifact-inventory/1' || document.bomFormat || document.spdxVersion)
40
+ throw Error('System inventories and SBOMs use vigievuln system scan <input>.');
41
+ if(document.schema!=='fad-deps/1')throw Error('Unknown project descriptor schema. Scan the containing source directory for manifest files.');
42
+ descriptor=true;
43
+ }
44
+ return {args:[descriptor?'--import-anonymized':'--src',source,...rest],sourceInput:source,descriptorScan:descriptor};
28
45
  }
29
- return { args: rest.length ? rest : ['--help'] };
46
+ return {args:rest.length?rest:['--help']};
30
47
  }
31
48
  if (command === 'config') {
32
49
  if (args.length === 1 || args.some(a => a === '--help' || a === '-h'))
@@ -54,7 +71,7 @@ function routeArguments(input) {
54
71
  else args.push(rest[i]);
55
72
  }
56
73
  if(outputs.length!==1 || !outputs[0])throw Error('cache prepare requires exactly one --output');
57
- return {args:['image','--inventory',file,'--no-report','--prepare-cache',outputs[0],...args]};
74
+ return {args:['system','scan','--inventory',file,'--no-report','--prepare-cache',outputs[0],...args]};
58
75
  }
59
76
  return {args:['--prepare-offline',file,...rest]};
60
77
  }
package/lib/cli-groups.js CHANGED
@@ -17,7 +17,7 @@
17
17
  /** Token → the commander option key it drives. Token names are the flag minus `--no-`. */
18
18
  const DISABLE = {
19
19
  report: "report", transitive: "transitive", "all-libs": "allLibs", osv: "osv", nvd: "nvd", "nvd-mirror": "nvdMirror",
20
- "packagist-audit": "packagistAudit",
20
+ "packagist-audit": "packagistAudit", "ruby-advisories": "rubyAdvisories",
21
21
  epss: "epss", eol: "eol", kev: "kev", euvd: "euvd", gcve: "gcve", certfr: "certfr", checksums: "checksums", "osv-db": "osvDb",
22
22
  retire: "retire", "vendored-js-inventory": "vendoredJsInventory",
23
23
  maven: "maven", gradle: "gradle", npm: "npm", yarn: "yarn", nuget: "nuget",