owasp-depscan 5.1.4__tar.gz → 5.1.5__tar.gz

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.

Potentially problematic release.


This version of owasp-depscan might be problematic. Click here for more details.

Files changed (89) hide show
  1. {owasp-depscan-5.1.4/owasp_depscan.egg-info → owasp-depscan-5.1.5}/PKG-INFO +41 -33
  2. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/README.md +37 -31
  3. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/cli.py +12 -94
  4. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/analysis.py +325 -169
  5. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/config.py +113 -5
  6. owasp-depscan-5.1.5/depscan/lib/csaf.py +1858 -0
  7. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/logger.py +0 -1
  8. owasp-depscan-5.1.5/depscan/lib/orasclient.py +127 -0
  9. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5/owasp_depscan.egg-info}/PKG-INFO +41 -33
  10. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/owasp_depscan.egg-info/SOURCES.txt +1 -0
  11. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/owasp_depscan.egg-info/requires.txt +3 -1
  12. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/pyproject.toml +4 -2
  13. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_analysis.py +63 -0
  14. owasp-depscan-5.1.5/test/test_csaf.py +1052 -0
  15. owasp-depscan-5.1.4/depscan/lib/csaf.py +0 -1982
  16. owasp-depscan-5.1.4/test/test_csaf.py +0 -1547
  17. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/LICENSE +0 -0
  18. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/MANIFEST.in +0 -0
  19. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/__init__.py +0 -0
  20. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/__init__.py +0 -0
  21. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/audit.py +0 -0
  22. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/bom.py +0 -0
  23. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/explainer.py +0 -0
  24. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/github.py +0 -0
  25. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/license.py +0 -0
  26. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/normalize.py +0 -0
  27. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/pkg_query.py +0 -0
  28. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/depscan/lib/utils.py +0 -0
  29. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/owasp_depscan.egg-info/dependency_links.txt +0 -0
  30. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/owasp_depscan.egg-info/entry_points.txt +0 -0
  31. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/owasp_depscan.egg-info/top_level.txt +0 -0
  32. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/setup.cfg +0 -0
  33. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_bom.py +0 -0
  34. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_explainer.py +0 -0
  35. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_github.py +0 -0
  36. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_license.py +0 -0
  37. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_norm.py +0 -0
  38. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_pkg_query.py +0 -0
  39. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/test/test_utils.py +0 -0
  40. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/__init__.py +0 -0
  41. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_data/fields.yml +0 -0
  42. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_data/meta.yml +0 -0
  43. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_data/rules.yml +0 -0
  44. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/0bsd.txt +0 -0
  45. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/afl-3.0.txt +0 -0
  46. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/agpl-3.0.txt +0 -0
  47. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/apache-2.0.txt +0 -0
  48. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/artistic-2.0.txt +0 -0
  49. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/bsd-2-clause.txt +0 -0
  50. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/bsd-3-clause-clear.txt +0 -0
  51. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/bsd-3-clause.txt +0 -0
  52. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/bsd-4-clause.txt +0 -0
  53. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/bsl-1.0.txt +0 -0
  54. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cc-by-4.0.txt +0 -0
  55. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cc-by-sa-4.0.txt +0 -0
  56. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cc0-1.0.txt +0 -0
  57. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cecill-2.1.txt +0 -0
  58. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cern-ohl-p-2.0.txt +0 -0
  59. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cern-ohl-s-2.0.txt +0 -0
  60. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/cern-ohl-w-2.0.txt +0 -0
  61. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/ecl-2.0.txt +0 -0
  62. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/epl-1.0.txt +0 -0
  63. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/epl-2.0.txt +0 -0
  64. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/eupl-1.1.txt +0 -0
  65. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/eupl-1.2.txt +0 -0
  66. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/gfdl-1.3.txt +0 -0
  67. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/gpl-2.0.txt +0 -0
  68. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/gpl-3.0.txt +0 -0
  69. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/isc.txt +0 -0
  70. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/lgpl-2.1.txt +0 -0
  71. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/lgpl-3.0.txt +0 -0
  72. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/lppl-1.3c.txt +0 -0
  73. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/mit-0.txt +0 -0
  74. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/mit.txt +0 -0
  75. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/mpl-2.0.txt +0 -0
  76. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/ms-pl.txt +0 -0
  77. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/ms-rl.txt +0 -0
  78. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/mulanpsl-2.0.txt +0 -0
  79. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/ncsa.txt +0 -0
  80. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/odbl-1.0.txt +0 -0
  81. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/ofl-1.1.txt +0 -0
  82. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/osl-3.0.txt +0 -0
  83. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/postgresql.txt +0 -0
  84. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/unlicense.txt +0 -0
  85. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/upl-1.0.txt +0 -0
  86. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/vim.txt +0 -0
  87. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/wtfpl.txt +0 -0
  88. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/choosealicense.com/_licenses/zlib.txt +0 -0
  89. {owasp-depscan-5.1.4 → owasp-depscan-5.1.5}/vendor/spdx/json/licenses.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: owasp-depscan
