owasp-depscan 4.2.8__tar.gz → 4.3.0__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.
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/PKG-INFO +30 -8
- owasp-depscan-4.2.8/owasp_depscan.egg-info/PKG-INFO → owasp-depscan-4.3.0/README.md +26 -39
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/cli.py +81 -21
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/bom.py +1 -1
- owasp-depscan-4.3.0/depscan/lib/csaf.py +1680 -0
- owasp-depscan-4.2.8/README.md → owasp-depscan-4.3.0/owasp_depscan.egg-info/PKG-INFO +61 -6
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/owasp_depscan.egg-info/SOURCES.txt +2 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/owasp_depscan.egg-info/requires.txt +2 -1
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/pyproject.toml +4 -2
- owasp-depscan-4.3.0/test/test_csaf.py +537 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/LICENSE +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/MANIFEST.in +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/__init__.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/__init__.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/analysis.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/audit.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/config.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/license.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/logger.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/normalize.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/pkg_query.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/privado.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/depscan/lib/utils.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/owasp_depscan.egg-info/dependency_links.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/owasp_depscan.egg-info/entry_points.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/owasp_depscan.egg-info/top_level.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/setup.cfg +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_analysis.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_bom.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_license.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_norm.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_pkg_query.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_privado.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/test/test_utils.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/__init__.py +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_data/fields.yml +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_data/meta.yml +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_data/rules.yml +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/0bsd.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/afl-3.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/agpl-3.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/apache-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/artistic-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/bsd-2-clause.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/bsd-3-clause-clear.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/bsd-3-clause.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/bsd-4-clause.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/bsl-1.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cc-by-4.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cc-by-sa-4.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cc0-1.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cecill-2.1.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cern-ohl-p-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cern-ohl-s-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/cern-ohl-w-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/ecl-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/epl-1.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/epl-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/eupl-1.1.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/eupl-1.2.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/gfdl-1.3.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/gpl-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/gpl-3.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/isc.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/lgpl-2.1.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/lgpl-3.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/lppl-1.3c.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/mit-0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/mit.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/mpl-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/ms-pl.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/ms-rl.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/mulanpsl-2.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/ncsa.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/odbl-1.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/ofl-1.1.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/osl-3.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/postgresql.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/unlicense.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/upl-1.0.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/vim.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/wtfpl.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/choosealicense.com/_licenses/zlib.txt +0 -0
- {owasp-depscan-4.2.8 → owasp-depscan-4.3.0}/vendor/spdx/json/licenses.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: owasp-depscan
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3.0
|
|
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
|
|
@@ -14,17 +14,19 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
18
|
Classifier: Topic :: Security
|
|
18
19
|
Classifier: Topic :: Utilities
|
|
19
20
|
Requires-Python: >=3.8
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: appthreat-vulnerability-db>=5.
|
|
23
|
+
Requires-Dist: appthreat-vulnerability-db>=5.5.1
|
|
23
24
|
Requires-Dist: defusedxml
|
|
24
25
|
Requires-Dist: oras
|
|
25
26
|
Requires-Dist: PyYAML
|
|
26
27
|
Requires-Dist: rich
|
|
27
28
|
Requires-Dist: quart
|
|
29
|
+
Requires-Dist: toml
|
|
28
30
|
Provides-Extra: dev
|
|
29
31
|
Requires-Dist: black; extra == "dev"
|
|
30
32
|
Requires-Dist: flake8; extra == "dev"
|
|
@@ -45,6 +47,7 @@ OWASP dep-scan is a fully open-source security audit tool based on known vulnera
|
|
|
45
47
|
- Scan most application code - local repos, Linux container images, Kubernetes manifests, and OS - to identify known CVEs with prioritization
|
|
46
48
|
- Package vulnerability scanning is performed locally and is quite fast. No server is used!
|
|
47
49
|
- Generate Software Bill-of-Materials (SBoM) with Vulnerability Exploitability Exchange (VEX) information
|
|
50
|
+
- Generate a Common Security Advisory Framework (CSAF) 2.0 document (check out the [CSAF Readme](contrib/CSAF_README.md))
|
|
48
51
|
- Perform deep packages risk audit for dependency confusion attacks and maintenance risks (See risk audit)
|
|
49
52
|
|
|
50
53
|

