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.
- package/CHANGELOG.md +63 -0
- package/README.md +34 -19
- package/completions/vigievuln.bash +14 -3
- package/completions/vigievuln.zsh +11 -8
- package/data/fingerprints/index.js +80 -0
- package/data/fingerprints/interpreters/javascript/bun.json +23 -0
- package/data/fingerprints/interpreters/javascript/deno.json +10 -0
- package/data/fingerprints/interpreters/javascript/electron.json +20 -0
- package/data/fingerprints/interpreters/javascript/gjs.json +8 -0
- package/data/fingerprints/interpreters/javascript/javascriptcore.json +14 -0
- package/data/fingerprints/interpreters/javascript/jscgtk.json +10 -0
- package/data/fingerprints/interpreters/javascript/node.json +26 -0
- package/data/fingerprints/interpreters/javascript/nwjs.json +8 -0
- package/data/fingerprints/interpreters/javascript/webkitgtk.json +10 -0
- package/data/fingerprints/interpreters/javascript/wpewebkit.json +10 -0
- package/data/fingerprints/interpreters/languages/dotnet.json +8 -0
- package/data/fingerprints/interpreters/languages/erlang.json +9 -0
- package/data/fingerprints/interpreters/languages/gawk.json +10 -0
- package/data/fingerprints/interpreters/languages/guile.json +9 -0
- package/data/fingerprints/interpreters/languages/java.json +8 -0
- package/data/fingerprints/interpreters/languages/julia.json +9 -0
- package/data/fingerprints/interpreters/languages/lua.json +11 -0
- package/data/fingerprints/interpreters/languages/luajit.json +10 -0
- package/data/fingerprints/interpreters/languages/perl.json +11 -0
- package/data/fingerprints/interpreters/languages/php.json +22 -0
- package/data/fingerprints/interpreters/languages/powershell.json +17 -0
- package/data/fingerprints/interpreters/languages/pypy.json +8 -0
- package/data/fingerprints/interpreters/languages/python.json +24 -0
- package/data/fingerprints/interpreters/languages/r.json +9 -0
- package/data/fingerprints/interpreters/languages/racket.json +9 -0
- package/data/fingerprints/interpreters/languages/raku.json +8 -0
- package/data/fingerprints/interpreters/languages/ruby.json +21 -0
- package/data/fingerprints/interpreters/languages/tcl.json +9 -0
- package/data/fingerprints/interpreters/shells/bash.json +10 -0
- package/data/fingerprints/interpreters/shells/dash.json +8 -0
- package/data/fingerprints/interpreters/shells/fish.json +9 -0
- package/data/fingerprints/interpreters/shells/ksh.json +8 -0
- package/data/fingerprints/interpreters/shells/zsh.json +9 -0
- package/data/fingerprints/services/databases/clickhouse.json +8 -0
- package/data/fingerprints/services/databases/elasticsearch.json +8 -0
- package/data/fingerprints/services/databases/etcd.json +9 -0
- package/data/fingerprints/services/databases/mariadb.json +9 -0
- package/data/fingerprints/services/databases/memcached.json +9 -0
- package/data/fingerprints/services/databases/mongo.json +8 -0
- package/data/fingerprints/services/databases/mysql.json +9 -0
- package/data/fingerprints/services/databases/opensearch.json +8 -0
- package/data/fingerprints/services/databases/postgres.json +18 -0
- package/data/fingerprints/services/databases/redis.json +9 -0
- package/data/fingerprints/services/databases/valkey.json +8 -0
- package/data/fingerprints/services/dns-directory/bind.json +8 -0
- package/data/fingerprints/services/dns-directory/dnsmasq.json +8 -0
- package/data/fingerprints/services/dns-directory/slapd.json +8 -0
- package/data/fingerprints/services/dns-directory/unbound.json +8 -0
- package/data/fingerprints/services/mail/cyrus.json +8 -0
- package/data/fingerprints/services/mail/dovecot.json +8 -0
- package/data/fingerprints/services/mail/exim.json +9 -0
- package/data/fingerprints/services/mail/opendkim.json +8 -0
- package/data/fingerprints/services/mail/opensmtpd.json +8 -0
- package/data/fingerprints/services/mail/postfix.json +8 -0
- package/data/fingerprints/services/mail/rspamd.json +8 -0
- package/data/fingerprints/services/mail/sendmail.json +8 -0
- package/data/fingerprints/services/messaging/kafka.json +8 -0
- package/data/fingerprints/services/messaging/mosquitto.json +8 -0
- package/data/fingerprints/services/messaging/nats.json +9 -0
- package/data/fingerprints/services/messaging/rabbitmq.json +8 -0
- package/data/fingerprints/services/remote-access/dropbear.json +8 -0
- package/data/fingerprints/services/remote-access/openssh.json +10 -0
- package/data/fingerprints/services/remote-access/proftpd.json +8 -0
- package/data/fingerprints/services/remote-access/samba.json +8 -0
- package/data/fingerprints/services/remote-access/vsftpd.json +8 -0
- package/data/fingerprints/services/web-proxies/apache.json +18 -0
- package/data/fingerprints/services/web-proxies/caddy.json +9 -0
- package/data/fingerprints/services/web-proxies/envoy.json +8 -0
- package/data/fingerprints/services/web-proxies/haproxy.json +10 -0
- package/data/fingerprints/services/web-proxies/lighttpd.json +8 -0
- package/data/fingerprints/services/web-proxies/nginx.json +14 -0
- package/data/fingerprints/services/web-proxies/squid.json +8 -0
- package/data/fingerprints/services/web-proxies/tomcat.json +8 -0
- package/data/fingerprints/services/web-proxies/traefik.json +9 -0
- package/data/fingerprints/services/web-proxies/varnish.json +8 -0
- package/lib/README.md +51 -0
- package/lib/{coverage-diagnostics.js → advisories/coverage-diagnostics.js} +1 -1
- package/lib/{cve-match.js → advisories/cve-match.js} +17 -12
- package/lib/{advisory-fixes.js → advisories/fixes.js} +1 -1
- package/lib/{advisory-freshness.js → advisories/freshness.js} +5 -1
- package/lib/{gap-adjudicate.js → advisories/gap-adjudicate.js} +3 -3
- package/lib/{native-package-match.js → advisories/native-package-match.js} +20 -11
- package/lib/{native-source-prepare.js → advisories/native-source-prepare.js} +15 -12
- package/lib/{native-advisories.js → advisories/native.js} +15 -13
- package/lib/{advisory-store-sqlite.js → advisories/store-sqlite.js} +5 -5
- package/lib/{advisory-store.js → advisories/store.js} +2 -2
- package/lib/{application-exports.js → applications/exports.js} +1 -1
- package/lib/{application-inventory.js → applications/inventory.js} +3 -1
- package/lib/applications/layout.js +199 -0
- package/lib/{application-providers → applications}/live-snapshot.js +10 -10
- package/lib/{application-plugins → applications/plugins}/drupal.js +2 -2
- package/lib/applications/plugins/ghost.js +36 -0
- package/lib/{application-plugins → applications/plugins}/index.js +1 -1
- package/lib/{application-plugins → applications/plugins}/prestashop.js +73 -15
- package/lib/applications/plugins/redmine.js +24 -0
- package/lib/{application-plugins → applications/plugins}/runner.js +89 -59
- package/lib/{application-plugins → applications/plugins}/spip.js +4 -4
- package/lib/{application-plugins → applications/plugins}/symfony.js +1 -1
- package/lib/{application-plugins → applications/plugins}/typo3.js +2 -2
- package/lib/{application-plugins → applications/plugins}/wave2-common.js +1 -1
- package/lib/{application-plugins → applications/plugins}/wordpress.js +52 -18
- package/lib/{application-providers → applications}/snapshot-cache.js +1 -1
- package/lib/{cms-snapshot-warm.js → applications/snapshot-warm.js} +21 -8
- package/lib/artifacts/access-warnings.js +24 -0
- package/lib/artifacts/applications.js +39 -8
- package/lib/artifacts/component-scope.js +12 -3
- package/lib/artifacts/cve-view.js +8 -5
- package/lib/artifacts/disk-wasm.mjs +3 -0
- package/lib/artifacts/disk.js +188 -0
- package/lib/artifacts/elf-product.js +215 -0
- package/lib/artifacts/enrichment.js +31 -17
- package/lib/artifacts/go-main-identity.js +135 -36
- package/lib/artifacts/go-publisher-advisories.js +4 -3
- package/lib/artifacts/image-products.js +181 -0
- package/lib/artifacts/index.js +36 -13
- package/lib/artifacts/install-version.js +44 -0
- package/lib/artifacts/inventory-scope.js +53 -3
- package/lib/artifacts/pe-product.js +28 -0
- package/lib/artifacts/product-advisories.js +212 -0
- package/lib/artifacts/product-catalog.js +67 -0
- package/lib/artifacts/release-catalogues.js +149 -0
- package/lib/artifacts/release-versions.js +101 -0
- package/lib/artifacts/remediation-report.js +1 -1
- package/lib/artifacts/report-inventory.js +17 -2
- package/lib/artifacts/report-path.js +29 -0
- package/lib/artifacts/report.js +85 -32
- package/lib/artifacts/retire.js +3 -3
- package/lib/artifacts/risk-report.js +12 -8
- package/lib/artifacts/sbom.js +33 -4
- package/lib/artifacts/scan.js +316 -69
- package/lib/artifacts/system-apps.js +98 -0
- package/lib/artifacts/system-maintenance.js +101 -0
- package/lib/artifacts/system-module-updates.js +104 -0
- package/lib/artifacts/system-report.js +232 -0
- package/lib/{airgap-project.js → cache/airgap-project.js} +25 -10
- package/lib/{cache-archive-sqlite.js → cache/archive.js} +6 -5
- package/lib/{cache-db.js → cache/db.js} +1 -1
- package/lib/{dump-format.js → cache/dump-format.js} +2 -2
- package/lib/{json-cache.js → cache/json.js} +1 -1
- package/lib/{proxy-cache.js → cache/proxy-cache.js} +9 -9
- package/lib/{proxy-scope.js → cache/proxy-scope.js} +1 -1
- package/lib/{record-freshness.js → cache/record-freshness.js} +1 -1
- package/lib/{cache-repository.js → cache/repository.js} +1 -1
- package/lib/{resource-cache → cache/resource}/engine.js +23 -16
- package/lib/{resource-cache → cache/resource}/fs-store.js +2 -2
- package/lib/{resource-cache → cache/resource}/sqlite-store.js +3 -3
- package/lib/{resource-cache → cache/resource}/validate.js +20 -5
- package/lib/{sqlite-driver.js → cache/sqlite-driver.js} +7 -5
- package/lib/certs/scan.js +17 -11
- package/lib/cli-collect.js +262 -0
- package/lib/cli-command-routing.js +30 -13
- package/lib/cli-groups.js +1 -1
- package/lib/cli-image.js +158 -47
- package/lib/cli-project-commands.js +10 -10
- package/lib/cli-setup.js +8 -8
- package/lib/cli-watch.js +3 -3
- package/lib/codecs/binary/elf-metadata.js +6 -0
- package/lib/codecs/binary/metadata.js +1 -1
- package/lib/codecs/binary/pe-metadata.js +47 -11
- package/lib/codecs/binary/scan.js +12 -4
- package/lib/codecs/binary.codec.js +1 -1
- package/lib/codecs/composer/platform.js +2 -2
- package/lib/codecs/composer/registry.js +12 -18
- package/lib/codecs/composer.codec.js +6 -5
- package/lib/codecs/go/parse.js +1 -1
- package/lib/codecs/go/registry.js +7 -7
- package/lib/codecs/go.codec.js +2 -2
- package/lib/codecs/gradle/parse.js +1 -1
- package/lib/codecs/gradle/versionless.js +2 -2
- package/lib/codecs/gradle.codec.js +7 -7
- package/lib/codecs/index.js +1 -1
- package/lib/{maven-airgap.js → codecs/maven/airgap.js} +4 -4
- package/lib/{maven-bom.js → codecs/maven/bom.js} +3 -3
- package/lib/codecs/maven/jar-scan.js +4 -4
- package/lib/{maven-license.js → codecs/maven/license.js} +2 -2
- package/lib/{core.js → codecs/maven/pom.js} +22 -11
- package/lib/{maven-reactor.js → codecs/maven/reactor.js} +18 -12
- package/lib/{transitive.js → codecs/maven/transitive.js} +79 -34
- package/lib/{maven-version.js → codecs/maven/version.js} +1 -1
- package/lib/codecs/maven.codec.js +18 -14
- package/lib/codecs/npm/collect.js +55 -8
- package/lib/codecs/npm/manifest-kind.js +16 -0
- package/lib/codecs/npm/parse.js +23 -7
- package/lib/codecs/npm/registry.js +28 -14
- package/lib/codecs/npm.codec.js +5 -5
- package/lib/codecs/nuget/registry.js +7 -7
- package/lib/codecs/nuget.codec.js +4 -4
- package/lib/codecs/pypi/registry.js +7 -7
- package/lib/codecs/pypi.codec.js +4 -4
- package/lib/codecs/recipes.js +2 -2
- package/lib/codecs/ruby/registry.js +7 -7
- package/lib/codecs/ruby.codec.js +2 -2
- package/lib/config.js +1 -1
- package/lib/{attribution.js → findings/attribution.js} +3 -3
- package/lib/findings/cve-descriptions.js +144 -0
- package/lib/{cve-record-coverage.js → findings/cve-record-coverage.js} +46 -41
- package/lib/{diff.js → findings/diff.js} +0 -0
- package/lib/{finding-enrichment.js → findings/enrichment.js} +45 -32
- package/lib/{eu-refs.js → findings/eu-refs.js} +3 -3
- package/lib/{gate.js → findings/gate.js} +1 -1
- package/lib/{malware.js → findings/malware.js} +30 -7
- package/lib/{merge-sources.js → findings/merge.js} +57 -9
- package/lib/{priority.js → findings/priority.js} +3 -3
- package/lib/findings/risk-evidence.js +24 -0
- package/lib/findings/severity.js +16 -0
- package/lib/{finding-summary.js → findings/summary.js} +5 -2
- package/lib/{suppress.js → findings/suppress.js} +2 -2
- package/lib/images/local-docker.js +72 -0
- package/lib/{image-network.js → images/network.js} +26 -16
- package/lib/{image-references.js → images/references.js} +29 -11
- package/lib/{image-registry.js → images/registry.js} +18 -9
- package/lib/{source-image-scan.js → images/source-scan.js} +3 -3
- package/lib/images/temp-roots.js +23 -0
- package/lib/{image-update.js → images/update.js} +3 -3
- package/lib/{dep-record.js → inventory/dep-record.js} +2 -2
- package/lib/{deps-descriptor.js → inventory/deps-descriptor.js} +3 -3
- package/lib/{descriptor-refs.js → inventory/descriptor-refs.js} +1 -1
- package/lib/{embedded.js → inventory/embedded.js} +4 -3
- package/lib/{license-policy.js → inventory/license-policy.js} +2 -2
- package/lib/{manifest-copy.js → inventory/manifest-copy.js} +2 -2
- package/lib/{module-names.js → inventory/module-names.js} +1 -1
- package/lib/{package-versions.js → inventory/package-versions.js} +2 -2
- package/lib/{parallel-walk.js → inventory/parallel-walk.js} +1 -1
- package/lib/{path-filter.js → inventory/path-filter.js} +1 -1
- package/lib/{private-deps.js → inventory/private-deps.js} +1 -1
- package/lib/{project-descriptor.js → inventory/project-descriptor.js} +3 -0
- package/lib/{purl.js → inventory/purl.js} +2 -2
- package/lib/{unmanaged.js → inventory/unmanaged.js} +6 -3
- package/lib/{commercial-support.js → maintenance/commercial-support.js} +5 -5
- package/lib/{outdated.js → maintenance/outdated.js} +20 -20
- package/lib/options-env.js +1 -1
- package/lib/{system-inventory/alpine-tracker.js → providers/alpine/tracker.js} +27 -7
- package/lib/{certfr.js → providers/certfr/enrich.js} +9 -9
- package/lib/{cve-download.js → providers/cveproject/download.js} +56 -36
- package/lib/{cve-legacy-ranges.js → providers/cveproject/legacy-ranges.js} +1 -1
- package/lib/{cve-npm-proxy.js → providers/cveproject/npm-proxy.js} +5 -5
- package/lib/{cve-packages-proxy.js → providers/cveproject/packages-proxy.js} +6 -6
- package/lib/{cve-version-verdict.js → providers/cveproject/version-verdict.js} +2 -2
- package/lib/{system-inventory/current-debian.js → providers/debian/current.js} +6 -6
- package/lib/{system-inventory/historical-debian.js → providers/debian/historical.js} +6 -6
- package/lib/providers/{debian.js → debian/index.js} +1 -0
- package/lib/{application-providers/drupal-advisories.js → providers/drupal/advisories.js} +13 -36
- package/lib/providers/{drupal.js → drupal/index.js} +4 -0
- package/lib/providers/{eol.js → eol/index.js} +1 -1
- package/lib/{epss.js → providers/epss/enrich.js} +16 -13
- package/lib/providers/{epss.js → epss/index.js} +2 -2
- package/lib/{euvd.js → providers/euvd/enrich.js} +13 -13
- package/lib/{system-inventory/freexian-ela.js → providers/freexian/ela.js} +6 -6
- package/lib/providers/{freexian.js → freexian/index.js} +3 -3
- package/lib/{system-inventory/freexian-release-evidence.js → providers/freexian/release-evidence.js} +8 -5
- package/lib/{system-inventory/freexian-tracker.js → providers/freexian/tracker.js} +33 -9
- package/lib/{gcve-feed.js → providers/gcve/feed.js} +4 -4
- package/lib/{gcve.js → providers/gcve/id.js} +1 -1
- package/lib/{gcve-index.js → providers/gcve/local-index.js} +4 -4
- package/lib/{application-providers/github-advisories.js → providers/github/advisories.js} +6 -2
- package/lib/providers/{github.js → github/index.js} +3 -1
- package/lib/{github-publisher-maven.js → providers/github/publisher-maven.js} +1 -1
- package/lib/providers/{go.js → go/index.js} +1 -1
- package/lib/{hash-id.js → providers/hashid/identify.js} +7 -7
- package/lib/providers/{hashid.js → hashid/index.js} +1 -1
- package/lib/providers/index.js +18 -13
- package/lib/{kev.js → providers/kev/enrich.js} +12 -9
- package/lib/{maven-cache.js → providers/maven/cache.js} +3 -3
- package/lib/providers/{maven.js → maven/index.js} +5 -3
- package/lib/{maven-presence.js → providers/maven/presence.js} +5 -5
- package/lib/{maven-repo.js → providers/maven/repo.js} +38 -21
- package/lib/providers/mit-kerberos/index.js +6 -0
- package/lib/{system-inventory/nginx-advisories.js → providers/nginx/advisories.js} +3 -3
- package/lib/providers/{npm.js → npm/index.js} +1 -1
- package/lib/providers/{nuget.js → nuget/index.js} +1 -1
- package/lib/{cpe.js → providers/nvd/cpe.js} +35 -47
- package/lib/{nvd.js → providers/nvd/enrich.js} +41 -40
- package/lib/providers/{nvd.js → nvd/index.js} +18 -4
- package/lib/{nvd-package-ranges.js → providers/nvd/package-ranges.js} +38 -22
- package/lib/{osv-db.js → providers/osv/db.js} +18 -16
- package/lib/providers/{osv.js → osv/index.js} +1 -1
- package/lib/{osv.js → providers/osv/query.js} +150 -80
- package/lib/providers/package-releases/index.js +26 -0
- package/lib/{packagist-audit.js → providers/packagist/audit.js} +31 -11
- package/lib/providers/{packagist.js → packagist/index.js} +1 -1
- package/lib/{proxy-throttle.js → providers/proxy-throttle.js} +17 -9
- package/lib/providers/{pypi.js → pypi/index.js} +1 -1
- package/lib/providers/redhat/bzip2.js +167 -0
- package/lib/providers/redhat/errata.js +75 -0
- package/lib/providers/redhat/index.js +10 -0
- package/lib/providers/redhat/oval.js +70 -0
- package/lib/providers/redhat/unfixed.js +127 -0
- package/lib/{registries.js → providers/registries.js} +4 -4
- package/lib/{retire.js → providers/retire/scan.js} +18 -18
- package/lib/providers/{ruby.js → ruby/index.js} +1 -1
- package/lib/providers/rubysec/advisories.js +177 -0
- package/lib/providers/rubysec/index.js +9 -0
- package/lib/{snyk.js → providers/snyk/client.js} +2 -2
- package/lib/{application-providers/spip-advisories.js → providers/spip/advisories.js} +5 -13
- package/lib/{vigievuln-advisories.js → providers/vigievuln/advisories.js} +4 -4
- package/lib/providers/wolfi/index.js +10 -0
- package/lib/providers/wolfi/secdb.js +47 -0
- package/lib/{application-providers/wordfence-client.js → providers/wordfence/client.js} +4 -4
- package/lib/providers/{wordfence.js → wordfence/index.js} +1 -1
- package/lib/{application-providers/wordfence-projection.js → providers/wordfence/projection.js} +14 -5
- package/lib/{resource-cache/wordfence.js → providers/wordfence/resource-cache.js} +2 -2
- package/lib/{application-providers/wordfence-v3.js → providers/wordfence/v3.js} +4 -5
- package/lib/providers/{wordpress.js → wordpress/index.js} +5 -0
- package/lib/providers/wpvulnerability/assess.js +181 -0
- package/lib/providers/wpvulnerability/index.js +12 -0
- package/lib/{charts.js → reports/charts.js} +25 -18
- package/lib/{csaf-export.js → reports/csaf-export.js} +16 -11
- package/lib/{cve-report.js → reports/cve-report.js} +453 -228
- package/lib/reports/detail.js +55 -0
- package/lib/{i18n.js → reports/i18n.js} +38 -2
- package/lib/{report-integrity.js → reports/integrity.js} +1 -1
- package/lib/{json-export.js → reports/json-export.js} +95 -24
- package/lib/{report-notices.js → reports/notices.js} +11 -6
- package/lib/{sarif-export.js → reports/sarif-export.js} +15 -10
- package/lib/{sbom-export.js → reports/sbom-export.js} +16 -11
- package/lib/{scan-completeness.js → scan/completeness.js} +1 -1
- package/lib/scan/coverage.js +114 -0
- package/lib/{provenance.js → scan/provenance.js} +12 -5
- package/lib/scan/reliability.js +157 -0
- package/lib/{source-health.js → scan/source-health.js} +52 -20
- package/lib/{source-profile.js → scan/source-profile.js} +3 -3
- package/lib/{hosted-proxy.js → service/hosted-proxy.js} +3 -3
- package/lib/{project-client.js → service/project-client.js} +20 -2
- package/lib/source-input.js +58 -0
- package/lib/system-inventory/advisories.js +89 -16
- package/lib/system-inventory/collect.js +33 -10
- package/lib/system-inventory/distribution-sources.js +32 -15
- package/lib/system-inventory/package-applicability.js +51 -0
- package/lib/system-inventory/targeted.js +8 -5
- package/lib/ui.js +11 -0
- package/package.json +49 -2
- package/vigievuln.js +483 -352
- package/lib/cache-archive.js +0 -676
- package/lib/osv-legacy.js +0 -57
- package/lib/risk-evidence.js +0 -18
- package/lib/scan-coverage.js +0 -61
- /package/lib/{application-plugins → applications/plugins}/joomla.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/laravel.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/magento.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/plugin.interface.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/select.js +0 -0
- /package/lib/{advisory-compression.js → cache/advisory-compression.js} +0 -0
- /package/lib/{compression-dictionary.js → cache/compression-dictionary.js} +0 -0
- /package/lib/{cache-directory.js → cache/directory.js} +0 -0
- /package/lib/{cache-policy.js → cache/policy.js} +0 -0
- /package/lib/{resource-cache → cache/resource}/snapshot-projection.js +0 -0
- /package/lib/{cache-startup.js → cache/startup.js} +0 -0
- /package/lib/{ruby-version.js → codecs/ruby/version.js} +0 -0
- /package/lib/{applicability-evidence.js → findings/applicability-evidence.js} +0 -0
- /package/lib/{line-stream.js → inventory/line-stream.js} +0 -0
- /package/lib/{package-metadata.js → inventory/package-metadata.js} +0 -0
- /package/lib/providers/{alpine.js → alpine/index.js} +0 -0
- /package/lib/providers/{certfr.js → certfr/index.js} +0 -0
- /package/lib/{native-cna-identities.js → providers/cveproject/cna-identities.js} +0 -0
- /package/lib/providers/{euvd.js → euvd/index.js} +0 -0
- /package/lib/providers/{gcve.js → gcve/index.js} +0 -0
- /package/lib/providers/{kev.js → kev/index.js} +0 -0
- /package/lib/providers/{nginx.js → nginx/index.js} +0 -0
- /package/lib/{nvd-bulk.js → providers/nvd/bulk.js} +0 -0
- /package/lib/providers/{osvdb.js → osvdb/index.js} +0 -0
- /package/lib/{request-failure.js → providers/request-failure.js} +0 -0
- /package/lib/providers/{retire.js → retire/index.js} +0 -0
- /package/lib/providers/{vigievuln.js → vigievuln/index.js} +0 -0
- /package/lib/{application-providers/wp-checksums.js → providers/wordpress/checksums.js} +0 -0
- /package/lib/{report-time.js → reports/time.js} +0 -0
- /package/lib/{xlsx-export.js → reports/xlsx-export.js} +0 -0
- /package/lib/{diagnostics.js → scan/diagnostics.js} +0 -0
- /package/lib/{account-client.js → service/account-client.js} +0 -0
- /package/lib/{account-session.js → service/account-session.js} +0 -0
- /package/lib/{account-terms.js → service/account-terms.js} +0 -0
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
* @email: pp9ping@gmail.com
|
|
18
18
|
*/
|
|
19
19
|
const fs = require("fs");
|
|
20
|
-
const { foldAbsent } = require("../../private-deps");
|
|
20
|
+
const { foldAbsent } = require("../../inventory/private-deps");
|
|
21
21
|
const path = require("path");
|
|
22
22
|
const os = require("os");
|
|
23
23
|
const pLimit = require("p-limit");
|
|
24
24
|
const { semverCompare, webjarToNpm } = require("./collect");
|
|
25
|
-
const { withPublic, authHeaderFor, normalise } = require("../../registries");
|
|
25
|
+
const { withPublic, authHeaderFor, normalise } = require("../../providers/registries");
|
|
26
26
|
|
|
27
|
-
const CACHE_DIR = path.join(require("../../cache
|
|
27
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
28
28
|
const CACHE_PATH = path.join(CACHE_DIR, "npm-registry-cache.json");
|
|
29
29
|
const CACHE_MAX_AGE_MS = 4 * 3600 * 1000;
|
|
30
30
|
const sourceFetchedAt=new WeakMap();
|
|
31
31
|
|
|
32
32
|
function loadCache() {
|
|
33
|
-
return require('../../json
|
|
33
|
+
return require('../../cache/json').load(CACHE_DIR,'npm-registry',{ meta: { fetchedAt: 0 }, entries: {} });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function saveCache(data) {
|
|
37
|
-
require('../../json
|
|
37
|
+
require('../../cache/json').save(CACHE_DIR,'npm-registry',data);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** Pull a recommended replacement out of a free-form deprecation message. */
|
|
@@ -114,9 +114,9 @@ async function fetchPackument(name, opts = {}) {
|
|
|
114
114
|
const ah = authHeaderFor(base);
|
|
115
115
|
if (ah) headers.Authorization = ah;
|
|
116
116
|
try {
|
|
117
|
-
const
|
|
117
|
+
const publicRegistry = base.name === "public";
|
|
118
118
|
const res = await require("../../providers").getResource("npm", "package", { name },
|
|
119
|
-
{ fetcher, headers, ...(
|
|
119
|
+
{ fetcher, headers, ...(publicRegistry ? { requestTimeoutMs: timeoutMs } : { signal: AbortSignal.timeout(timeoutMs) }),
|
|
120
120
|
...(base.name === "public" ? {} : { urlOverride: url, direct: true }) });
|
|
121
121
|
if (res.ok) {
|
|
122
122
|
const body=await res.json(),fetchedAt=Date.parse(res.headers?.get('x-fad-proxy-fetched-at')||'');
|
|
@@ -158,7 +158,11 @@ async function checkNpmRegistryDeps(resolvedDeps, opts = {}) {
|
|
|
158
158
|
if (!targets.length) return result;
|
|
159
159
|
|
|
160
160
|
const cache = loadCache();
|
|
161
|
-
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache
|
|
161
|
+
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache/policy').fresh(cache.meta.fetchedAt, CACHE_MAX_AGE_MS);
|
|
162
|
+
// Older versions saved transient HTTP/transport failures as ordinary entries.
|
|
163
|
+
for (const [key, entry] of Object.entries(cache.entries || {})) {
|
|
164
|
+
if (entry?.error && !entry.absent && !offline) delete cache.entries[key];
|
|
165
|
+
}
|
|
162
166
|
const previous = !fresh && !offline ? {entries:cache.entries, fetchedAt:cache.meta?.fetchedAt} : null;
|
|
163
167
|
if (!fresh && !offline) cache.entries = {};
|
|
164
168
|
|
|
@@ -182,6 +186,7 @@ async function checkNpmRegistryDeps(resolvedDeps, opts = {}) {
|
|
|
182
186
|
|
|
183
187
|
// Incremental progress — fetching ~hundreds/thousands of packuments at
|
|
184
188
|
// concurrency N would otherwise be total silence for a minute or more.
|
|
189
|
+
const unavailable = [];
|
|
185
190
|
let processed = 0;
|
|
186
191
|
let oldestFetchedAt=Date.now();
|
|
187
192
|
const startedAt = Date.now();
|
|
@@ -205,15 +210,15 @@ async function checkNpmRegistryDeps(resolvedDeps, opts = {}) {
|
|
|
205
210
|
if (status?.absent && !status.present) extracted = { absent: true };
|
|
206
211
|
}
|
|
207
212
|
if (!extracted && offline && !registries.length) {
|
|
208
|
-
const seeded=require('../../package-versions').getVersion('npm',npmName,version);
|
|
213
|
+
const seeded=require('../../inventory/package-versions').getVersion('npm',npmName,version);
|
|
209
214
|
if (seeded) {
|
|
210
215
|
const manifest=JSON.parse(seeded.body);
|
|
211
216
|
const f=packumentToFindings({versions:{[version]:manifest}},{version});
|
|
212
|
-
extracted={deprecated:
|
|
217
|
+
extracted={deprecated:f.deprecated,latest:null,latestDate:null,license:f.license || null};
|
|
213
218
|
}
|
|
214
219
|
}
|
|
215
220
|
if (!extracted) {
|
|
216
|
-
const packument = await fetchPackument(npmName, { offline, registries });
|
|
221
|
+
const packument = await fetchPackument(npmName, { offline, registries, fetcher:opts.fetcher });
|
|
217
222
|
if(packument&&typeof packument==='object')oldestFetchedAt=Math.min(oldestFetchedAt,sourceFetchedAt.get(packument)||Date.now());
|
|
218
223
|
if (packument && !packument.error) {
|
|
219
224
|
const f = packumentToFindings(packument, { version });
|
|
@@ -226,9 +231,13 @@ async function checkNpmRegistryDeps(resolvedDeps, opts = {}) {
|
|
|
226
231
|
cache.entries[key] = extracted;
|
|
227
232
|
} else {
|
|
228
233
|
extracted = { deprecated: null, latest: null, latestDate: null, error: packument?.error || "no data", absent: packument?.absent === true };
|
|
229
|
-
if (!offline) cache.entries[key] = extracted;
|
|
234
|
+
if (!offline && extracted.absent) cache.entries[key] = extracted;
|
|
230
235
|
}
|
|
231
236
|
}
|
|
237
|
+
if (extracted.error && !extracted.absent && (!offline || cache.entries[key]?.error)) {
|
|
238
|
+
unavailable.push(`${key} (${extracted.error})`);
|
|
239
|
+
extracted = previous?.entries?.[key] || extracted;
|
|
240
|
+
}
|
|
232
241
|
processed++;
|
|
233
242
|
printProgress();
|
|
234
243
|
// Absent from EVERY configured registry: an internal package. Only a definitive
|
|
@@ -250,17 +259,22 @@ async function checkNpmRegistryDeps(resolvedDeps, opts = {}) {
|
|
|
250
259
|
}
|
|
251
260
|
if (extracted.license) result.licensed.push({ dep, licenses: extracted.license, source: "npm" });
|
|
252
261
|
})));
|
|
262
|
+
if (unavailable.length) {
|
|
263
|
+
opts.onWarning?.({type:'source-unavailable', source:'npm', count:unavailable.length,
|
|
264
|
+
message:`npm registry metadata unavailable for ${unavailable.length} package version(s). Deprecation and maintenance checks are incomplete.`,
|
|
265
|
+
items:unavailable.sort()});
|
|
266
|
+
}
|
|
253
267
|
if (liveCount) printProgress(true);
|
|
254
268
|
|
|
255
269
|
if (!offline) {
|
|
256
270
|
if (!fresh) cache.meta = { fetchedAt: oldestFetchedAt };
|
|
257
|
-
require('../../cache
|
|
271
|
+
require('../../cache/policy').preserveEntries(cache, previous);
|
|
258
272
|
saveCache(cache);
|
|
259
273
|
}
|
|
260
274
|
|
|
261
275
|
result.deprecated.sort((a, b) => a.dep.artifactId.localeCompare(b.dep.artifactId));
|
|
262
276
|
result.outdated.sort((a, b) => a.dep.artifactId.localeCompare(b.dep.artifactId));
|
|
263
|
-
if (liveCount && !offline && !onProgress) console.log(` npm registry: ${result.deprecated.length} deprecated, ${result.outdated.length} outdated`);
|
|
277
|
+
if (liveCount && !offline && !onProgress) console.log(` npm registry: ${result.deprecated.length} deprecated, ${result.outdated.length} outdated${opts.systemMaintenance ? " in registry checks (includes transitive dependencies)" : ""}`);
|
|
264
278
|
return result;
|
|
265
279
|
}
|
|
266
280
|
|
package/lib/codecs/npm.codec.js
CHANGED
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* @email: pp9ping@gmail.com
|
|
14
14
|
*/
|
|
15
15
|
const { collectNpmDeps, hasJsManifests } = require("./npm/collect");
|
|
16
|
-
const { coordKeyFor } = require("../dep-record");
|
|
16
|
+
const { coordKeyFor } = require("../inventory/dep-record");
|
|
17
17
|
|
|
18
18
|
// Scanner natif : retire.js (JS vendored sans lockfile). scan(deps,opts) → {matches,meta}.
|
|
19
19
|
const retireScanner = {
|
|
20
20
|
id: "retire",
|
|
21
21
|
kind: "vendored", // résultats → chapitre vendored-JS (séparé des CVE)
|
|
22
22
|
async scan(_deps, opts = {}) {
|
|
23
|
-
const { scanWithRetireFull } = require("../retire");
|
|
23
|
+
const { scanWithRetireFull } = require("../providers/retire/scan");
|
|
24
24
|
const { matches, inventory, error } = await scanWithRetireFull(opts.src, { verbose: opts.verbose, force: !!opts.retireRefresh, offline: !!opts.offline, excludePath: opts.excludePath, defaultExcludes: opts.defaultExcludes });
|
|
25
25
|
return { matches, meta: { inventory, error } };
|
|
26
26
|
},
|
|
@@ -36,9 +36,9 @@ const base = {
|
|
|
36
36
|
async checkRegistry(deps, opts = {}) {
|
|
37
37
|
const { checkNpmRegistryDeps } = require("./npm/registry");
|
|
38
38
|
const r = await checkNpmRegistryDeps(deps, opts);
|
|
39
|
-
return
|
|
39
|
+
return r;
|
|
40
40
|
},
|
|
41
|
-
resolveEolProduct(d) { return require("../outdated").findEolProduct(d); },
|
|
41
|
+
resolveEolProduct(d) { return require("../maintenance/outdated").findEolProduct(d); },
|
|
42
42
|
nativeScanners: [retireScanner],
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ module.exports = {
|
|
|
52
52
|
// Parallel manifest discovery (concurrent readdir) — much faster than the
|
|
53
53
|
// serial walk on a high-latency filesystem; parsing then runs synchronously.
|
|
54
54
|
const { findJsManifestsAsync, DEFAULT_JS_SKIP_DIRS } = require("./npm/parse");
|
|
55
|
-
const { makeDirFilter } = require("../path-filter");
|
|
55
|
+
const { makeDirFilter } = require("../inventory/path-filter");
|
|
56
56
|
const skipDir = makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: DEFAULT_JS_SKIP_DIRS, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
57
57
|
const manifestGroups = await findJsManifestsAsync(dir, { skipDir });
|
|
58
58
|
const deps = collectNpmDeps(dir, { ...opts, manifestGroups });
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
* @email: pp9ping@gmail.com
|
|
12
12
|
*/
|
|
13
13
|
const fs = require("fs");
|
|
14
|
-
const { foldAbsent } = require("../../private-deps");
|
|
14
|
+
const { foldAbsent } = require("../../inventory/private-deps");
|
|
15
15
|
const path = require("path");
|
|
16
16
|
const os = require("os");
|
|
17
17
|
let pLimit; try { pLimit = require("p-limit"); } catch { pLimit = () => (fn) => fn(); }
|
|
18
|
-
const { withPublic, authHeaderFor, normalise } = require("../../registries");
|
|
18
|
+
const { withPublic, authHeaderFor, normalise } = require("../../providers/registries");
|
|
19
19
|
|
|
20
|
-
const CACHE_DIR = path.join(require("../../cache
|
|
20
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
21
21
|
const CACHE_PATH = path.join(CACHE_DIR, "nuget-cache.json");
|
|
22
22
|
const CACHE_MAX_AGE_MS = 4 * 3600 * 1000;
|
|
23
23
|
|
|
24
|
-
function loadCache() { return require('../../json
|
|
25
|
-
function saveCache(d) { require('../../json
|
|
24
|
+
function loadCache() { return require('../../cache/json').load(CACHE_DIR,'nuget',{ entries: {}, meta: {} }); }
|
|
25
|
+
function saveCache(d) { require('../../cache/json').save(CACHE_DIR,'nuget',d); }
|
|
26
26
|
function isStable(v) { return /^\d+(\.\d+)*$/.test(String(v || "")); }
|
|
27
27
|
function cmp(a, b) {
|
|
28
28
|
const pa = String(a).split(/[.\-+]/).map(n => parseInt(n, 10) || 0);
|
|
@@ -135,7 +135,7 @@ async function checkNugetRegistryDeps(deps, opts = {}) {
|
|
|
135
135
|
const result = { deprecated: [], outdated: [], licensed: [], private: [] };
|
|
136
136
|
if (!targets.length) return result;
|
|
137
137
|
const cache = loadCache();
|
|
138
|
-
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache
|
|
138
|
+
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache/policy').fresh(cache.meta.fetchedAt, CACHE_MAX_AGE_MS);
|
|
139
139
|
const previous = !fresh && !offline ? {entries:cache.entries, fetchedAt:cache.meta?.fetchedAt} : null;
|
|
140
140
|
if (!fresh && !offline) cache.entries = {};
|
|
141
141
|
const limit = pLimit(concurrency);
|
|
@@ -169,7 +169,7 @@ async function checkNugetRegistryDeps(deps, opts = {}) {
|
|
|
169
169
|
// fresh to the next ONLINE run and skip its refetch.
|
|
170
170
|
if (!offline) {
|
|
171
171
|
if (!fresh) cache.meta = { fetchedAt: Date.now() };
|
|
172
|
-
require('../../cache
|
|
172
|
+
require('../../cache/policy').preserveEntries(cache, previous);
|
|
173
173
|
saveCache(cache);
|
|
174
174
|
}
|
|
175
175
|
return result;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
const fs = require("fs");
|
|
14
14
|
const path = require("path");
|
|
15
|
-
const { makeDepRecord, coordKeyFor } = require("../dep-record");
|
|
15
|
+
const { makeDepRecord, coordKeyFor } = require("../inventory/dep-record");
|
|
16
16
|
const N = require("./nuget/parse");
|
|
17
17
|
const { mergeVersionEvidence } = require("./version-evidence");
|
|
18
18
|
|
|
@@ -37,7 +37,7 @@ function findNugetDirs(dir, skipDir = (child, name) => SKIP.has(name)) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function dirFilter(dir, opts) {
|
|
40
|
-
return require("../path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
40
|
+
return require("../inventory/path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
module.exports = {
|
|
@@ -112,7 +112,7 @@ module.exports = {
|
|
|
112
112
|
try { const { deps } = await N.parsePackagesConfig(fp); for (const d of deps) { add(d, fp); pinned++; } } catch { /* ignore */ }
|
|
113
113
|
}
|
|
114
114
|
if (g.csprojs.length || g.files.includes("packages.config")) {
|
|
115
|
-
warnings.push({ type: "no-lockfile", manifestPath: g.dir, message: `no packages.lock.json — best-effort: ${pinned} pinned, ${skipped} floating/unresolved skipped (enable RestorePackagesWithLockFile)` });
|
|
115
|
+
if (pinned + skipped > 0) warnings.push({ type: "no-lockfile", manifestPath: g.dir, message: `no packages.lock.json — best-effort: ${pinned} pinned, ${skipped} floating/unresolved skipped (enable RestorePackagesWithLockFile)` });
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
return { deps: out, warnings, parsedManifests };
|
|
@@ -126,7 +126,7 @@ module.exports = {
|
|
|
126
126
|
const { checkNugetRegistryDeps } = require("./nuget/registry");
|
|
127
127
|
return checkNugetRegistryDeps(deps, opts);
|
|
128
128
|
},
|
|
129
|
-
resolveEolProduct(d) { return require("../outdated").findEolProduct(d); },
|
|
129
|
+
resolveEolProduct(d) { return require("../maintenance/outdated").findEolProduct(d); },
|
|
130
130
|
recipe: require("./recipes").nuget,
|
|
131
131
|
nativeScanners: [],
|
|
132
132
|
};
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
* @email: pp9ping@gmail.com
|
|
12
12
|
*/
|
|
13
13
|
const fs = require("fs");
|
|
14
|
-
const { foldAbsent } = require("../../private-deps");
|
|
14
|
+
const { foldAbsent } = require("../../inventory/private-deps");
|
|
15
15
|
const path = require("path");
|
|
16
16
|
const os = require("os");
|
|
17
17
|
let pLimit; try { pLimit = require("p-limit"); } catch { pLimit = () => (fn) => fn(); }
|
|
18
|
-
const { withPublic, authHeaderFor, normalise } = require("../../registries");
|
|
18
|
+
const { withPublic, authHeaderFor, normalise } = require("../../providers/registries");
|
|
19
19
|
|
|
20
|
-
const CACHE_DIR = path.join(require("../../cache
|
|
20
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
21
21
|
const CACHE_PATH = path.join(CACHE_DIR, "pypi-cache.json");
|
|
22
22
|
const CACHE_MAX_AGE_MS = 4 * 3600 * 1000;
|
|
23
23
|
|
|
24
|
-
function loadCache() { return require('../../json
|
|
25
|
-
function saveCache(d) { require('../../json
|
|
24
|
+
function loadCache() { return require('../../cache/json').load(CACHE_DIR,'pypi',{ entries: {}, meta: {} }); }
|
|
25
|
+
function saveCache(d) { require('../../cache/json').save(CACHE_DIR,'pypi',d); }
|
|
26
26
|
function cmp(a, b) {
|
|
27
27
|
const pa = String(a).split(/[.\-+]/).map(n => parseInt(n, 10) || 0);
|
|
28
28
|
const pb = String(b).split(/[.\-+]/).map(n => parseInt(n, 10) || 0);
|
|
@@ -83,7 +83,7 @@ async function checkPypiRegistryDeps(deps, opts = {}) {
|
|
|
83
83
|
const result = { deprecated: [], outdated: [], licensed: [], private: [] };
|
|
84
84
|
if (!targets.length) return result;
|
|
85
85
|
const cache = loadCache();
|
|
86
|
-
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache
|
|
86
|
+
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache/policy').fresh(cache.meta.fetchedAt, CACHE_MAX_AGE_MS);
|
|
87
87
|
const previous = !fresh && !offline ? {entries:cache.entries, fetchedAt:cache.meta?.fetchedAt} : null;
|
|
88
88
|
if (!fresh && !offline) cache.entries = {};
|
|
89
89
|
const limit = pLimit(concurrency);
|
|
@@ -119,7 +119,7 @@ async function checkPypiRegistryDeps(deps, opts = {}) {
|
|
|
119
119
|
// fresh to the next ONLINE run and skip its refetch.
|
|
120
120
|
if (!offline) {
|
|
121
121
|
if (!fresh) cache.meta = { fetchedAt: Date.now() };
|
|
122
|
-
require('../../cache
|
|
122
|
+
require('../../cache/policy').preserveEntries(cache, previous);
|
|
123
123
|
saveCache(cache);
|
|
124
124
|
}
|
|
125
125
|
return result;
|
package/lib/codecs/pypi.codec.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
const fs = require("fs");
|
|
13
13
|
const path = require("path");
|
|
14
|
-
const { makeDepRecord, coordKeyFor } = require("../dep-record");
|
|
14
|
+
const { makeDepRecord, coordKeyFor } = require("../inventory/dep-record");
|
|
15
15
|
const P = require("./pypi/parse");
|
|
16
16
|
|
|
17
17
|
const SKIP = new Set([".git", ".idea", ".vscode", "node_modules", "dist", "build", "out", "target", "__pycache__", ".venv", "venv", ".tox", ".mypy_cache", "site-packages"]);
|
|
@@ -45,7 +45,7 @@ function findPyDirs(dir, skipDir = (child, name) => SKIP.has(name)) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
function pyDirFilter(dir, opts) {
|
|
48
|
-
return require("../path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
48
|
+
return require("../inventory/path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
module.exports = {
|
|
@@ -117,7 +117,7 @@ module.exports = {
|
|
|
117
117
|
if (sources.length) {
|
|
118
118
|
const pinned = out.size - before;
|
|
119
119
|
const shownSrc = sources.length > 4 ? `${sources.slice(0, 4).join(" + ")} + ${sources.length - 4} more` : sources.join(" + ");
|
|
120
|
-
warnings.push({ type: "no-lockfile", manifestPath: g.dir, message: `no lockfile (${shownSrc}) — best-effort: ${pinned} pinned, ${skipped} range(s) skipped` });
|
|
120
|
+
if (pinned + skipped > 0) warnings.push({ type: "no-lockfile", manifestPath: g.dir, message: `no lockfile (${shownSrc}) — best-effort: ${pinned} pinned, ${skipped} range(s) skipped` });
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return { deps: out, warnings, parsedManifests };
|
|
@@ -131,7 +131,7 @@ module.exports = {
|
|
|
131
131
|
const { checkPypiRegistryDeps } = require("./pypi/registry");
|
|
132
132
|
return checkPypiRegistryDeps(deps, opts);
|
|
133
133
|
},
|
|
134
|
-
resolveEolProduct(d) { return require("../outdated").findEolProduct(d); },
|
|
134
|
+
resolveEolProduct(d) { return require("../maintenance/outdated").findEolProduct(d); },
|
|
135
135
|
recipe: require("./recipes").pypi,
|
|
136
136
|
nativeScanners: [],
|
|
137
137
|
};
|
package/lib/codecs/recipes.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* lib/codecs/recipes.js — recettes de fix par écosystème pour le report.
|
|
3
3
|
*
|
|
4
|
-
* Extrait de lib/cve-report.js (ECO_RECIPE + snippet helpers). Clés = id de codec
|
|
4
|
+
* Extrait de lib/reports/cve-report.js (ECO_RECIPE + snippet helpers). Clés = id de codec
|
|
5
5
|
* (== ecosystemType). Chaque recette : { label, pinSection, pinIntro(cnt),
|
|
6
6
|
* snippet(items), directSection }. `items` = [{ groupId, artifactId, fixVersion }].
|
|
7
7
|
*
|
|
8
8
|
* @author: N.BRAUN
|
|
9
9
|
* @email: pp9ping@gmail.com
|
|
10
10
|
*/
|
|
11
|
-
const { makeT } = require("../i18n");
|
|
11
|
+
const { makeT } = require("../reports/i18n");
|
|
12
12
|
// Default translator: English, which still INTERPOLATES {n}. An identity function would
|
|
13
13
|
// leave the placeholder in the text, so `pinIntro(3)` must not fall back to `x => x`.
|
|
14
14
|
const EN = makeT("en");
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
* @email: pp9ping@gmail.com
|
|
9
9
|
*/
|
|
10
10
|
const fs = require("fs");
|
|
11
|
-
const { foldAbsent } = require("../../private-deps");
|
|
11
|
+
const { foldAbsent } = require("../../inventory/private-deps");
|
|
12
12
|
const path = require("path");
|
|
13
13
|
const os = require("os");
|
|
14
14
|
let pLimit; try { pLimit = require("p-limit"); } catch { pLimit = () => (fn) => fn(); }
|
|
15
|
-
const { withPublic, authHeaderFor, normalise } = require("../../registries");
|
|
15
|
+
const { withPublic, authHeaderFor, normalise } = require("../../providers/registries");
|
|
16
16
|
|
|
17
|
-
const CACHE_DIR = path.join(require("../../cache
|
|
17
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
18
18
|
const CACHE_PATH = path.join(CACHE_DIR, "rubygems-cache.json");
|
|
19
19
|
const CACHE_MAX_AGE_MS = 4 * 3600 * 1000;
|
|
20
20
|
|
|
21
|
-
function loadCache() { return require('../../json
|
|
22
|
-
function saveCache(d) { require('../../json
|
|
21
|
+
function loadCache() { return require('../../cache/json').load(CACHE_DIR,'rubygems',{ entries: {}, meta: {} }); }
|
|
22
|
+
function saveCache(d) { require('../../cache/json').save(CACHE_DIR,'rubygems',d); }
|
|
23
23
|
function isStable(v) { return /^\d+(\.\d+)*$/.test(String(v || "")); }
|
|
24
24
|
function cmp(a, b) {
|
|
25
25
|
const pa = String(a).split(/[.\-+]/).map(n => parseInt(n, 10) || 0);
|
|
@@ -61,7 +61,7 @@ async function checkRubyRegistryDeps(deps, opts = {}) {
|
|
|
61
61
|
const result = { deprecated: [], outdated: [], licensed: [], private: [] };
|
|
62
62
|
if (!targets.length) return result;
|
|
63
63
|
const cache = loadCache();
|
|
64
|
-
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache
|
|
64
|
+
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache/policy').fresh(cache.meta.fetchedAt, CACHE_MAX_AGE_MS);
|
|
65
65
|
const previous = !fresh && !offline ? {entries:cache.entries, fetchedAt:cache.meta?.fetchedAt} : null;
|
|
66
66
|
if (!fresh && !offline) cache.entries = {};
|
|
67
67
|
const limit = pLimit(concurrency);
|
|
@@ -84,7 +84,7 @@ async function checkRubyRegistryDeps(deps, opts = {}) {
|
|
|
84
84
|
})));
|
|
85
85
|
if (!offline) {
|
|
86
86
|
if (!fresh) cache.meta = { fetchedAt: Date.now() };
|
|
87
|
-
require('../../cache
|
|
87
|
+
require('../../cache/policy').preserveEntries(cache, previous);
|
|
88
88
|
saveCache(cache);
|
|
89
89
|
}
|
|
90
90
|
return result;
|
package/lib/codecs/ruby.codec.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
const fs = require("fs");
|
|
11
11
|
const path = require("path");
|
|
12
|
-
const { makeDepRecord, coordKeyFor } = require("../dep-record");
|
|
12
|
+
const { makeDepRecord, coordKeyFor } = require("../inventory/dep-record");
|
|
13
13
|
const R = require("./ruby/parse");
|
|
14
14
|
const { mergeVersionEvidence } = require("./version-evidence");
|
|
15
15
|
|
|
@@ -30,7 +30,7 @@ function findGemfileLocks(dir, skipDir = (child, name) => SKIP.has(name)) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function dirFilter(dir, opts) {
|
|
33
|
-
return require("../path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
33
|
+
return require("../inventory/path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
module.exports = {
|
package/lib/config.js
CHANGED
|
@@ -11,7 +11,7 @@ const fs = require("fs");
|
|
|
11
11
|
const path = require("path");
|
|
12
12
|
const os = require("os");
|
|
13
13
|
|
|
14
|
-
const CONFIG_DIR = path.join(require("./cache
|
|
14
|
+
const CONFIG_DIR = path.join(require("./cache/directory").getCacheDir());
|
|
15
15
|
const CONFIG_PATH = path.join(CONFIG_DIR, "config.json");
|
|
16
16
|
|
|
17
17
|
function load() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/attribution.js — attribute each MATCH to the manifest/module that actually
|
|
2
|
+
* lib/findings/attribution.js — attribute each MATCH to the manifest/module that actually
|
|
3
3
|
* resolves the version it was matched on.
|
|
4
4
|
*
|
|
5
5
|
* A depRecord is COORD-WIDE: the collectors merge every occurrence of a g:a across the
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
* the very pom that pins the fixed version.
|
|
20
20
|
*
|
|
21
21
|
* Two provenance sources, checked per match:
|
|
22
|
-
* - `maskedVersions[]` (lib/maven
|
|
22
|
+
* - `maskedVersions[]` (lib/codecs/maven/reactor) — the version is a transitive of ONE
|
|
23
23
|
* module: re-stamp scope/via/depth and file it under that module.
|
|
24
|
-
* - `versionPaths{}` (lib/dep-record, maintained by the collectors) — the version is
|
|
24
|
+
* - `versionPaths{}` (lib/inventory/dep-record, maintained by the collectors) — the version is
|
|
25
25
|
* DECLARED in a known subset of manifests: narrow the match to that subset.
|
|
26
26
|
* A version with neither (e.g. a global-pass transitive) is left untouched.
|
|
27
27
|
*
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const {cveIds, advisoryDescription, usableText} = require('./cve-record-coverage');
|
|
3
|
+
const {createCacheRepository} = require('../cache/repository');
|
|
4
|
+
const {getCacheDir} = require('../cache/directory');
|
|
5
|
+
const {openAdvisoryStore} = require('../advisories/store');
|
|
6
|
+
|
|
7
|
+
function debianRecord(html,id) {
|
|
8
|
+
const {parseDocument,DomUtils}=require('htmlparser2');
|
|
9
|
+
const rows=DomUtils.findAll(node=>node.name==='tr',parseDocument(html).children);
|
|
10
|
+
const fields=new Map(rows.map(row=>row.children.filter(node=>node.name==='td').map(node=>DomUtils.textContent(node).trim())));
|
|
11
|
+
if(fields.get('Name')!==id)return null;
|
|
12
|
+
const source='Debian Security Tracker',url='https://security-tracker.debian.org/tracker/'+id;
|
|
13
|
+
const description=usableText(fields.get('Description'));
|
|
14
|
+
if(description)return {source,url,description};
|
|
15
|
+
const references=rows.flatMap(row=>{
|
|
16
|
+
const cells=row.children.filter(node=>node.name==='td');
|
|
17
|
+
if(!cells[1] || !['Debian Bugs','References'].includes(DomUtils.textContent(cells[0]).trim()))return [];
|
|
18
|
+
return DomUtils.findAll(node=>node.name==='a',cells[1].children).map(a=>DomUtils.textContent(a).trim()).filter(Boolean);
|
|
19
|
+
});
|
|
20
|
+
// Some entries precede the public CNA record. Report exactly which Debian
|
|
21
|
+
// bulletins or bug reports document them, without inferring technical impact.
|
|
22
|
+
if(references.length)return {source,url,references,description:`${source} · ${id} · ${references.map(ref=>/^\d+$/.test(ref)?'Debian #'+ref:ref).join(', ')}`,kind:'advisory-references'};
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// A single release announcement can cover several CVEs in one bullet.
|
|
27
|
+
function kerberosBulletins(html,url) {
|
|
28
|
+
const {parseDocument,DomUtils}=require('htmlparser2');
|
|
29
|
+
const pre=DomUtils.findOne(node=>node.name==='pre',parseDocument(html).children);
|
|
30
|
+
const records={};
|
|
31
|
+
for (const paragraph of (pre ? DomUtils.textContent(pre) : '').split(/\n\s*\n/)) {
|
|
32
|
+
if (!/^\s*\*\s+/.test(paragraph)) continue;
|
|
33
|
+
const ids=[...new Set(paragraph.match(/CVE-\d{4}-\d{4,}/g) || [])];
|
|
34
|
+
const text=paragraph.replace(/^\s*\*\s+/,'').replace(/\[CVE-\d{4}-\d{4,}\]/g,'').replace(/\s+/g,' ').replace(/\s+([.,])/g,'$1').trim();
|
|
35
|
+
if (!text) continue;
|
|
36
|
+
for (const id of ids) records[id]={source:'MIT Kerberos',url,description:text,...(ids.length>1 ? {kind:'grouped-advisory',linkedIds:ids} : {})};
|
|
37
|
+
}
|
|
38
|
+
return records;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function completeCveDescriptions(matches,options={}) {
|
|
42
|
+
const enabled=source=>options[source]!==false && (!Array.isArray(options.enrich) || options.enrich.includes(source));
|
|
43
|
+
const descriptionsEnabled=enabled('nvd') || enabled('euvd');
|
|
44
|
+
const groups=new Map(),known=new Map();
|
|
45
|
+
for(const match of matches){
|
|
46
|
+
const c=match.cve,ids=cveIds(c);
|
|
47
|
+
for(const id of ids){
|
|
48
|
+
if(!groups.has(id))groups.set(id,[]);
|
|
49
|
+
groups.get(id).push(match);
|
|
50
|
+
const per=c.cveEvidence?.find(r=>r.id===id),nvd=c.nvdEvidence?.records?.find(r=>r.id===id);
|
|
51
|
+
const euvd=per?.euvdDetails || (ids.length===1 && c.euvdDetails);
|
|
52
|
+
const entry=[{source:'nvd',description:nvd?.description},{source:'euvd',description:euvd?.description},per?.descriptionEvidence,
|
|
53
|
+
{source:match.source,url:c.advisorySource,description:advisoryDescription(c,id,ids)}].find(e=>usableText(e?.description));
|
|
54
|
+
if(entry && !known.has(id))known.set(id,entry);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const cacheDir=options.cacheDir||getCacheDir();
|
|
58
|
+
const announcements=new Map();
|
|
59
|
+
let repo,store;
|
|
60
|
+
try{
|
|
61
|
+
for(const [id,rows] of groups){
|
|
62
|
+
// Distribution advisories often have a description but no CVSS. Look up
|
|
63
|
+
// the exact CVE independently of description coverage.
|
|
64
|
+
const needsRisk=rows.filter(({cve})=>!(cve.id===id && cve.score!=null && cve.severity && cve.severity!=='UNKNOWN') &&
|
|
65
|
+
!cve.nvdEvidence?.records?.some(r=>r.id===id && r.score!=null) &&
|
|
66
|
+
!cve.cveEvidence?.some(r=>r.id===id && r.euvdDetails?.score!=null));
|
|
67
|
+
if(needsRisk.length && !options.disableCveProject && (!options.nativeSources || options.nativeSources.includes('cveproject'))){
|
|
68
|
+
store ||= openAdvisoryStore({cacheDir});
|
|
69
|
+
const doc=store.getRecord('cveproject',id)?.document;
|
|
70
|
+
if(doc?.cveMetadata?.cveId===id && doc.cveMetadata.state==='PUBLISHED'){
|
|
71
|
+
const risk=require('../advisories/native-package-match').metric([doc.containers?.cna,...(doc.containers?.adp || [])].filter(Boolean));
|
|
72
|
+
if(risk.score!=null)for(const {cve} of needsRisk){
|
|
73
|
+
const entries=cve.cveEvidence ||= [];
|
|
74
|
+
let entry=entries.find(r=>r.id===id);
|
|
75
|
+
if(!entry){entry={id};entries.push(entry);}
|
|
76
|
+
const evidence={source:'cveproject',id,relationship:'identity'};
|
|
77
|
+
entry.cveProjectMetric={...risk,riskEvidence:evidence};
|
|
78
|
+
if(cve.id===id && cve.score==null && (!cve.severity || cve.severity==='UNKNOWN'))
|
|
79
|
+
Object.assign(cve,risk,{severitySource:'cveproject',scoreSource:'cveproject',riskEvidence:evidence});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Existing exact local records remain usable when remote enrichment is disabled.
|
|
84
|
+
const missing=rows.filter(({cve})=>!advisoryDescription(cve,id) && !usableText(cve.nvdEvidence?.records?.find(r=>r.id===id)?.description,
|
|
85
|
+
cve.cveEvidence?.find(r=>r.id===id)?.euvdDetails?.description,cve.cveEvidence?.find(r=>r.id===id)?.descriptionEvidence?.description));
|
|
86
|
+
if(!missing.length)continue;
|
|
87
|
+
let text=known.get(id);
|
|
88
|
+
if(!text && !options.disableCveProject && (!options.nativeSources || options.nativeSources.includes('cveproject'))){
|
|
89
|
+
store ||= openAdvisoryStore({cacheDir});
|
|
90
|
+
const doc=store.getRecord('cveproject',id)?.document;
|
|
91
|
+
const cna=doc?.containers?.cna;
|
|
92
|
+
if(doc?.cveMetadata?.cveId===id && doc.cveMetadata.state==='PUBLISHED'){
|
|
93
|
+
const description=usableText(cna?.descriptions?.find(d=>/^en(?:-|$)/i.test(d.lang))?.value,cna?.title);
|
|
94
|
+
if(description)text={source:'cveproject',url:'https://www.cve.org/CVERecord?id='+id,description};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if(!text && descriptionsEnabled && options.distroAdvisories!==false) {
|
|
98
|
+
const references=rows.flatMap(m=>[...(m.cve.osvRefs || []),...(m.cve.references || [])]);
|
|
99
|
+
for(const ref of references) {
|
|
100
|
+
const url=typeof ref==='string' ? ref : ref?.url;
|
|
101
|
+
const parts=/^https:\/\/mailman\.mit\.edu\/pipermail\/kerberos-announce\/(\d{4}q[1-4])\/(\d{6})\.html$/.exec(url);
|
|
102
|
+
if(!parts) continue;
|
|
103
|
+
if(!announcements.has(url)) {
|
|
104
|
+
repo ||= createCacheRepository(cacheDir);
|
|
105
|
+
let records=repo.get('mit-kerberos-announcement',url)?.value;
|
|
106
|
+
if(!records && !options.offline) {
|
|
107
|
+
try {
|
|
108
|
+
const r=await require('../providers').getResource('mit-kerberos','announcement',{quarter:parts[1],message:parts[2]},{fetcher:options.fetcher,signal:AbortSignal.timeout(15000)});
|
|
109
|
+
if(r.ok) {
|
|
110
|
+
records=kerberosBulletins(await r.text(),url);
|
|
111
|
+
if(Object.keys(records).length)repo.put('mit-kerberos-announcement',url,records);
|
|
112
|
+
}
|
|
113
|
+
} catch { /* Keep looking for corroborating descriptions. */ }
|
|
114
|
+
}
|
|
115
|
+
announcements.set(url,records || {});
|
|
116
|
+
}
|
|
117
|
+
text=announcements.get(url)[id];
|
|
118
|
+
if(text)break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if(!text && descriptionsEnabled && options.distroAdvisories!==false && rows.some(m=>m.dep?.distribution?.id==='debian' || m.dep?.manager==='dpkg' && m.cve.id==='DEBIAN-'+id)){
|
|
122
|
+
repo ||= createCacheRepository(cacheDir);
|
|
123
|
+
text=repo.get('debian-cve-description',id)?.value;
|
|
124
|
+
const providers=require('../providers');
|
|
125
|
+
if(!text && !options.offline && !providers.hasProxyRoute()){
|
|
126
|
+
try{
|
|
127
|
+
const r=await providers.getResource('debian','cve',{id},{fetcher:options.fetcher,signal:AbortSignal.timeout(15000)});
|
|
128
|
+
if(r.ok)text=debianRecord(await r.text(),id);
|
|
129
|
+
if(text)repo.put('debian-cve-description',id,text);
|
|
130
|
+
}catch{ /* The missing detail remains visible in record coverage. */ }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if(!text)continue;
|
|
134
|
+
for(const {cve} of missing){
|
|
135
|
+
const entries=cve.cveEvidence ||= [];
|
|
136
|
+
let entry=entries.find(row=>row.id===id);
|
|
137
|
+
if(!entry){entry={id};entries.push(entry);}
|
|
138
|
+
entry.descriptionEvidence={...text};
|
|
139
|
+
if(cveIds(cve).length===1 && !usableText(cve.description))cve.description=text.description;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}finally{store?.close();}
|
|
143
|
+
}
|
|
144
|
+
module.exports={completeCveDescriptions,debianRecord,kerberosBulletins};
|