3
- Version: 5.1.4
3
+ Version: 5.1.5
4
4
  Summary: Fully open-source security audit for project dependencies based on known vulnerabilities and advisories.
5
5
  Author-email: Team AppThreat <cloud@appthreat.com>
6
6
  License: MIT
@@ -20,7 +20,7 @@ Classifier: Topic :: Utilities
20
20
  Requires-Python: >=3.8
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: appthreat-vulnerability-db>=5.5.7
23
+ Requires-Dist: appthreat-vulnerability-db>=5.5.8
24
24
  Requires-Dist: defusedxml
25
25
  Requires-Dist: oras
26
26
  Requires-Dist: PyYAML
@@ -30,6 +30,8 @@ Requires-Dist: PyGithub
30
30
  Requires-Dist: toml
31
31
  Requires-Dist: pdfkit
32
32
  Requires-Dist: Jinja2
33
+ Requires-Dist: packageurl-python
34
+ Requires-Dist: cvss
33
35
  Provides-Extra: dev
34
36
  Requires-Dist: black; extra == "dev"
35
37
  Requires-Dist: flake8; extra == "dev"
@@ -47,35 +49,36 @@ OWASP dep-scan is a next-generation security and risk audit tool based on known
47
49
  [![Discord](https://img.shields.io/badge/-Discord-lime?style=for-the-badge&logo=discord&logoColor=white&color=black)](https://discord.gg/pF4BYWEJcS)
48
50
 
49
51
  ## Contents
50
- - [Features](#features)
51
- - [Vulnerability Data sources](#vulnerability-data-sources)
52
- - [Linux distros](#linux-distros)
53
- - [Usage](#usage)
54
- - [OCI Artifacts via ORAS cli](#oci-artifacts-via-oras-cli)
55
- - [Single binary executables](#single-binary-executables)
56
- - [Server mode](#server-mode)
57
- - [Scanning projects locally (Python version)](#scanning-projects-locally-python-version)
58
- - [Scanning containers locally (Python version)](#scanning-containers-locally-python-version)
59
- - [Scanning projects locally (Docker container)](#scanning-projects-locally-docker-container)
60
- - [Supported languages and package format](#supported-languages-and-package-format)
61
- - [Reachability analysis](#reachability-analysis)
62
- - [Example analysis for a Java project](#example-analysis-for-a-java-project)
63
- - [Example analysis for a JavaScript project](#example-analysis-for-a-javascript-project)
64
- - [Customization through environment variables](#customization-through-environment-variables)
65
- - [GitHub Security Advisory](#github-security-advisory)
66
- - [Suggest mode](#suggest-mode)
67
- - [Package Risk audit](#package-risk-audit)
68
- - [Automatic adjustment](#automatic-adjustment)
69
- - [Configuring weights](#configuring-weights)
70
- - [Live OS scan](#live-os-scan)
71
- - [License scan](#license-scan)
72
- - [Kubernetes and Cloud apps](#kubernetes-and-cloud-apps)
73
- - [PDF reports](#pdf-reports)
74
- - [Custom reports](#custom-reports)
75
- - [Performance tuning](#performance-tuning)
76
- - [Use nydus to speed up the initial vdb download](#use-nydus-to-speed-up-the-initial-vdb-download)
77
- - [Discord support](#discord-support)
78
- - [License](#license)
52
+
53
+ - [Features](#features)
54
+ - [Vulnerability Data sources](#vulnerability-data-sources)
55
+ - [Linux distros](#linux-distros)
56
+ - [Usage](#usage)
57
+ - [OCI Artifacts via ORAS cli](#oci-artifacts-via-oras-cli)
58
+ - [Single binary executables](#single-binary-executables)
59
+ - [Server mode](#server-mode)
60
+ - [Scanning projects locally (Python version)](#scanning-projects-locally-python-version)
61
+ - [Scanning containers locally (Python version)](#scanning-containers-locally-python-version)
62
+ - [Scanning projects locally (Docker container)](#scanning-projects-locally-docker-container)
63
+ - [Supported languages and package format](#supported-languages-and-package-format)
64
+ - [Reachability analysis](#reachability-analysis)
65
+ - [Example analysis for a Java project](#example-analysis-for-a-java-project)
66
+ - [Example analysis for a JavaScript project](#example-analysis-for-a-javascript-project)
67
+ - [Customization through environment variables](#customization-through-environment-variables)
68
+ - [GitHub Security Advisory](#github-security-advisory)
69
+ - [Suggest mode](#suggest-mode)
70
+ - [Package Risk audit](#package-risk-audit)
71
+ - [Automatic adjustment](#automatic-adjustment)
72
+ - [Configuring weights](#configuring-weights)
73
+ - [Live OS scan](#live-os-scan)
74
+ - [License scan](#license-scan)
75
+ - [Kubernetes and Cloud apps](#kubernetes-and-cloud-apps)
76
+ - [PDF reports](#pdf-reports)
77
+ - [Custom reports](#custom-reports)
78
+ - [Performance tuning](#performance-tuning)
79
+ - [Use nydus to speed up the initial vdb download](#use-nydus-to-speed-up-the-initial-vdb-download)
80
+ - [Discord support](#discord-support)
81
+ - [License](#license)
79
82
 
80
83
  ## Features
81
84
 
@@ -129,15 +132,18 @@ Use [ORAS cli](https://oras.land/docs/) to download the vulnerability database f
129
132
  export VDB_HOME=depscan
130
133
  mkdir -p $VDB_HOME
131
134
  oras pull ghcr.io/appthreat/vdb:v5 -o $VDB_HOME
135
+ # oras pull ghcr.io/appthreat/vdb-10y:v5 -o $VDB_HOME
132
136
  oras pull ghcr.io/owasp-dep-scan/depscan:v4 -o $VDB_HOME
133
137
  ```
134
138
 
139
+ Use `vdb-10y` which is a larger database with vulnerability data spanning the last 10 years from 2014. In contrast, vdb with a starting year of 2018 is appropriate for most users.
140
+
135
141
  ### Single binary executables
136
142
 
137
143
  Download the executable binary for your operating system from the [releases page](https://github.com/owasp-dep-scan/depscan-bin/releases). These binary bundle the following:
138
144
 
139
- - dep-scan with Python 3.10
140
- - cdxgen with Node.js 18
145
+ - dep-scan with Python 3.11
146
+ - cdxgen with Node.js 21
141
147
  - cdxgen binary plugins
142
148
 
143
149
  ```bash
@@ -386,6 +392,8 @@ depscan --profile research -t js -i <source directory> --reports-dir <reports di
386
392
  The following environment variables can be used to customise the behaviour.
387
393
 
388
394
  - VDB_HOME - Directory to use for caching database. For docker based execution, this directory should get mounted as a volume from the host
395
+ - VDB_DATABASE_URL - Vulnerability DB URL. Defaults to: ghcr.io/appthreat/vdb:v5
396
+ - USE_VDB_10Y - Set to true to use the larger 10 year vulnerability database. Default download url: ghcr.io/appthreat/vdb-10y:v5
389
397
 
390
398
  ## GitHub Security Advisory
391
399
 
@@ -8,35 +8,36 @@ OWASP dep-scan is a next-generation security and risk audit tool based on known
8
8
  [![Discord](https://img.shields.io/badge/-Discord-lime?style=for-the-badge&logo=discord&logoColor=white&color=black)](https://discord.gg/pF4BYWEJcS)
9
9
 
10
10
  ## Contents
11
- - [Features](#features)
12
- - [Vulnerability Data sources](#vulnerability-data-sources)
13
- - [Linux distros](#linux-distros)
14
- - [Usage](#usage)
15
- - [OCI Artifacts via ORAS cli](#oci-artifacts-via-oras-cli)
16
- - [Single binary executables](#single-binary-executables)
17
- - [Server mode](#server-mode)
18
- - [Scanning projects locally (Python version)](#scanning-projects-locally-python-version)
19
- - [Scanning containers locally (Python version)](#scanning-containers-locally-python-version)
20
- - [Scanning projects locally (Docker container)](#scanning-projects-locally-docker-container)
21
- - [Supported languages and package format](#supported-languages-and-package-format)
22
- - [Reachability analysis](#reachability-analysis)
23
- - [Example analysis for a Java project](#example-analysis-for-a-java-project)
24
- - [Example analysis for a JavaScript project](#example-analysis-for-a-javascript-project)
25
- - [Customization through environment variables](#customization-through-environment-variables)
26
- - [GitHub Security Advisory](#github-security-advisory)
27
- - [Suggest mode](#suggest-mode)
28
- - [Package Risk audit](#package-risk-audit)
29
- - [Automatic adjustment](#automatic-adjustment)
30
- - [Configuring weights](#configuring-weights)
31
- - [Live OS scan](#live-os-scan)
32
- - [License scan](#license-scan)
33
- - [Kubernetes and Cloud apps](#kubernetes-and-cloud-apps)
34
- - [PDF reports](#pdf-reports)
35
- - [Custom reports](#custom-reports)
36
- - [Performance tuning](#performance-tuning)
37
- - [Use nydus to speed up the initial vdb download](#use-nydus-to-speed-up-the-initial-vdb-download)
38
- - [Discord support](#discord-support)
39
- - [License](#license)
11
+
12
+ - [Features](#features)
13
+ - [Vulnerability Data sources](#vulnerability-data-sources)
14
+ - [Linux distros](#linux-distros)
15
+ - [Usage](#usage)
16
+ - [OCI Artifacts via ORAS cli](#oci-artifacts-via-oras-cli)
17
+ - [Single binary executables](#single-binary-executables)
18
+ - [Server mode](#server-mode)
19
+ - [Scanning projects locally (Python version)](#scanning-projects-locally-python-version)
20
+ - [Scanning containers locally (Python version)](#scanning-containers-locally-python-version)
21
+ - [Scanning projects locally (Docker container)](#scanning-projects-locally-docker-container)
22
+ - [Supported languages and package format](#supported-languages-and-package-format)
23
+ - [Reachability analysis](#reachability-analysis)
24
+ - [Example analysis for a Java project](#example-analysis-for-a-java-project)
25
+ - [Example analysis for a JavaScript project](#example-analysis-for-a-javascript-project)
26
+ - [Customization through environment variables](#customization-through-environment-variables)
27
+ - [GitHub Security Advisory](#github-security-advisory)
28
+ - [Suggest mode](#suggest-mode)
29
+ - [Package Risk audit](#package-risk-audit)
30
+ - [Automatic adjustment](#automatic-adjustment)
31
+ - [Configuring weights](#configuring-weights)
32
+ - [Live OS scan](#live-os-scan)
33
+ - [License scan](#license-scan)
34
+ - [Kubernetes and Cloud apps](#kubernetes-and-cloud-apps)
35
+ - [PDF reports](#pdf-reports)
36
+ - [Custom reports](#custom-reports)
37
+ - [Performance tuning](#performance-tuning)
38
+ - [Use nydus to speed up the initial vdb download](#use-nydus-to-speed-up-the-initial-vdb-download)
39
+ - [Discord support](#discord-support)
40
+ - [License](#license)
40
41
 
41
42
  ## Features
42
43
 
@@ -90,15 +91,18 @@ Use [ORAS cli](https://oras.land/docs/) to download the vulnerability database f
90
91
  export VDB_HOME=depscan
91
92
  mkdir -p $VDB_HOME
92
93
  oras pull ghcr.io/appthreat/vdb:v5 -o $VDB_HOME
94
+ # oras pull ghcr.io/appthreat/vdb-10y:v5 -o $VDB_HOME
93
95
  oras pull ghcr.io/owasp-dep-scan/depscan:v4 -o $VDB_HOME
94
96
  ```
95
97
 
98
+ Use `vdb-10y` which is a larger database with vulnerability data spanning the last 10 years from 2014. In contrast, vdb with a starting year of 2018 is appropriate for most users.
99
+
96
100
  ### Single binary executables
97
101
 
98
102
  Download the executable binary for your operating system from the [releases page](https://github.com/owasp-dep-scan/depscan-bin/releases). These binary bundle the following:
99
103
 
100
- - dep-scan with Python 3.10
101
- - cdxgen with Node.js 18
104
+ - dep-scan with Python 3.11
105
+ - cdxgen with Node.js 21
102
106
  - cdxgen binary plugins
103
107
 
104
108
  ```bash
@@ -347,6 +351,8 @@ depscan --profile research -t js -i <source directory> --reports-dir <reports di
347
351
  The following environment variables can be used to customise the behaviour.
348
352
 
349
353
  - VDB_HOME - Directory to use for caching database. For docker based execution, this directory should get mounted as a volume from the host
354
+ - VDB_DATABASE_URL - Vulnerability DB URL. Defaults to: ghcr.io/appthreat/vdb:v5
355
+ - USE_VDB_10Y - Set to true to use the larger 10 year vulnerability database. Default download url: ghcr.io/appthreat/vdb-10y:v5
350
356
 
351
357
  ## GitHub Security Advisory
352
358
 
@@ -2,22 +2,17 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  import argparse
5
- from defusedxml.ElementTree import parse
6
5
  import json
7
6
  import os
8
- import shutil
9
- import subprocess
10
7
  import sys
11
- import tarfile
12
8
  import tempfile
13
9
 
14
- import oras.client
10
+ from defusedxml.ElementTree import parse
15
11
  from quart import Quart, request
16
12
  from rich.panel import Panel
17
13
  from rich.terminal_theme import DEFAULT_TERMINAL_THEME, MONOKAI
18
14
  from vdb.lib import config
19
15
  from vdb.lib import db as db_lib
20
- from vdb.lib.config import data_dir
21
16
  from vdb.lib.gha import GitHubSource
22
17
  from vdb.lib.nvd import NvdSource
23
18
  from vdb.lib.osv import OSVSource
@@ -45,12 +40,11 @@ from depscan.lib.config import (
45
40
  UNIVERSAL_SCAN_TYPE,
46
41
  license_data_dir,
47
42
  spdx_license_list,
48
- vdb_database_url,
49
- vdb_rafs_database_url,
50
43
  )
51
44
  from depscan.lib.csaf import export_csaf, write_toml
52
45
  from depscan.lib.license import build_license_data, bulk_lookup
53
46
  from depscan.lib.logger import DEBUG, LOG, console
47
+ from depscan.lib.orasclient import download_image
54
48
 
55
49
  try:
56
50
  os.environ["PYTHONIOENCODING"] = "utf-8"
@@ -497,69 +491,6 @@ def summarise(
497
491
  return summary, vdr_file, pkg_vulnerabilities, pkg_group_rows
498
492
 
499
493
 
500
- def download_rafs_based_image():
501
- rafs_image_downloaded, paths_list = False, None
502
- nydus_image_command = shutil.which("nydus-image", mode=os.X_OK)
503
- if nydus_image_command is not None:
504
- LOG.info(
505
- "About to download the vulnerability database from %s. This might take a while ...",
506
- vdb_rafs_database_url,
507
- )
508
-
509
- try:
510
- oras_client = oras.client.OrasClient()
511
- rafs_data_dir = tempfile.TemporaryDirectory()
512
- paths_list = oras_client.pull(
513
- target=vdb_rafs_database_url, outdir=rafs_data_dir.name
514
- )
515
-
516
- if (
517
- paths_list
518
- and os.path.exists(
519
- os.path.join(rafs_data_dir.name, "data.rafs")
520
- )
521
- and os.path.exists(
522
- os.path.join(rafs_data_dir.name, "meta.rafs")
523
- )
524
- ):
525
- nydus_download_command = [
526
- f"{nydus_image_command}",
527
- "unpack",
528
- "--blob",
529
- os.path.join(rafs_data_dir.name, "data.rafs"),
530
- "--output",
531
- os.path.join(data_dir, "vdb.tar"),
532
- "--bootstrap",
533
- os.path.join(rafs_data_dir.name, "meta.rafs"),
534
- ]
535
- _ = subprocess.run(
536
- nydus_download_command,
537
- check=True,
538
- stdout=subprocess.DEVNULL,
539
- stderr=subprocess.DEVNULL,
540
- )
541
- if os.path.exists(os.path.join(data_dir, "vdb.tar")):
542
- rafs_image_downloaded = True
543
- with tarfile.open(
544
- os.path.join(data_dir, "vdb.tar"), "r"
545
- ) as tar:
546
- tar.extractall(path=data_dir)
547
- os.remove(os.path.join(data_dir, "vdb.tar"))
548
- else:
549
- raise FileNotFoundError("vdb.tar not found")
550
- else:
551
- raise FileNotFoundError("data.rafs or meta.rafs not found")
552
-
553
- except Exception:
554
- LOG.info(
555
- "Unable to pull the vulnerability database (rafs image) from %s. Trying to pull the non-rafs-based VDB image.",
556
- vdb_rafs_database_url,
557
- )
558
- rafs_image_downloaded = False
559
-
560
- return rafs_image_downloaded, data_dir
561
-
562
-
563
494
  @app.get("/")
564
495
  async def index():
565
496
  """
@@ -577,18 +508,17 @@ async def cache():
577
508
  """
578
509
  db = db_lib.get()
579
510
  if not db_lib.index_count(db["index_file"]):
580
- rafs_image_downloaded, _ = download_rafs_based_image()
581
- if not rafs_image_downloaded:
582
- LOG.info(
583
- "About to download the vulnerability database from %s. This might take a while ...",
584
- vdb_database_url,
585
- )
586
- oras_client = oras.client.OrasClient()
587
- oras_client.pull(target=vdb_database_url, outdir=data_dir)
511
+ paths_list = download_image()
512
+ if paths_list:
588
513
  return {
589
514
  "error": "false",
590
515
  "message": "vulnerability database cached successfully",
591
516
  }
517
+ else:
518
+ return {
519
+ "error": "true",
520
+ "message": "vulnerability database was not cached",
521
+ }
592
522
  return {
593
523
  "error": "false",
594
524
  "message": "vulnerability database already exists",
@@ -1036,17 +966,7 @@ def main():
1036
966
  except Exception:
1037
967
  pass
1038
968
  if run_cacher:
1039
- rafs_image_downloaded, paths_list = download_rafs_based_image()
1040
- if not rafs_image_downloaded:
1041
- LOG.info(
1042
- "About to download the vulnerability database from %s. This might take a while ...",
1043
- vdb_database_url,
1044
- )
1045
- oras_client = oras.client.OrasClient()
1046
- paths_list = oras_client.pull(
1047
- target=vdb_database_url, outdir=data_dir
1048
- )
1049
-
969
+ paths_list = download_image()
1050
970
  LOG.debug("VDB data is stored at: %s", paths_list)
1051
971
  run_cacher = False
1052
972
  db = db_lib.get()
@@ -1101,12 +1021,10 @@ def main():
1101
1021
  # CSAF VEX export
1102
1022
  if args.csaf:
1103
1023
  export_csaf(
1104
- results,
1024
+ pkg_vulnerabilities,
1105
1025
  src_dir,
1106
1026
  reports_dir,
1107
- vdr_file,
1108
- direct_purls=direct_purls,
1109
- reached_purls=reached_purls,
1027
+ bom_file,
1110
1028
  )
1111
1029
  console.save_html(
1112
1030
  html_file,