|
|
@@ -171,24 +174,33 @@ depscan --src $PWD --reports-dir $PWD/reports
|
|
|
171
174
|
Full list of options are below:
|
|
172
175
|
|
|
173
176
|
```bash
|
|
174
|
-
usage: depscan [-h] [--no-banner] [--cache] [--sync] [--suggest] [--risk-audit] [--private-ns PRIVATE_NS] [-t PROJECT_TYPE] [--bom BOM] -i
|
|
175
|
-
|
|
177
|
+
usage: depscan [-h] [--no-banner] [--cache] [--csaf] [--sync] [--suggest] [--risk-audit] [--private-ns PRIVATE_NS] [-t PROJECT_TYPE] [--bom BOM] [-i SRC_DIR_IMAGE] [-o REPORT_FILE] [--reports-dir REPORTS_DIR] [--no-error]
|
|
178
|
+
[--no-license-scan] [--deep] [--no-universal] [--no-vuln-table] [--threatdb-server THREATDB_SERVER] [--threatdb-username THREATDB_USERNAME] [--threatdb-password THREATDB_PASSWORD] [--threatdb-token THREATDB_TOKEN]
|
|
179
|
+
[--privado-json PRIVADO_JSON] [--server] [--server-host SERVER_HOST] [--server-port SERVER_PORT] [--cdxgen-server CDXGEN_SERVER] [-v]
|
|
180
|
+
|
|
181
|
+
Fully open-source security and license audit for application dependencies and container images based on known vulnerabilities and advisories.
|
|
182
|
+
|
|
183
|
+
options:
|
|
176
184
|
-h, --help show this help message and exit
|
|
177
185
|
--no-banner Do not display banner
|
|
178
186
|
--cache Cache vulnerability information in platform specific user_data_dir
|
|
187
|
+
--csaf Generate a CSAF
|
|
179
188
|
--sync Sync to receive the latest vulnerability data. Should have invoked cache first.
|
|
189
|
+
--suggest DEPRECATED: Suggest is the default mode for determining fix version.
|
|
180
190
|
--risk-audit Perform package risk audit (slow operation). Npm only.
|
|
181
191
|
--private-ns PRIVATE_NS
|
|
182
|
-
Private namespace to use while performing oss risk audit. Private packages should not be available in public registries by default. Comma
|
|
183
|
-
separated values accepted.
|
|
192
|
+
Private namespace to use while performing oss risk audit. Private packages should not be available in public registries by default. Comma separated values accepted.
|
|
184
193
|
-t PROJECT_TYPE, --type PROJECT_TYPE
|
|
185
194
|
Override project type if auto-detection is incorrect
|
|
186
195
|
--bom BOM Examine using the given Software Bill-of-Materials (SBoM) file in CycloneDX format. Use cdxgen command to produce one.
|
|
187
|
-
-i
|
|
188
|
-
Source directory
|
|
196
|
+
-i SRC_DIR_IMAGE, --src SRC_DIR_IMAGE
|
|
197
|
+
Source directory or container image or binary file
|
|
198
|
+
-o REPORT_FILE, --report_file REPORT_FILE
|
|
199
|
+
DEPRECATED. Use reports directory since multiple files are created. Report filename with directory
|
|
189
200
|
--reports-dir REPORTS_DIR
|
|
190
201
|
Reports directory
|
|
191
202
|
--no-error Continue on error to prevent build from breaking
|
|
203
|
+
--no-license-scan DEPRECATED: dep-scan does not perform license scanning by default
|
|
192
204
|
--deep Perform deep scan by passing this --deep argument to cdxgen. Useful while scanning docker images and OS packages.
|
|
193
205
|
--no-universal Depscan would attempt to perform a single universal scan instead of individual scans per language type.
|
|
194
206
|
--no-vuln-table Do not print the table with the full list of vulnerabilities. This can help reduce console output.
|
|
@@ -200,6 +212,16 @@ usage: depscan [-h] [--no-banner] [--cache] [--sync] [--suggest] [--risk-audit]
|
|
|
200
212
|
ThreatDB password
|
|
201
213
|
--threatdb-token THREATDB_TOKEN
|
|
202
214
|
ThreatDB token for token based submission
|
|
215
|
+
--privado-json PRIVADO_JSON
|
|
216
|
+
Optional: Enrich the VEX report with information from privado.ai json report. cdxgen can process and include privado info automatically so this argument is usually not required.
|
|
217
|
+
--server Run depscan as a server
|
|
218
|
+
--server-host SERVER_HOST
|
|
219
|
+
depscan server host
|
|
220
|
+
--server-port SERVER_PORT
|
|
221
|
+
depscan server port
|
|
222
|
+
--cdxgen-server CDXGEN_SERVER
|
|
223
|
+
cdxgen server url. Eg: http://cdxgen:9090
|
|
224
|
+
-v, --version Display the version
|
|
203
225
|
```
|
|
204
226
|
|
|
205
227
|
### Scanning containers locally (Python version)
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: owasp-depscan
|
|
3
|
-
Version: 4.2.8
|
|
4
|
-
Summary: Fully open-source security audit for project dependencies based on known vulnerabilities and advisories.
|
|
5
|
-
Author-email: Team AppThreat <cloud@appthreat.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/owasp-dep-scan/dep-scan
|
|
8
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Intended Audience :: System Administrators
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Topic :: Security
|
|
18
|
-
Classifier: Topic :: Utilities
|
|
19
|
-
Requires-Python: >=3.8
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: appthreat-vulnerability-db>=5.4.2
|
|
23
|
-
Requires-Dist: defusedxml
|
|
24
|
-
Requires-Dist: oras
|
|
25
|
-
Requires-Dist: PyYAML
|
|
26
|
-
Requires-Dist: rich
|
|
27
|
-
Requires-Dist: quart
|
|
28
|
-
Provides-Extra: dev
|
|
29
|
-
Requires-Dist: black; extra == "dev"
|
|
30
|
-
Requires-Dist: flake8; extra == "dev"
|
|
31
|
-
Requires-Dist: pytest; extra == "dev"
|
|
32
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
|
33
|
-
|
|
34
1
|
# Introduction
|
|
35
2
|
|
|
36
3
|
OWASP dep-scan is a fully open-source security audit tool based on known vulnerabilities, advisories, and license limitations for project dependencies. Both local repositories and container images are supported as the input, and the tool is ideal for CI environments with built-in build-breaker logic.
|
|
@@ -45,6 +12,7 @@ OWASP dep-scan is a fully open-source security audit tool based on known vulnera
|
|
|
45
12
|
- Scan most application code - local repos, Linux container images, Kubernetes manifests, and OS - to identify known CVEs with prioritization
|
|
46
13
|
- Package vulnerability scanning is performed locally and is quite fast. No server is used!
|
|
47
14
|
- Generate Software Bill-of-Materials (SBoM) with Vulnerability Exploitability Exchange (VEX) information
|
|
15
|
+
- Generate a Common Security Advisory Framework (CSAF) 2.0 document (check out the [CSAF Readme](contrib/CSAF_README.md))
|
|
48
16
|
- Perform deep packages risk audit for dependency confusion attacks and maintenance risks (See risk audit)
|
|
49
17
|
|
|
50
18
|

