owasp-depscan 5.5.0__tar.gz → 6.0.0a2__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 (107) hide show
  1. owasp_depscan-6.0.0a2/PKG-INFO +390 -0
  2. owasp_depscan-6.0.0a2/README.md +334 -0
  3. owasp_depscan-6.0.0a2/depscan/__init__.py +8 -0
  4. owasp_depscan-6.0.0a2/depscan/cli.py +1008 -0
  5. owasp_depscan-6.0.0a2/depscan/cli_options.py +302 -0
  6. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/depscan/lib/audit.py +3 -1
  7. owasp_depscan-6.0.0a2/depscan/lib/bom.py +580 -0
  8. owasp_depscan-6.0.0a2/depscan/lib/config.py +321 -0
  9. owasp_depscan-6.0.0a2/depscan/lib/explainer.py +548 -0
  10. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/depscan/lib/license.py +11 -10
  11. owasp_depscan-6.0.0a2/depscan/lib/logger.py +119 -0
  12. owasp_depscan-6.0.0a2/depscan/lib/package_query/cargo_pkg.py +124 -0
  13. owasp_depscan-6.0.0a2/depscan/lib/package_query/metadata.py +170 -0
  14. owasp_depscan-6.0.0a2/depscan/lib/package_query/npm_pkg.py +345 -0
  15. owasp_depscan-6.0.0a2/depscan/lib/package_query/pkg_query.py +195 -0
  16. owasp_depscan-6.0.0a2/depscan/lib/package_query/pypi_pkg.py +113 -0
  17. owasp_depscan-6.0.0a2/depscan/lib/tomlparse.py +116 -0
  18. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/depscan/lib/utils.py +34 -188
  19. owasp_depscan-6.0.0a2/owasp_depscan.egg-info/PKG-INFO +390 -0
  20. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/owasp_depscan.egg-info/SOURCES.txt +8 -8
  21. owasp_depscan-6.0.0a2/owasp_depscan.egg-info/requires.txt +37 -0
  22. owasp_depscan-6.0.0a2/pyproject.toml +98 -0
  23. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/test/test_bom.py +1 -50
  24. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/test/test_explainer.py +4 -3
  25. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/test/test_license.py +1 -3
  26. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/test/test_pkg_query.py +112 -17
  27. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/test/test_utils.py +12 -66
  28. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cern-ohl-p-2.0.txt +1 -1
  29. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cern-ohl-s-2.0.txt +1 -1
  30. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cern-ohl-w-2.0.txt +2 -2
  31. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/mit-0.txt +1 -1
  32. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/spdx/json/licenses.json +904 -677
  33. owasp_depscan-5.5.0/PKG-INFO +0 -580
  34. owasp_depscan-5.5.0/README.md +0 -539
  35. owasp_depscan-5.5.0/depscan/cli.py +0 -1116
  36. owasp_depscan-5.5.0/depscan/lib/analysis.py +0 -1554
  37. owasp_depscan-5.5.0/depscan/lib/bom.py +0 -478
  38. owasp_depscan-5.5.0/depscan/lib/config.py +0 -572
  39. owasp_depscan-5.5.0/depscan/lib/csaf.py +0 -1860
  40. owasp_depscan-5.5.0/depscan/lib/explainer.py +0 -283
  41. owasp_depscan-5.5.0/depscan/lib/logger.py +0 -71
  42. owasp_depscan-5.5.0/depscan/lib/normalize.py +0 -312
  43. owasp_depscan-5.5.0/depscan/lib/orasclient.py +0 -142
  44. owasp_depscan-5.5.0/depscan/lib/pkg_query.py +0 -532
  45. owasp_depscan-5.5.0/owasp_depscan.egg-info/PKG-INFO +0 -580
  46. owasp_depscan-5.5.0/owasp_depscan.egg-info/requires.txt +0 -19
  47. owasp_depscan-5.5.0/pyproject.toml +0 -74
  48. owasp_depscan-5.5.0/test/test_analysis.py +0 -772
  49. owasp_depscan-5.5.0/test/test_csaf.py +0 -1055
  50. owasp_depscan-5.5.0/test/test_norm.py +0 -128
  51. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/LICENSE +0 -0
  52. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/MANIFEST.in +0 -0
  53. {owasp_depscan-5.5.0/depscan → owasp_depscan-6.0.0a2/depscan/lib}/__init__.py +0 -0
  54. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/depscan/lib/github.py +0 -0
  55. {owasp_depscan-5.5.0/depscan/lib → owasp_depscan-6.0.0a2/depscan/lib/package_query}/__init__.py +0 -0
  56. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/owasp_depscan.egg-info/dependency_links.txt +0 -0
  57. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/owasp_depscan.egg-info/entry_points.txt +0 -0
  58. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/owasp_depscan.egg-info/top_level.txt +0 -0
  59. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/setup.cfg +0 -0
  60. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/test/test_github.py +0 -0
  61. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/__init__.py +0 -0
  62. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_data/fields.yml +0 -0
  63. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_data/meta.yml +0 -0
  64. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_data/rules.yml +0 -0
  65. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/0bsd.txt +0 -0
  66. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/afl-3.0.txt +0 -0
  67. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/agpl-3.0.txt +0 -0
  68. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/apache-2.0.txt +0 -0
  69. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/artistic-2.0.txt +0 -0
  70. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/blueoak-1.0.0.txt +0 -0
  71. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/bsd-2-clause-patent.txt +0 -0
  72. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/bsd-2-clause.txt +0 -0
  73. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/bsd-3-clause-clear.txt +0 -0
  74. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/bsd-3-clause.txt +0 -0
  75. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/bsd-4-clause.txt +0 -0
  76. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/bsl-1.0.txt +0 -0
  77. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cc-by-4.0.txt +0 -0
  78. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cc-by-sa-4.0.txt +0 -0
  79. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cc0-1.0.txt +0 -0
  80. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/cecill-2.1.txt +0 -0
  81. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/ecl-2.0.txt +0 -0
  82. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/epl-1.0.txt +0 -0
  83. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/epl-2.0.txt +0 -0
  84. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/eupl-1.1.txt +0 -0
  85. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/eupl-1.2.txt +0 -0
  86. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/gfdl-1.3.txt +0 -0
  87. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/gpl-2.0.txt +0 -0
  88. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/gpl-3.0.txt +0 -0
  89. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/isc.txt +0 -0
  90. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/lgpl-2.1.txt +0 -0
  91. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/lgpl-3.0.txt +0 -0
  92. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/lppl-1.3c.txt +0 -0
  93. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/mit.txt +0 -0
  94. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/mpl-2.0.txt +0 -0
  95. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/ms-pl.txt +0 -0
  96. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/ms-rl.txt +0 -0
  97. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/mulanpsl-2.0.txt +0 -0
  98. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/ncsa.txt +0 -0
  99. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/odbl-1.0.txt +0 -0
  100. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/ofl-1.1.txt +0 -0
  101. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/osl-3.0.txt +0 -0
  102. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/postgresql.txt +0 -0
  103. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/unlicense.txt +0 -0
  104. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/upl-1.0.txt +0 -0
  105. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/vim.txt +0 -0
  106. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/wtfpl.txt +0 -0
  107. {owasp_depscan-5.5.0 → owasp_depscan-6.0.0a2}/vendor/choosealicense.com/_licenses/zlib.txt +0 -0
