owasp-depscan 5.4.8__py3-none-any.whl → 6.0.0a2__py3-none-any.whl
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.
- depscan/__init__.py +8 -0
- depscan/cli.py +719 -827
- depscan/cli_options.py +302 -0
- depscan/lib/audit.py +3 -1
- depscan/lib/bom.py +390 -288
- depscan/lib/config.py +86 -337
- depscan/lib/explainer.py +363 -98
- depscan/lib/license.py +11 -10
- depscan/lib/logger.py +65 -17
- depscan/lib/package_query/__init__.py +0 -0
- depscan/lib/package_query/cargo_pkg.py +124 -0
- depscan/lib/package_query/metadata.py +170 -0
- depscan/lib/package_query/npm_pkg.py +345 -0
- depscan/lib/package_query/pkg_query.py +195 -0
- depscan/lib/package_query/pypi_pkg.py +113 -0
- depscan/lib/tomlparse.py +116 -0
- depscan/lib/utils.py +34 -188
- owasp_depscan-6.0.0a2.dist-info/METADATA +390 -0
- {owasp_depscan-5.4.8.dist-info → owasp_depscan-6.0.0a2.dist-info}/RECORD +28 -25
- {owasp_depscan-5.4.8.dist-info → owasp_depscan-6.0.0a2.dist-info}/WHEEL +1 -1
- vendor/choosealicense.com/_licenses/cern-ohl-p-2.0.txt +1 -1
- vendor/choosealicense.com/_licenses/cern-ohl-s-2.0.txt +1 -1
- vendor/choosealicense.com/_licenses/cern-ohl-w-2.0.txt +2 -2
- vendor/choosealicense.com/_licenses/mit-0.txt +1 -1
- vendor/spdx/json/licenses.json +904 -677
- depscan/lib/analysis.py +0 -1550
- depscan/lib/csaf.py +0 -1860
- depscan/lib/normalize.py +0 -312
- depscan/lib/orasclient.py +0 -142
- depscan/lib/pkg_query.py +0 -532
- owasp_depscan-5.4.8.dist-info/METADATA +0 -580
- {owasp_depscan-5.4.8.dist-info → owasp_depscan-6.0.0a2.dist-info}/entry_points.txt +0 -0
- {owasp_depscan-5.4.8.dist-info → owasp_depscan-6.0.0a2.dist-info/licenses}/LICENSE +0 -0
- {owasp_depscan-5.4.8.dist-info → owasp_depscan-6.0.0a2.dist-info}/top_level.txt +0 -0
depscan/lib/config.py
CHANGED
|
@@ -52,115 +52,6 @@ if not exists(license_data_dir):
|
|
|
52
52
|
)
|
|
53
53
|
)
|
|
54
54
|
|
|
55
|
-
# CPE Vendor aliases
|
|
56
|
-
vendor_alias = {
|
|
57
|
-
"org.apache.commons.io": "commons-io",
|
|
58
|
-
"org.apache.logging.log4j": "log4j",
|
|
59
|
-
"org.apache.commons.beanutils": "commons-beanutils",
|
|
60
|
-
"org.apache.commons.collections": "commons-collections",
|
|
61
|
-
"org.apache.solr": "apache_solr",
|
|
62
|
-
"org.springframework": "pivotal_software",
|
|
63
|
-
"io.undertow": "redhat",
|
|
64
|
-
"ch.qos.logback": "logback",
|
|
65
|
-
"ch.qos.slf4j": "slf4j",
|
|
66
|
-
"org.yaml": "snakeyaml_project",
|
|
67
|
-
"org.hibernate.validator": "org.hibernate",
|
|
68
|
-
"org.hibernate": "redhat",
|
|
69
|
-
"org.dom4j": "dom4j_project",
|
|
70
|
-
"ant": "apache",
|
|
71
|
-
"commons-": "apache",
|
|
72
|
-
"org.quartz-scheduler": "softwareag",
|
|
73
|
-
"org.mitre": "mitreid",
|
|
74
|
-
"io.micronaut": "objectcomputing",
|
|
75
|
-
"twistedmatrix": "twisted",
|
|
76
|
-
"oneup": "1up",
|
|
77
|
-
"io.ktor": "jetbrains",
|
|
78
|
-
"com.puppycrawl.tools": "checkstyle",
|
|
79
|
-
"org.opencastproject": "apereo",
|
|
80
|
-
"bagisto": "webkul",
|
|
81
|
-
"ro.pippo": "pippo",
|
|
82
|
-
"ca.uhn.hapi.fhir": "fhir",
|
|
83
|
-
"tensorflow": "google",
|
|
84
|
-
"ansible": "redhat",
|
|
85
|
-
"io.springfox": "smartbear",
|
|
86
|
-
"log4net": "apache",
|
|
87
|
-
"github": "github actions",
|
|
88
|
-
"microsoft": "azure",
|
|
89
|
-
"phenx": "dompdf",
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
# Package aliases
|
|
93
|
-
package_alias = {
|
|
94
|
-
"struts2-core": "struts",
|
|
95
|
-
"struts2-rest-plugin": "struts",
|
|
96
|
-
"struts2-showcase": "struts",
|
|
97
|
-
"jackson-databind": "jackson",
|
|
98
|
-
"apache_tomcat": "tomcat",
|
|
99
|
-
"tomcat_native": "tomcat",
|
|
100
|
-
"tomcat_connectors": "tomcat",
|
|
101
|
-
"tomcat_jk_connector": "tomcat",
|
|
102
|
-
"tomcat-embed-core": "tomcat",
|
|
103
|
-
"spring-security-core": "spring_security",
|
|
104
|
-
"spring-security-crypto": "spring_security",
|
|
105
|
-
"asciidoctorj": "asciidoctor",
|
|
106
|
-
"postgresql": "postgresql_jdbc_driver",
|
|
107
|
-
"itextpdf": "itext",
|
|
108
|
-
"httpclient": "commons-httpclient",
|
|
109
|
-
"priority": "python_priority_library",
|
|
110
|
-
"rocketmq-broker": "rocketmq",
|
|
111
|
-
"mysql_connector": "mysql-connector-java",
|
|
112
|
-
"jhipster_kotlin": "jhipster",
|
|
113
|
-
"spring-cloud-config-server": "spring_cloud_config",
|
|
114
|
-
"django-rest-framework-json_web_tokens": "drf-jwt",
|
|
115
|
-
"beam-sdks-java-io-mongodb": "beam",
|
|
116
|
-
"sm-core-model": "shopizer",
|
|
117
|
-
"openid-connect-server": "connect",
|
|
118
|
-
"http4s-server_2.12": "http4s",
|
|
119
|
-
"santuario_xml_security_for_java": "xmlsec",
|
|
120
|
-
"uploader-bundle": "oneupuploaderbundle",
|
|
121
|
-
"odata-client-core": "olingo",
|
|
122
|
-
"odata-client-proxy": "olingo",
|
|
123
|
-
"odata-server-core": "olingo",
|
|
124
|
-
"syliusresourcebundle": "sylius",
|
|
125
|
-
"ethereum_name_service": "ens",
|
|
126
|
-
"tensorflow-gpu": "tensorflow",
|
|
127
|
-
"tensorflow-cpu": "tensorflow",
|
|
128
|
-
"class.upload.php": "verot",
|
|
129
|
-
"redis_wrapper": "rediswrapper",
|
|
130
|
-
"silverstripe-versionedfiles": "versionedfiles",
|
|
131
|
-
"simplesamlphp-module-proxystatistics": "proxystatistics",
|
|
132
|
-
"pac4j-saml": "pac4j",
|
|
133
|
-
"universal_office_converter": "unoconv",
|
|
134
|
-
"hapi-fhir-base": "hapi_fhir",
|
|
135
|
-
"spring-data-jpa": "spring_data_java_persistance_api",
|
|
136
|
-
"sanselan": "commons_imaging",
|
|
137
|
-
"uima-ducc-web": "unstructured_information_management_architecture_distributed_uima_cluster_computing",
|
|
138
|
-
"arrow-ank-gradle": "arrow",
|
|
139
|
-
"openpgpjs": "openpgp",
|
|
140
|
-
"storm-kafka": "storm",
|
|
141
|
-
"storm-kafka-client": "storm",
|
|
142
|
-
"tika-parsers": "tika",
|
|
143
|
-
"ironic-discoverd": "ironic_inspector",
|
|
144
|
-
"hawkbit-ui": "hawkbit",
|
|
145
|
-
"hawkbit-starters": "hawkbit",
|
|
146
|
-
"hawkbit-boot-starter": "hawkbit",
|
|
147
|
-
"software_development_kit": "splunk-sdk",
|
|
148
|
-
"jira_software_data_center": "jira",
|
|
149
|
-
"springfox-swagger2": "swagger_ui",
|
|
150
|
-
"spring-web": "spring_framework",
|
|
151
|
-
"springfox-swagger-ui": "swagger_ui",
|
|
152
|
-
"hibernate-core": "hibernate_orm",
|
|
153
|
-
"json-smart": "json-smart-v2",
|
|
154
|
-
"ojdbc7": "jdbc",
|
|
155
|
-
"System.Text": ".net",
|
|
156
|
-
"System.Net": "asp.net_core",
|
|
157
|
-
"Microsoft.IdentityModel.Clients.ActiveDirectory": "active_directory_authentication_library",
|
|
158
|
-
"starkbank_ecdsa": "ecdsa-elixir",
|
|
159
|
-
"php-pear": "pear-core-minimal",
|
|
160
|
-
"Selenium.WebDriver": "selenium",
|
|
161
|
-
"selenium": "selenium",
|
|
162
|
-
"numpy": "numpy"
|
|
163
|
-
}
|
|
164
55
|
|
|
165
56
|
# Default ignore list
|
|
166
57
|
ignore_directories = [
|
|
@@ -194,85 +85,6 @@ ignore_directories = [
|
|
|
194
85
|
"mocks",
|
|
195
86
|
]
|
|
196
87
|
|
|
197
|
-
# Package types allowed for each language
|
|
198
|
-
LANG_PKG_TYPES = {
|
|
199
|
-
"python": "pypi",
|
|
200
|
-
"java": "maven",
|
|
201
|
-
"jvm": "maven",
|
|
202
|
-
"groovy": "maven",
|
|
203
|
-
"kotlin": "maven",
|
|
204
|
-
"scala": "maven",
|
|
205
|
-
"jenkins": "maven",
|
|
206
|
-
"js": "npm",
|
|
207
|
-
"javascript": "npm",
|
|
208
|
-
"nodejs": "npm",
|
|
209
|
-
"node.js": "npm",
|
|
210
|
-
"npmjs": "npm",
|
|
211
|
-
"go": "golang",
|
|
212
|
-
"golang": "golang",
|
|
213
|
-
"ruby": "gem",
|
|
214
|
-
"php": "composer",
|
|
215
|
-
"dotnet": "nuget",
|
|
216
|
-
"csharp": "nuget",
|
|
217
|
-
"rust": "cargo",
|
|
218
|
-
"crates": "cargo",
|
|
219
|
-
"dart": "pub",
|
|
220
|
-
"cpp": "conan",
|
|
221
|
-
"clojure": "clojars",
|
|
222
|
-
"haskell": "hackage",
|
|
223
|
-
"elixir": "hex",
|
|
224
|
-
"github actions": "github",
|
|
225
|
-
"github": "github",
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
# OS Package types
|
|
229
|
-
OS_PKG_TYPES = (
|
|
230
|
-
"deb",
|
|
231
|
-
"apk",
|
|
232
|
-
"rpm",
|
|
233
|
-
"swid",
|
|
234
|
-
"alpm",
|
|
235
|
-
"docker",
|
|
236
|
-
"oci",
|
|
237
|
-
"container",
|
|
238
|
-
"generic",
|
|
239
|
-
"qpkg",
|
|
240
|
-
"buildroot",
|
|
241
|
-
"coreos",
|
|
242
|
-
"ebuild",
|
|
243
|
-
"alpine",
|
|
244
|
-
"alma",
|
|
245
|
-
"almalinux",
|
|
246
|
-
"debian",
|
|
247
|
-
"ubuntu",
|
|
248
|
-
"amazon",
|
|
249
|
-
"rhel",
|
|
250
|
-
"redhat",
|
|
251
|
-
"rocky",
|
|
252
|
-
"arch",
|
|
253
|
-
"suse",
|
|
254
|
-
"photon",
|
|
255
|
-
"microsoft",
|
|
256
|
-
"wolfi",
|
|
257
|
-
"chainguard",
|
|
258
|
-
)
|
|
259
|
-
|
|
260
|
-
# List of Linux distros with support for editions
|
|
261
|
-
LINUX_DISTRO_WITH_EDITIONS = (
|
|
262
|
-
"debian",
|
|
263
|
-
"ubuntu",
|
|
264
|
-
"alpine",
|
|
265
|
-
"rhel",
|
|
266
|
-
"redhat",
|
|
267
|
-
"arch",
|
|
268
|
-
"suse",
|
|
269
|
-
"photon",
|
|
270
|
-
"alma",
|
|
271
|
-
"almalinux",
|
|
272
|
-
"amazon",
|
|
273
|
-
"rocky",
|
|
274
|
-
)
|
|
275
|
-
|
|
276
88
|
|
|
277
89
|
def get_float_from_env(name, default):
|
|
278
90
|
"""
|
|
@@ -304,41 +116,36 @@ def get_int_from_env(name, default):
|
|
|
304
116
|
return int(get_float_from_env(name, default))
|
|
305
117
|
|
|
306
118
|
|
|
307
|
-
|
|
308
|
-
npm_app_info = {"name": "
|
|
119
|
+
NPM_SERVER = "https://registry.npmjs.org"
|
|
120
|
+
npm_app_info = {"name": "owasp-depscan", "version": "6.0.0"}
|
|
309
121
|
|
|
310
|
-
|
|
122
|
+
PYPI_SERVER = "https://pypi.org/pypi"
|
|
311
123
|
|
|
312
|
-
|
|
313
|
-
vdb_rafs_database_url = os.getenv(
|
|
314
|
-
"VDB_RAFS_DATABASE_URL", "ghcr.io/appthreat/vdb:v5-rafs"
|
|
315
|
-
)
|
|
124
|
+
CARGO_SERVER = "https://crates.io/api/v1/crates"
|
|
316
125
|
|
|
317
|
-
#
|
|
318
|
-
|
|
319
|
-
vdb_database_url = os.getenv("VDB_APP_DATABASE_URL", "ghcr.io/appthreat/vdbgz-app:v5")
|
|
320
|
-
vdb_rafs_database_url = os.getenv("VDB_APP_RAFS_DATABASE_URL", "ghcr.io/appthreat/vdb-app:v5-rafs")
|
|
126
|
+
# Use the env variable VDB_DATABASE_URL=ghcr.io/appthreat/vdbxz-app:v6.4.x for app-only database
|
|
127
|
+
vdb_database_url = os.getenv("VDB_DATABASE_URL", "ghcr.io/appthreat/vdbxz:v6.4.x")
|
|
321
128
|
|
|
322
129
|
# Larger 10 year database
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
130
|
+
vdb_10y_database_url = os.getenv(
|
|
131
|
+
"VDB_10Y_DATABASE_URL", "ghcr.io/appthreat/vdbxz-10y:v6.4.x"
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
if os.getenv("USE_VDB_10Y", "") in ("true", "1"):
|
|
135
|
+
vdb_database_url = vdb_10y_database_url
|
|
136
|
+
|
|
137
|
+
# How old vdb can be before it gets re-downloaded. 48 hours.
|
|
138
|
+
VDB_AGE_HOURS = get_int_from_env("VDB_AGE_HOURS", 48)
|
|
332
139
|
|
|
333
140
|
# Package risk scoring using a simple weighted formula with no backing
|
|
334
141
|
# research All parameters and their max value and weight can be overridden
|
|
335
142
|
# using environment variables
|
|
336
143
|
|
|
337
144
|
# Some constants and defaults
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
145
|
+
SECONDS_IN_DAY = 24 * 60 * 60
|
|
146
|
+
SECONDS_IN_HOUR = 60 * 60
|
|
147
|
+
DEFAULT_MAX_VALUE = 100
|
|
148
|
+
DEFAULT_WEIGHT = 1
|
|
342
149
|
|
|
343
150
|
# Package should have at least 3 versions
|
|
344
151
|
pkg_min_versions = get_float_from_env("pkg_min_versions", 3)
|
|
@@ -347,33 +154,29 @@ pkg_min_versions_weight = get_float_from_env("pkg_min_versions_weight", 2)
|
|
|
347
154
|
|
|
348
155
|
# At least 12 hours difference between the creation and modified time
|
|
349
156
|
mod_create_min_seconds = get_float_from_env(
|
|
350
|
-
"mod_create_min_seconds", 12 *
|
|
157
|
+
"mod_create_min_seconds", 12 * SECONDS_IN_HOUR
|
|
351
158
|
)
|
|
352
159
|
mod_create_min_seconds_max = get_float_from_env(
|
|
353
|
-
"mod_create_min_seconds_max", 1000 *
|
|
354
|
-
)
|
|
355
|
-
mod_create_min_seconds_weight = get_float_from_env(
|
|
356
|
-
"mod_create_min_seconds_weight", 1
|
|
160
|
+
"mod_create_min_seconds_max", 1000 * SECONDS_IN_DAY
|
|
357
161
|
)
|
|
162
|
+
mod_create_min_seconds_weight = get_float_from_env("mod_create_min_seconds_weight", 1)
|
|
358
163
|
|
|
359
164
|
# At least 12 hours difference between the latest version and the current time
|
|
360
165
|
latest_now_min_seconds = get_float_from_env(
|
|
361
|
-
"latest_now_min_seconds", 12 *
|
|
166
|
+
"latest_now_min_seconds", 12 * SECONDS_IN_HOUR
|
|
362
167
|
)
|
|
363
168
|
latest_now_min_seconds_max = get_float_from_env(
|
|
364
|
-
"latest_now_min_seconds_max", 1000 *
|
|
365
|
-
)
|
|
366
|
-
latest_now_min_seconds_weight = get_float_from_env(
|
|
367
|
-
"latest_now_min_seconds_weight", 0.5
|
|
169
|
+
"latest_now_min_seconds_max", 1000 * SECONDS_IN_DAY
|
|
368
170
|
)
|
|
171
|
+
latest_now_min_seconds_weight = get_float_from_env("latest_now_min_seconds_weight", 0.5)
|
|
369
172
|
|
|
370
173
|
# Time period after which certain risks can be considered safe. Quarantine
|
|
371
174
|
# period For eg: Packages that are over 1 year old
|
|
372
175
|
created_now_quarantine_seconds = get_float_from_env(
|
|
373
|
-
"created_now_quarantine_seconds", 365 *
|
|
176
|
+
"created_now_quarantine_seconds", 365 * SECONDS_IN_DAY
|
|
374
177
|
)
|
|
375
178
|
created_now_quarantine_seconds_max = get_float_from_env(
|
|
376
|
-
"created_now_quarantine_seconds_max", 365 *
|
|
179
|
+
"created_now_quarantine_seconds_max", 365 * SECONDS_IN_DAY
|
|
377
180
|
)
|
|
378
181
|
created_now_quarantine_seconds_weight = get_float_from_env(
|
|
379
182
|
"created_now_quarantine_seconds_weight", 0.5
|
|
@@ -381,18 +184,16 @@ created_now_quarantine_seconds_weight = get_float_from_env(
|
|
|
381
184
|
|
|
382
185
|
# Max package age - 6 years
|
|
383
186
|
latest_now_max_seconds = get_float_from_env(
|
|
384
|
-
"latest_now_max_seconds", 6 * 365 *
|
|
187
|
+
"latest_now_max_seconds", 6 * 365 * SECONDS_IN_DAY
|
|
385
188
|
)
|
|
386
189
|
latest_now_max_seconds_max = get_float_from_env(
|
|
387
|
-
"latest_now_max_seconds_max", 6 * 365 *
|
|
388
|
-
)
|
|
389
|
-
latest_now_max_seconds_weight = get_float_from_env(
|
|
390
|
-
"latest_now_max_seconds_weight", 0.5
|
|
190
|
+
"latest_now_max_seconds_max", 6 * 365 * SECONDS_IN_DAY
|
|
391
191
|
)
|
|
192
|
+
latest_now_max_seconds_weight = get_float_from_env("latest_now_max_seconds_weight", 0.5)
|
|
392
193
|
|
|
393
194
|
# Package should have at least 2 maintainers
|
|
394
195
|
pkg_min_maintainers = get_float_from_env("pkg_min_maintainers", 2)
|
|
395
|
-
pkg_min_maintainers_max = get_float_from_env("pkg_min_maintainers_max",
|
|
196
|
+
pkg_min_maintainers_max = get_float_from_env("pkg_min_maintainers_max", 20)
|
|
396
197
|
pkg_min_maintainers_weight = get_float_from_env("pkg_min_maintainers_weight", 2)
|
|
397
198
|
|
|
398
199
|
# Package should have at least 2 users
|
|
@@ -405,13 +206,29 @@ pkg_install_scripts_max = get_float_from_env("pkg_install_scripts_max", 0)
|
|
|
405
206
|
pkg_install_scripts_weight = get_float_from_env("pkg_install_scripts_weight", 2)
|
|
406
207
|
|
|
407
208
|
# Node version risk
|
|
408
|
-
pkg_node_version = os.getenv("pkg_node_version".upper(), "0.,4,6")
|
|
209
|
+
pkg_node_version = os.getenv("pkg_node_version".upper(), "0.,4,6,8,10,12")
|
|
409
210
|
pkg_node_version_max = get_float_from_env("pkg_node_version_max", 16)
|
|
410
211
|
pkg_node_version_weight = get_float_from_env("pkg_node_version_weight", 0.5)
|
|
411
212
|
|
|
412
213
|
# Package deprecated
|
|
413
|
-
pkg_deprecated_weight = get_float_from_env("pkg_deprecated_weight",
|
|
414
|
-
pkg_deprecated_max = get_float_from_env("pkg_deprecated_max",
|
|
214
|
+
pkg_deprecated_weight = get_float_from_env("pkg_deprecated_weight", 2)
|
|
215
|
+
pkg_deprecated_max = get_float_from_env("pkg_deprecated_max", 0)
|
|
216
|
+
|
|
217
|
+
# Package version deprecated
|
|
218
|
+
pkg_version_deprecated_weight = get_float_from_env("pkg_version_deprecated_weight", 2)
|
|
219
|
+
pkg_version_deprecated_max = get_float_from_env("pkg_version_deprecated_max", 0)
|
|
220
|
+
|
|
221
|
+
# Package version missing
|
|
222
|
+
pkg_version_missing_weight = get_float_from_env("pkg_version_missing_weight", 2)
|
|
223
|
+
pkg_version_missing_max = get_float_from_env("pkg_version_missing_max", 0)
|
|
224
|
+
|
|
225
|
+
# Package includes binary
|
|
226
|
+
pkg_includes_binary_weight = get_float_from_env("pkg_includes_binary_weight", 2)
|
|
227
|
+
pkg_includes_binary_max = get_float_from_env("pkg_includes_binary_max", 0)
|
|
228
|
+
|
|
229
|
+
# Package has attestation
|
|
230
|
+
pkg_attested_weight = get_float_from_env("pkg_attested_weight", -2)
|
|
231
|
+
pkg_attested_max = get_float_from_env("pkg_attested_max", 0)
|
|
415
232
|
|
|
416
233
|
# Package dependency confusion
|
|
417
234
|
pkg_private_on_public_registry_weight = get_float_from_env(
|
|
@@ -442,20 +259,12 @@ total_weight = (
|
|
|
442
259
|
+ pkg_required_scope_weight
|
|
443
260
|
+ pkg_optional_scope_weight
|
|
444
261
|
+ pkg_deprecated_weight
|
|
262
|
+
+ pkg_version_deprecated_weight
|
|
263
|
+
+ pkg_version_missing_weight
|
|
264
|
+
+ pkg_includes_binary_weight
|
|
445
265
|
+ pkg_private_on_public_registry_weight
|
|
446
266
|
)
|
|
447
267
|
|
|
448
|
-
# Help text for various risk
|
|
449
|
-
risk_help_text = {
|
|
450
|
-
"pkg_min_versions": "Has fewer versions",
|
|
451
|
-
"latest_now_min_seconds": "Recently updated",
|
|
452
|
-
"latest_now_max_seconds": "No recent updates",
|
|
453
|
-
"pkg_min_maintainers": "Has fewer maintainers",
|
|
454
|
-
"pkg_node_version": "Outdated Node version",
|
|
455
|
-
"pkg_install_scripts": "Runs scripts on install",
|
|
456
|
-
"pkg_deprecated": "Deprecated",
|
|
457
|
-
"pkg_private_on_public_registry": "Private package is public",
|
|
458
|
-
}
|
|
459
268
|
|
|
460
269
|
# Package max risk score. All packages above this level will be reported
|
|
461
270
|
pkg_max_risk_score = get_float_from_env("pkg_max_risk_score", 0.5)
|
|
@@ -471,102 +280,42 @@ UNIVERSAL_SCAN_TYPE = "universal"
|
|
|
471
280
|
|
|
472
281
|
max_reachable_explanations = get_int_from_env("max_reachable_explanations", 20)
|
|
473
282
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
OS_VULN_KEY_CWES = (
|
|
478
|
-
20,
|
|
479
|
-
23,
|
|
480
|
-
24,
|
|
481
|
-
25,
|
|
482
|
-
26,
|
|
483
|
-
27,
|
|
484
|
-
28,
|
|
485
|
-
29,
|
|
486
|
-
30,
|
|
487
|
-
31,
|
|
488
|
-
32,
|
|
489
|
-
33,
|
|
490
|
-
34,
|
|
491
|
-
35,
|
|
492
|
-
36,
|
|
493
|
-
37,
|
|
494
|
-
38,
|
|
495
|
-
39,
|
|
496
|
-
40,
|
|
497
|
-
58,
|
|
498
|
-
61,
|
|
499
|
-
62,
|
|
500
|
-
64,
|
|
501
|
-
65,
|
|
502
|
-
67,
|
|
503
|
-
69,
|
|
504
|
-
73,
|
|
505
|
-
77,
|
|
506
|
-
78,
|
|
507
|
-
79,
|
|
508
|
-
91,
|
|
509
|
-
119,
|
|
510
|
-
120,
|
|
511
|
-
121,
|
|
512
|
-
122,
|
|
513
|
-
125,
|
|
514
|
-
126,
|
|
515
|
-
127,
|
|
516
|
-
200,
|
|
517
|
-
250,
|
|
518
|
-
264,
|
|
519
|
-
269,
|
|
520
|
-
279,
|
|
521
|
-
416,
|
|
522
|
-
422,
|
|
523
|
-
439,
|
|
524
|
-
502,
|
|
525
|
-
506,
|
|
526
|
-
507,
|
|
527
|
-
508,
|
|
528
|
-
509,
|
|
529
|
-
510,
|
|
530
|
-
511,
|
|
531
|
-
512,
|
|
532
|
-
514,
|
|
533
|
-
515,
|
|
534
|
-
552,
|
|
535
|
-
553,
|
|
536
|
-
786,
|
|
537
|
-
787,
|
|
538
|
-
788,
|
|
539
|
-
789,
|
|
540
|
-
862,
|
|
541
|
-
1386,
|
|
283
|
+
# How many explanations for a given combination of purls
|
|
284
|
+
max_purls_reachable_explanations = get_int_from_env(
|
|
285
|
+
"max_purls_reachable_explanations", 3
|
|
542
286
|
)
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
OS_PKG_UNINSTALLABLE = (
|
|
547
|
-
"openssh",
|
|
548
|
-
"cups",
|
|
549
|
-
"imagemagick",
|
|
550
|
-
"curl",
|
|
551
|
-
"tar",
|
|
552
|
-
"git",
|
|
553
|
-
"avahi",
|
|
554
|
-
"libssh",
|
|
555
|
-
"subversion",
|
|
556
|
-
"vim",
|
|
557
|
-
"vim-minimal",
|
|
287
|
+
max_source_reachable_explanations = get_int_from_env(
|
|
288
|
+
"max_source_reachable_explanations", 2
|
|
558
289
|
)
|
|
290
|
+
max_sink_reachable_explanations = get_int_from_env("max_sink_reachable_explanations", 2)
|
|
559
291
|
|
|
560
|
-
|
|
292
|
+
max_purl_per_flow = get_int_from_env("max_purl_per_flow", 8)
|
|
561
293
|
|
|
562
294
|
RUBY_PLATFORM_MARKERS = [
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
295
|
+
"-x86_64",
|
|
296
|
+
"-x86",
|
|
297
|
+
"-x64",
|
|
298
|
+
"-aarch",
|
|
299
|
+
"-arm",
|
|
300
|
+
"-ruby",
|
|
301
|
+
"-universal",
|
|
302
|
+
"-java",
|
|
303
|
+
"-truffle",
|
|
572
304
|
]
|
|
305
|
+
|
|
306
|
+
# List of suffixes used by npm packages to indicate binary versions.
|
|
307
|
+
# This could be replaced with a better heuristics or lookup database in the future.
|
|
308
|
+
NPM_BINARY_PACKAGES_SUFFIXES = ("-prebuilt",)
|
|
309
|
+
|
|
310
|
+
DEPSCAN_DEFAULT_VDR_FILE = os.getenv(
|
|
311
|
+
"DEPSCAN_DEFAULT_VDR_FILE", "depscan-universal.vdr.json"
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
COMMON_CHECK_TAGS = (
|
|
315
|
+
"validation",
|
|
316
|
+
"encode",
|
|
317
|
+
"encrypt",
|
|
318
|
+
"sanitize",
|
|
319
|
+
"authentication",
|
|
320
|
+
"authorization",
|
|
321
|
+
)
|