|
|
@@ -171,24 +139,33 @@ depscan --src $PWD --reports-dir $PWD/reports
|
|
|
171
139
|
Full list of options are below:
|
|
172
140
|
|
|
173
141
|
```bash
|
|
174
|
-
usage: depscan [-h] [--no-banner] [--cache] [--sync] [--suggest] [--risk-audit] [--private-ns PRIVATE_NS] [-t PROJECT_TYPE] [--bom BOM] -i
|
|
175
|
-
|
|
142
|
+
usage: depscan [-h] [--no-banner] [--cache] [--csaf] [--sync] [--suggest] [--risk-audit] [--private-ns PRIVATE_NS] [-t PROJECT_TYPE] [--bom BOM] [-i SRC_DIR_IMAGE] [-o REPORT_FILE] [--reports-dir REPORTS_DIR] [--no-error]
|
|
143
|
+
[--no-license-scan] [--deep] [--no-universal] [--no-vuln-table] [--threatdb-server THREATDB_SERVER] [--threatdb-username THREATDB_USERNAME] [--threatdb-password THREATDB_PASSWORD] [--threatdb-token THREATDB_TOKEN]
|
|
144
|
+
[--privado-json PRIVADO_JSON] [--server] [--server-host SERVER_HOST] [--server-port SERVER_PORT] [--cdxgen-server CDXGEN_SERVER] [-v]
|
|
145
|
+
|
|
146
|
+
Fully open-source security and license audit for application dependencies and container images based on known vulnerabilities and advisories.
|
|
147
|
+
|
|
148
|
+
options:
|
|
176
149
|
-h, --help show this help message and exit
|
|
177
150
|
--no-banner Do not display banner
|
|
178
151
|
--cache Cache vulnerability information in platform specific user_data_dir
|
|
152
|
+
--csaf Generate a CSAF
|
|
179
153
|
--sync Sync to receive the latest vulnerability data. Should have invoked cache first.
|
|
154
|
+
--suggest DEPRECATED: Suggest is the default mode for determining fix version.
|
|
180
155
|
--risk-audit Perform package risk audit (slow operation). Npm only.
|
|
181
156
|
--private-ns PRIVATE_NS
|
|
182
|
-
Private namespace to use while performing oss risk audit. Private packages should not be available in public registries by default. Comma
|
|
183
|
-
separated values accepted.
|
|
157
|
+
Private namespace to use while performing oss risk audit. Private packages should not be available in public registries by default. Comma separated values accepted.
|
|
184
158
|
-t PROJECT_TYPE, --type PROJECT_TYPE
|
|
185
159
|
Override project type if auto-detection is incorrect
|
|
186
160
|
--bom BOM Examine using the given Software Bill-of-Materials (SBoM) file in CycloneDX format. Use cdxgen command to produce one.
|
|
187
|
-
-i
|
|
188
|
-
Source directory
|
|
161
|
+
-i SRC_DIR_IMAGE, --src SRC_DIR_IMAGE
|
|
162
|
+
Source directory or container image or binary file
|
|
163
|
+
-o REPORT_FILE, --report_file REPORT_FILE
|
|
164
|
+
DEPRECATED. Use reports directory since multiple files are created. Report filename with directory
|
|
189
165
|
--reports-dir REPORTS_DIR
|
|
190
166
|
Reports directory
|
|
191
167
|
--no-error Continue on error to prevent build from breaking
|
|
168
|
+
--no-license-scan DEPRECATED: dep-scan does not perform license scanning by default
|
|
192
169
|
--deep Perform deep scan by passing this --deep argument to cdxgen. Useful while scanning docker images and OS packages.
|
|
193
170
|
--no-universal Depscan would attempt to perform a single universal scan instead of individual scans per language type.
|
|
194
171
|
--no-vuln-table Do not print the table with the full list of vulnerabilities. This can help reduce console output.
|
|
@@ -200,6 +177,16 @@ usage: depscan [-h] [--no-banner] [--cache] [--sync] [--suggest] [--risk-audit]
|
|
|
200
177
|
ThreatDB password
|
|
201
178
|
--threatdb-token THREATDB_TOKEN
|
|
202
179
|
ThreatDB token for token based submission
|
|
180
|
+
--privado-json PRIVADO_JSON
|
|
181
|
+
Optional: Enrich the VEX report with information from privado.ai json report. cdxgen can process and include privado info automatically so this argument is usually not required.
|
|
182
|
+
--server Run depscan as a server
|
|
183
|
+
--server-host SERVER_HOST
|
|
184
|
+
depscan server host
|
|
185
|
+
--server-port SERVER_PORT
|
|
186
|
+
depscan server port
|
|
187
|
+
--cdxgen-server CDXGEN_SERVER
|
|
188
|
+
cdxgen server url. Eg: http://cdxgen:9090
|
|
189
|
+
-v, --version Display the version
|
|
203
190
|
```
|
|
204
191
|
|
|
205
192
|
### Scanning containers locally (Python version)
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import argparse
|
|
5
5
|
import json
|
|
6
6
|
import os
|
|
7
|
+
import sys
|
|
7
8
|
import tempfile
|
|
8
9
|
|
|
9
10
|
from quart import Quart, request
|
|
@@ -11,7 +12,6 @@ from rich.panel import Panel
|
|
|
11
12
|
from rich.terminal_theme import MONOKAI
|
|
12
13
|
from vdb.lib import config
|
|
13
14
|
from vdb.lib import db as db_lib
|
|
14
|
-
from vdb.lib.aqua import AquaSource
|
|
15
15
|
from vdb.lib.config import data_dir
|
|
16
16
|
from vdb.lib.gha import GitHubSource
|
|
17
17
|
from vdb.lib.nvd import NvdSource
|
|
@@ -20,6 +20,7 @@ from vdb.lib.utils import parse_purl
|
|
|
20
20
|
|
|
21
21
|
import oras.client
|
|
22
22
|
|
|
23
|
+
from depscan.lib.csaf import export_csaf, write_toml
|
|
23
24
|
from depscan.lib import privado, utils
|
|
24
25
|
from depscan.lib.analysis import (
|
|
25
26
|
PrepareVexOptions,
|
|
@@ -31,7 +32,12 @@ from depscan.lib.analysis import (
|
|
|
31
32
|
summary_stats,
|
|
32
33
|
)
|
|
33
34
|
from depscan.lib.audit import audit, risk_audit, risk_audit_map, type_audit_map
|
|
34
|
-
from depscan.lib.bom import
|
|
35
|
+
from depscan.lib.bom import (
|
|
36
|
+
create_bom,
|
|
37
|
+
get_pkg_by_type,
|
|
38
|
+
get_pkg_list,
|
|
39
|
+
submit_bom,
|
|
40
|
+
)
|
|
35
41
|
from depscan.lib.config import (
|
|
36
42
|
UNIVERSAL_SCAN_TYPE,
|
|
37
43
|
license_data_dir,
|
|
@@ -82,7 +88,15 @@ def build_args():
|
|
|
82
88
|
action="store_true",
|
|
83
89
|
default=False,
|
|
84
90
|
dest="cache",
|
|
85
|
-
help="Cache vulnerability information in platform specific "
|
|
91
|
+
help="Cache vulnerability information in platform specific "
|
|
92
|
+
"user_data_dir",
|
|
93
|
+
)
|
|
94
|
+
parser.add_argument(
|
|
95
|
+
"--csaf",
|
|
96
|
+
action="store_true",
|
|
97
|
+
default=False,
|
|
98
|
+
dest="csaf",
|
|
99
|
+
help="Generate a CSAF",
|
|
86
100
|
)
|
|
87
101
|
parser.add_argument(
|
|
88
102
|
"--sync",
|
|
@@ -97,12 +111,15 @@ def build_args():
|
|
|
97
111
|
action="store_true",
|
|
98
112
|
default=True,
|
|
99
113
|
dest="suggest",
|
|
100
|
-
help="DEPRECATED: Suggest is the default mode for determining fix "
|
|
114
|
+
help="DEPRECATED: Suggest is the default mode for determining fix "
|
|
115
|
+
"version.",
|
|
101
116
|
)
|
|
102
117
|
parser.add_argument(
|
|
103
118
|
"--risk-audit",
|
|
104
119
|
action="store_true",
|
|
105
|
-
default=True
|
|
120
|
+
default=True
|
|
121
|
+
if os.getenv("ENABLE_OSS_RISK", "") in ["true", "1"]
|
|
122
|
+
else False,
|
|
106
123
|
dest="risk_audit",
|
|
107
124
|
help="Perform package risk audit (slow operation). Npm only.",
|
|
108
125
|
)
|
|
@@ -142,7 +159,9 @@ def build_args():
|
|
|
142
159
|
)
|
|
143
160
|
parser.add_argument(
|
|
144
161
|
"--reports-dir",
|
|
145
|
-
default=os.getenv(
|
|
162
|
+
default=os.getenv(
|
|
163
|
+
"DEPSCAN_REPORTS_DIR", os.path.join(os.getcwd(), "reports")
|
|
164
|
+
),
|
|
146
165
|
dest="reports_dir",
|
|
147
166
|
help="Reports directory",
|
|
148
167
|
)
|
|
@@ -269,7 +288,9 @@ def scan(db, project_type, pkg_list, suggest_mode):
|
|
|
269
288
|
LOG.debug("Empty package search attempted!")
|
|
270
289
|
else:
|
|
271
290
|
LOG.debug("Scanning %d oss dependencies for issues", len(pkg_list))
|
|
272
|
-
results, pkg_aliases, purl_aliases = utils.search_pkgs(
|
|
291
|
+
results, pkg_aliases, purl_aliases = utils.search_pkgs(
|
|
292
|
+
db, project_type, pkg_list
|
|
293
|
+
)
|
|
273
294
|
# pkg_aliases is a dict that can be used to find the original vendor and
|
|
274
295
|
# package name This way we consistently use the same names used by the
|
|
275
296
|
# caller irrespective of how the result was obtained
|
|
@@ -326,7 +347,9 @@ def scan(db, project_type, pkg_list, suggest_mode):
|
|
|
326
347
|
"Re-checking our suggestion to ensure there are no further "
|
|
327
348
|
"vulnerabilities"
|
|
328
349
|
)
|
|
329
|
-
override_results, _, _ = utils.search_pkgs(
|
|
350
|
+
override_results, _, _ = utils.search_pkgs(
|
|
351
|
+
db, project_type, sug_pkg_list
|
|
352
|
+
)
|
|
330
353
|
if override_results:
|
|
331
354
|
new_sug_dict = suggest_version(override_results)
|
|
332
355
|
LOG.debug("Received override results: %s", new_sug_dict)
|
|
@@ -432,7 +455,7 @@ def summarise(
|
|
|
432
455
|
bom_data["services"] = []
|
|
433
456
|
bom_data["services"].insert(0, pservice)
|
|
434
457
|
with open(vex_file, mode="w", encoding="utf-8") as vexfp:
|
|
435
|
-
json.dump(bom_data, vexfp)
|
|
458
|
+
json.dump(bom_data, vexfp, indent=4)
|
|
436
459
|
LOG.info("VEX file %s generated successfully", vex_file)
|
|
437
460
|
except Exception:
|
|
438
461
|
LOG.warning("Unable to generate VEX file for this scan")
|
|
@@ -556,7 +579,8 @@ async def run_scan():
|
|
|
556
579
|
else:
|
|
557
580
|
return {
|
|
558
581
|
"error": "true",
|
|
559
|
-
"message": "Unable to generate SBoM. Check your input path or "
|
|
582
|
+
"message": "Unable to generate SBoM. Check your input path or "
|
|
583
|
+
"url.",
|
|
560
584
|
}, 500
|
|
561
585
|
|
|
562
586
|
|
|
@@ -567,7 +591,9 @@ def run_server(args):
|
|
|
567
591
|
:param args: Command line arguments passed to the function.
|
|
568
592
|
"""
|
|
569
593
|
print(at_logo)
|
|
570
|
-
console.print(
|
|
594
|
+
console.print(
|
|
595
|
+
f"Depscan server running on {args.server_host}:{args.server_port}"
|
|
596
|
+
)
|
|
571
597
|
app.config["CDXGEN_SERVER_URL"] = args.cdxgen_server
|
|
572
598
|
app.run(
|
|
573
599
|
host=args.server_host,
|
|
@@ -588,9 +614,24 @@ def main():
|
|
|
588
614
|
if not args.no_banner:
|
|
589
615
|
print(at_logo)
|
|
590
616
|
src_dir = args.src_dir_image
|
|
591
|
-
if not src_dir:
|
|
617
|
+
if not src_dir or src_dir == ".":
|
|
592
618
|
src_dir = os.getcwd()
|
|
593
619
|
reports_dir = args.reports_dir
|
|
620
|
+
if args.csaf:
|
|
621
|
+
toml_file_path = os.path.join(src_dir, "csaf.toml")
|
|
622
|
+
if not os.path.exists(toml_file_path):
|
|
623
|
+
LOG.info("CSAF toml not found, creating template in %s", src_dir)
|
|
624
|
+
write_toml(toml_file_path)
|
|
625
|
+
LOG.info(
|
|
626
|
+
"Please fill out the toml with your details and rerun depscan."
|
|
627
|
+
)
|
|
628
|
+
LOG.info("Check out our CSAF documentation for an explanation of "
|
|
629
|
+
"this feature. https://github.com/owasp-dep-scan/dep-scan"
|
|
630
|
+
"/blob/master/contrib/CSAF_README.md")
|
|
631
|
+
LOG.info("If you're just checking out how our generator works, "
|
|
632
|
+
"feel free to skip filling out the toml and just rerun "
|
|
633
|
+
"depscan.")
|
|
634
|
+
sys.exit(0)
|
|
594
635
|
# Detect the project types and perform the right type of scan
|
|
595
636
|
if args.project_type:
|
|
596
637
|
project_types_list = args.project_type.split(",")
|
|
@@ -628,7 +669,9 @@ def main():
|
|
|
628
669
|
for project_type in project_types_list:
|
|
629
670
|
results = []
|
|
630
671
|
report_file = areport_file.replace(".json", f"-{project_type}.json")
|
|
631
|
-
risk_report_file = areport_file.replace(
|
|
672
|
+
risk_report_file = areport_file.replace(
|
|
673
|
+
".json", f"-risk.{project_type}.json"
|
|
674
|
+
)
|
|
632
675
|
LOG.info("=" * 80)
|
|
633
676
|
if args.bom and os.path.exists(args.bom):
|
|
634
677
|
bom_file = args.bom
|
|
@@ -665,7 +708,9 @@ def main():
|
|
|
665
708
|
license_report_file = os.path.join(
|
|
666
709
|
reports_dir, "license-" + project_type + ".json"
|
|
667
710
|
)
|
|
668
|
-
analyse_licenses(
|
|
711
|
+
analyse_licenses(
|
|
712
|
+
project_type, licenses_results, license_report_file
|
|
713
|
+
)
|
|
669
714
|
if project_type in risk_audit_map:
|
|
670
715
|
if args.risk_audit:
|
|
671
716
|
console.print(
|
|
@@ -713,14 +758,16 @@ def main():
|
|
|
713
758
|
try:
|
|
714
759
|
audit_results = audit(project_type, pkg_list)
|
|
715
760
|
if audit_results:
|
|
716
|
-
LOG.debug(
|
|
761
|
+
LOG.debug(
|
|
762
|
+
"Remote audit yielded %d results", len(audit_results)
|
|
763
|
+
)
|
|
717
764
|
results = results + audit_results
|
|
718
765
|
except Exception as e:
|
|
719
766
|
LOG.error("Remote audit was not successful")
|
|
720
767
|
LOG.error(e)
|
|
721
768
|
results = []
|
|
722
|
-
# In case of docker, bom, or universal type, check if there are any
|
|
723
|
-
# audited remotely
|
|
769
|
+
# In case of docker, bom, or universal type, check if there are any
|
|
770
|
+
# npm packages that can be audited remotely
|
|
724
771
|
if project_type in ("podman", "docker", "oci", "bom", "universal"):
|
|
725
772
|
npm_pkg_list = get_pkg_by_type(pkg_list, "npm")
|
|
726
773
|
if npm_pkg_list:
|
|
@@ -739,15 +786,23 @@ def main():
|
|
|
739
786
|
if not db_lib.index_count(db["index_file"]):
|
|
740
787
|
run_cacher = True
|
|
741
788
|
else:
|
|
742
|
-
LOG.debug(
|
|
789
|
+
LOG.debug(
|
|
790
|
+
"Vulnerability database loaded from %s", config.vdb_bin_file
|
|
791
|
+
)
|
|
743
792
|
|
|
744
793
|
sources_list = [OSVSource(), NvdSource()]
|
|
745
794
|
if os.environ.get("GITHUB_TOKEN"):
|
|
746
795
|
sources_list.insert(0, GitHubSource())
|
|
747
796
|
if run_cacher:
|
|
797
|
+
LOG.debug(
|
|
798
|
+
"About to download vdb from %s. This might take a while ...",
|
|
799
|
+
vdb_database_url,
|
|
800
|
+
)
|
|
748
801
|
oras_client = oras.client.OrasClient()
|
|
749
|
-
paths_list = oras_client.pull(
|
|
750
|
-
|
|
802
|
+
paths_list = oras_client.pull(
|
|
803
|
+
target=vdb_database_url, outdir=data_dir
|
|
804
|
+
)
|
|
805
|
+
LOG.debug("VDB data is stored at: %s", paths_list)
|
|
751
806
|
run_cacher = False
|
|
752
807
|
elif args.sync:
|
|
753
808
|
for s in sources_list:
|
|
@@ -763,7 +818,12 @@ def main():
|
|
|
763
818
|
db, project_type, pkg_list, args.suggest
|
|
764
819
|
)
|
|
765
820
|
if vdb_results:
|
|
766
|
-
results
|
|
821
|
+
results += vdb_results
|
|
822
|
+
if args.csaf:
|
|
823
|
+
new_res = []
|
|
824
|
+
for r in results:
|
|
825
|
+
new_res.append(r.to_dict())
|
|
826
|
+
export_csaf(new_res, src_dir, reports_dir)
|
|
767
827
|
# Summarise and print results
|
|
768
828
|
summarise(
|
|
769
829
|
project_type,
|