@@ -0,0 +1,390 @@
1
+ Metadata-Version: 2.4
2
+ Name: owasp-depscan
3
+ Version: 6.0.0a2
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-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/owasp-dep-scan/dep-scan
8
+ Project-URL: Bug-Tracker, https://github.com/owasp-dep-scan/dep-scan/issues
9
+ Project-URL: Funding, https://owasp.org/donate/?reponame=www-project-dep-scan&title=OWASP+depscan
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: Utilities
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: appthreat-vulnerability-db[oras]
24
+ Requires-Dist: custom-json-diff>=2.1.6
25
+ Requires-Dist: defusedxml>=0.7.1
26
+ Requires-Dist: PyYAML>=6.0.2
27
+ Requires-Dist: rich>=14.0.0
28
+ Requires-Dist: Jinja2>=3.1.6
29
+ Requires-Dist: packageurl-python>=0.16.0
30
+ Requires-Dist: cvss>=3.4
31
+ Requires-Dist: tomli>=2.2.1
32
+ Requires-Dist: ds-xbom-lib
33
+ Requires-Dist: ds-analysis-lib
34
+ Provides-Extra: dev
35
+ Requires-Dist: black>=25.1.0; extra == "dev"
36
+ Requires-Dist: flake8>=7.1.2; extra == "dev"
37
+ Requires-Dist: pytest>=8.3.4; extra == "dev"
38
+ Requires-Dist: pytest-cov>=6.0.0; extra == "dev"
39
+ Requires-Dist: httpretty>=1.1.4; extra == "dev"
40
+ Provides-Extra: server
41
+ Requires-Dist: quart>=0.20.0; extra == "server"
42
+ Provides-Extra: ext
43
+ Requires-Dist: atom-tools>=0.7.8; extra == "ext"
44
+ Requires-Dist: blint>=2.4.1; extra == "ext"
45
+ Requires-Dist: pdfkit>=1.0.0; extra == "ext"
46
+ Provides-Extra: perf
47
+ Requires-Dist: hishel[redis]>=0.1.1; extra == "perf"
48
+ Provides-Extra: all
49
+ Requires-Dist: atom-tools>=0.7.8; extra == "all"
50
+ Requires-Dist: blint>=2.4.1; extra == "all"
51
+ Requires-Dist: quart>=0.20.0; extra == "all"
52
+ Requires-Dist: pdfkit>=1.0.0; extra == "all"
53
+ Requires-Dist: PyGithub>=2.6.1; extra == "all"
54
+ Requires-Dist: hishel[redis]>=0.1.1; extra == "all"
55
+ Dynamic: license-file
56
+
57
+ # Introduction
58
+
59
+ OWASP dep-scan is a next-generation security and risk 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 integration with ASPM/VM platforms and in CI environments.
60
+
61
+ ![Depscan logo](dep-scan.png)
62
+
63
+ [![release](https://github.com/owasp-dep-scan/dep-scan/actions/workflows/pythonpublish.yml/badge.svg)](https://github.com/owasp-dep-scan/dep-scan/actions/workflows/pythonpublish.yml)
64
+
65
+ ## Contents
66
+
67
+ - [Features](#features)
68
+ - [Vulnerability Data sources](#vulnerability-data-sources)
69
+ - [Linux distros](#linux-distros)
70
+ - [Quick Start](#quick-start)
71
+ - [Scanning projects locally (Python version)](#scanning-projects-locally-python-version)
72
+ - [Scanning containers locally (Python version)](#scanning-containers-locally-python-version)
73
+ - [Scanning projects locally (Docker container)](#scanning-projects-locally-docker-container)
74
+ - [Server mode](#server-mode)
75
+ - [depscanGPT](https://chatgpt.com/g/g-674f260c887c819194e465d2c65f4061-owasp-dep-scan)
76
+ - [Documentation (depscan.readthedocs.io)](https://depscan.readthedocs.io)
77
+ - [Supported languages and package format](https://depscan.readthedocs.io/supported-languages)
78
+ - [Reachability analysis](https://depscan.readthedocs.io/reachability-analysis)
79
+ - [Example analysis for a Java project](https://depscan.readthedocs.io/reachability-analysis#example-analysis-for-a-java-project)
80
+ - [Example analysis for a JavaScript project](https://depscan.readthedocs.io/reachability-analysis#example-analysis-for-a-java-project)
81
+ - [Customization through environment variables](https://depscan.readthedocs.io/env-var#customization-through-environment-variables)
82
+ - [GitHub Security Advisory](https://depscan.readthedocs.io/adv-usage#github-security-advisory)
83
+ - [Suggest mode](https://depscan.readthedocs.io/adv-usage#suggest-mode)
84
+ - [Package Risk audit](https://depscan.readthedocs.io/adv-usage#package-risk-audit)
85
+ - [Automatic adjustment](https://depscan.readthedocs.io/adv-usage#automatic-adjustment)
86
+ - [Configuring weights](https://depscan.readthedocs.io/adv-usage#configuring-weights)
87
+ - [Live OS scan](https://depscan.readthedocs.io/adv-usage#live-os-scan)
88
+ - [License scan](https://depscan.readthedocs.io/adv-usage#license-scan)
89
+ - [Kubernetes and Cloud apps](https://depscan.readthedocs.io/adv-usage#kubernetes-and-cloud-apps)
90
+ - [PDF reports](https://depscan.readthedocs.io/adv-usage#pdf-reports)
91
+ - [Custom reports](https://depscan.readthedocs.io/adv-usage#custom-reports)
92
+ - [License](#license)
93
+
94
+ ## Features
95
+
96
+ - Scan most application code - local repos, Linux container images, Kubernetes manifests, and OS - to identify known CVEs with prioritization
97
+ - Perform advanced reachability analysis for multiple languages (See reachability analysis)
98
+ - Package vulnerability scanning is performed locally and is quite fast. No server is used!
99
+ - Generate Software Bill-of-Materials (SBOM) with Vulnerability Disclosure Report (VDR) information
100
+ - Generate a Common Security Advisory Framework (CSAF) 2.0 VEX document (check out the [CSAF Readme](contrib/CSAF_README.md))
101
+ - Perform deep packages risk audit for dependency confusion attacks and maintenance risks (See risk audit)
102
+
103
+ ### Precise Reachable data-flows
104
+
105
+ Detailed data flows to identify both reachable and non-reachable paths in your application based on the full context.
106
+
107
+ ![Reachable Flows](documentation/static/img/depscan-flows.png)
108
+
109
+ ### Clear insights about CVEs
110
+
111
+ Understand CVEs clearly without having to read through the description.
112
+
113
+ ![Dependency Tree with Insights](documentation/static/img/tree1.png)
114
+
115
+ ### Automatic prioritization
116
+
117
+ Only focus on CVEs that need your attention.
118
+
119
+ ![Prioritization](documentation/static/img/prioritization.png)
120
+
121
+ ### Stay proactive
122
+
123
+ Always stay a step ahead with advanced vulnerability and exploit prediction.
124
+
125
+ ![Proactive Measures](documentation/static/img/proactive.png)
126
+
127
+ ### Vulnerability Data sources
128
+
129
+ - OSV
130
+ - NVD
131
+ - GitHub
132
+ - NPM
133
+ - Linux [vuln-list](https://github.com/appthreat/vuln-list)
134
+
135
+ ### Linux distros
136
+
137
+ - AlmaLinux
138
+ - Debian
139
+ - Alpine
140
+ - Amazon Linux
141
+ - Arch Linux
142
+ - RHEL/CentOS
143
+ - Rocky Linux
144
+ - Ubuntu
145
+ - OpenSUSE/SLES
146
+ - Photon
147
+ - Chainguard
148
+ - Wolfi OS
149
+
150
+ Application vulnerabilities would be reported for all Linux distros and Windows. To download the full vulnerability database suitable for scanning OS, invoke dep-scan with `` for the first time. dep-scan would also download the appropriate database based on project type automatically.
151
+
152
+ ## Quick Start
153
+
154
+ dep-scan is ideal for use during continuous integration (CI) and as a local development tool.
155
+
156
+ ### Scanning projects locally (Python version)
157
+
158
+ ```bash
159
+ sudo npm install -g @cyclonedx/cdxgen
160
+ # Normal version recommended for most users (MIT)
161
+ pip install owasp-depscan
162
+
163
+ # For a full version with all extensions and server mode (Multiple Licenses)
164
+ pip install owasp-depscan[all]
165
+ ```
166
+
167
+ This would install two commands called `cdxgen` and `depscan`.
168
+
169
+ You can invoke the scan command directly with the various options.
170
+
171
+ ```bash
172
+ cd <project to scan>
173
+ depscan --src $PWD --reports-dir $PWD/reports
174
+ ```
175
+
176
+ The full list of options is below:
177
+
178
+ ```text
179
+ usage: depscan [-h] [--config CONFIG] [--no-banner] [-i SRC_DIR_IMAGE] [-o REPORTS_DIR] [--csaf]
180
+ [--profile {appsec,research,operational,threat-modeling,license-compliance,generic,machine-learning,ml,deep-learning,ml-deep,ml-tiny}]
181
+ [--lifecycle {pre-build,build,post-build} [{pre-build,build,post-build} ...]]
182
+ [--technique {auto,source-code-analysis,binary-analysis,manifest-analysis,hash-comparison,instrumentation,filename} [{auto,source-code-analysis,binary-analysis,manifest-analysis,hash-comparison,instrumentation,filename} ...]]
183
+ [--bom-engine {auto,CdxgenGenerator,CdxgenServerGenerator,CdxgenImageBasedGenerator,BlintGenerator} |
184
+ --vulnerability-analyzer {auto,VDRAnalyzer,LifecycleAnalyzer}] [--reachability-analyzer {off,FrameworkReachability,SemanticReachability}] [--no-suggest]
185
+ [--risk-audit] [--cdxgen-args CDXGEN_ARGS] [--private-ns PRIVATE_NS] [-t PROJECT_TYPE [PROJECT_TYPE ...]] [--bom BOM | --bom-dir BOM_DIR | --purl SEARCH_PURL]
186
+ [--report-template REPORT_TEMPLATE] [--report-name REPORT_NAME] [--deep] [--fuzzy-search] [--search-order {purl,pcu,cpe,cpu,url}] [--no-universal]
187
+ [--no-vuln-table] [--server] [--server-host SERVER_HOST] [--server-port SERVER_PORT] [--cdxgen-server CDXGEN_SERVER] [--debug] [-q | --explain] [-v]
188
+
189
+ Fully open-source security and license audit for application dependencies and container images based on known vulnerabilities and advisories.
190
+
191
+ options:
192
+ -h, --help show this help message and exit
193
+ --config CONFIG Path to the configuration file. Default: $PWD/.config/depscan.toml
194
+ --no-banner Do not display the logo and donation banner. Please make a donation to OWASP before using this argument.
195
+ -i, --src SRC_DIR_IMAGE
196
+ Source directory or container image or binary file
197
+ -o, --reports-dir REPORTS_DIR
198
+ Reports directory
199
+ --csaf Generate a OASIS CSAF VEX document
200
+ --profile {appsec,research,operational,threat-modeling,license-compliance,generic,machine-learning,ml,deep-learning,ml-deep,ml-tiny}
201
+ Profile to use while generating the BOM. For granular control, use the arguments --bom-engine, --vulnerability-analyzer, or --reachability-analyzer.
202
+ --lifecycle {pre-build,build,post-build} [{pre-build,build,post-build} ...]
203
+ Product lifecycle for the generated BOM. Multiple values allowed.
204
+ --technique {auto,source-code-analysis,binary-analysis,manifest-analysis,hash-comparison,instrumentation,filename} [{auto,source-code-analysis,binary-analysis,manifest-analysis,hash-comparison,instrumentation,filename} ...]
205
+ Analysis technique to use for BOM generation. Multiple values allowed.
206
+ --bom-engine {auto,CdxgenGenerator,CdxgenServerGenerator,CdxgenImageBasedGenerator,BlintGenerator}
207
+ BOM generation engine to use. Defaults to automatic selection based on project type and lifecycle.
208
+ --vulnerability-analyzer {auto,VDRAnalyzer,LifecycleAnalyzer}
209
+ Vulnerability analyzer to use. Defaults to automatic selection based on bom_dir argument.
210
+ --reachability-analyzer {off,FrameworkReachability,SemanticReachability}
211
+ Reachability analyzer to use. Default FrameworkReachability.
212
+ --no-suggest Disable suggest mode
213
+ --risk-audit Perform package risk audit (slow operation). Npm only.
214
+ --cdxgen-args CDXGEN_ARGS
215
+ Additional arguments to pass to cdxgen
216
+ --private-ns PRIVATE_NS
217
+ Private namespace to use while performing oss risk audit. Private packages should not be available in public registries by default. Comma separated
218
+ values accepted.
219
+ -t, --type PROJECT_TYPE [PROJECT_TYPE ...]
220
+ Override project types if auto-detection is incorrect. Multiple values supported.
221
+ --bom BOM Examine using the given Software Bill-of-Materials (SBOM) file in CycloneDX format. Use cdxgen command to produce one.
222
+ --bom-dir BOM_DIR Examine all the Bill-of-Materials (BOM) files in the given directory.
223
+ --purl SEARCH_PURL Scan a single package url.
224
+ --report-template REPORT_TEMPLATE
225
+ Jinja template file used for rendering a custom report
226
+ --report-name REPORT_NAME
227
+ Filename of the custom report written to the --reports-dir
228
+ --deep Perform deep scan by passing this --deep argument to cdxgen. Useful while scanning docker images and OS packages.
229
+ --fuzzy-search Perform fuzzy search by creating variations of package names. Use this when the input SBOM lacks a PURL.
230
+ --search-order {purl,pcu,cpe,cpu,url}
231
+ Attributes to use while searching for vulnerabilities. Default: PURL, CPE, URL (pcu).
232
+ --no-universal Depscan would attempt to perform a single universal scan instead of individual scans per language type.
233
+ --no-vuln-table Do not print the table with the full list of vulnerabilities. This can help reduce console output.
234
+ --server Run depscan as a server
235
+ --server-host SERVER_HOST
236
+ depscan server host
237
+ --server-port SERVER_PORT
238
+ depscan server port
239
+ --cdxgen-server CDXGEN_SERVER
240
+ cdxgen server url. Eg: http://cdxgen:9090
241
+ --debug Run depscan in debug mode.
242
+ -q, --quiet Makes depscan quiet.
243
+ --explain Makes depscan to explain the various analysis. Useful for creating detailed reports.
244
+ --explanation-mode {Endpoints,EndpointsAndReachables,NonReachables}
245
+ Style of explanation needed. Defaults to Endpoints and Reachables.
246
+ --annotate Include the generated text VDR report as an annotation. Defaults to true when explain is enabled; false otherwise.
247
+ -v, --version Display the version
248
+ ```
249
+
250
+ ### Scanning containers locally (Python version)
251
+
252
+ Scan a Java project.
253
+
254
+ ```bash
255
+ depscan --src <path> -o containertests -t java
256
+ ```
257
+
258
+ Scan `latest` tag of the container `shiftleft/scan-slim`
259
+
260
+ ```bash
261
+ depscan --src shiftleft/scan-slim -o containertests -t docker
262
+ ```
263
+
264
+ Include `license` to the type to perform the license audit.
265
+
266
+ ```bash
267
+ depscan --src shiftleft/scan-slim -o containertests -t docker license
268
+ ```
269
+
270
+ You can also specify the image using the sha256 digest
271
+
272
+ ```bash
273
+ depscan --src redmine@sha256:a5c5f8a64a0d9a436a0a6941bc3fb156be0c89996add834fe33b66ebeed2439e -o containertests -t docker
274
+ ```
275
+
276
+ You can also save container images using docker or podman save command and pass the archive to depscan for scanning.
277
+
278
+ ```bash
279
+ docker save -o /tmp/scanslim.tar shiftleft/scan-slim:latest
280
+ # podman save --format oci-archive -o /tmp/scanslim.tar shiftleft/scan-slim:latest
281
+ depscan --src /tmp/scanslim.tar -o reports -t docker
282
+ ```
283
+
284
+ Refer to the docker tests under the GitHub action workflow for this repo for more examples.
285
+
286
+ ### Scanning projects locally (Docker container)
287
+
288
+ `ghcr.io/owasp-dep-scan/dep-scan` container image can be used to perform the scan.
289
+
290
+ To scan with default settings
291
+
292
+ ```bash
293
+ docker run --rm -v $PWD:/app ghcr.io/owasp-dep-scan/dep-scan depscan --src /app --reports-dir /app/reports
294
+ ```
295
+
296
+ To scan with custom environment variables based configuration
297
+
298
+ ```bash
299
+ docker run --rm \
300
+ -e VDB_HOME=/db \
301
+ -e GITHUB_TOKEN=<token> \
302
+ -v /tmp:/db \
303
+ -v $PWD:/app ghcr.io/owasp-dep-scan/dep-scan depscan --src /app --reports-dir /app/reports
304
+ ```
305
+
306
+ In the above example, `/tmp` is mounted as `/db` into the container. This directory is then specified as `VDB_HOME` for caching the vulnerability information. This way the database can be cached and reused to improve performance.
307
+
308
+ ### Server mode
309
+
310
+ dep-scan and cdxgen could be run in server mode. Use the included docker-compose file to get started.
311
+
312
+ ```bash
313
+ git clone https://github.com/owasp-dep-scan/dep-scan
314
+ docker compose up
315
+ ```
316
+
317
+ ```bash
318
+ depscan --server --server-host 0.0.0.0 --server-port 7070
319
+ ```
320
+
321
+ In server mode, use the `/download-vdb` endpoint to cache the vulnerability database.
322
+
323
+ ```bash
324
+ # This would take over 2 minutes
325
+ curl http://0.0.0.0:7070/download-vdb
326
+ ```
327
+
328
+ Use the `/scan` endpoint to perform scans.
329
+
330
+ > [!NOTE]
331
+ > The `type` parameter is mandatory in server mode.
332
+
333
+ - Scanning a local directory.
334
+ Scanning an SBOM file (present locally).
335
+
336
+ ```bash
337
+ curl --json '{"path": "/tmp/vulnerable-aws-koa-app/sbom_file.json", "type": "js"}' http://0.0.0.0:7070/scan
338
+ ```
339
+
340
+ - Scanning a GitHub repo.
341
+
342
+ ```bash
343
+ curl --json '{"url": "https://github.com/HooliCorp/vulnerable-aws-koa-app", "type": "js"}' http://0.0.0.0:7070/scan -o app.vdr.json
344
+ ```
345
+
346
+ - Uploading an SBOM file and generating results based on it.
347
+
348
+ ```bash
349
+ curl -X POST -H 'Content-Type: multipart/form-data' -F 'file=@/tmp/app/sbom_file.json' http://0.0.0.0:7070/scan?type=js
350
+ ```
351
+
352
+ ## Local development
353
+
354
+ Setup uv by following the official [documentation](https://docs.astral.sh/uv/).
355
+
356
+ ```shell
357
+ uv sync --all-extras --all-packages
358
+ uv run depscan --help
359
+ uv run pytest
360
+ ```
361
+
362
+ ### Local VDB setup
363
+
364
+ ```shell
365
+ vdb --clean
366
+ vdb --download-image
367
+ # To scan containers and OS images
368
+ # vdb --download-full-image
369
+ ```
370
+
371
+ ### Scan local depscan
372
+
373
+ ```shell
374
+ uv run depscan --config .config/depscan-dev.toml
375
+ ```
376
+
377
+ This would automatically use the configuration specified in the local config [file](./.config/depscan.toml).
378
+
379
+ ## License
380
+
381
+ MIT License
382
+
383
+ This project was donated to the OWASP Foundation in August 2023 by AppThreat Ltd.
384
+
385
+ ## Funding
386
+
387
+ This project is funded through [NGI Zero Core](https://nlnet.nl/core), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page](https://nlnet.nl/project/OWASP-dep-scan).
388
+
389
+ [<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl)
390
+ [<img src="https://nlnet.nl/image/logos/NGI0_tag.svg" alt="NGI Zero Logo" width="20%" />](https://nlnet.nl/core)