Skip to content

Commit a78d1c0

Browse files
authored
Merge pull request #1057 from nexB/970-migrate-apache-tomcat-importer
Migrate apache tomcat importer
2 parents 67558ec + bda1649 commit a78d1c0

File tree

8 files changed

+2128
-446
lines changed

8 files changed

+2128
-446
lines changed

vulnerabilities/importers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from vulnerabilities.importers import alpine_linux
1111
from vulnerabilities.importers import apache_httpd
12+
from vulnerabilities.importers import apache_tomcat
1213
from vulnerabilities.importers import archlinux
1314
from vulnerabilities.importers import debian
1415
from vulnerabilities.importers import debian_oval
@@ -55,6 +56,7 @@
5556
project_kb_msr2019.ProjectKBMSRImporter,
5657
suse_scores.SUSESeverityScoreImporter,
5758
elixir_security.ElixirSecurityImporter,
59+
apache_tomcat.ApacheTomcatImporter,
5860
]
5961

6062
IMPORTERS_REGISTRY = {x.qualified_name: x for x in IMPORTERS_REGISTRY}

vulnerabilities/importers/apache_tomcat.py

Lines changed: 488 additions & 104 deletions
Large diffs are not rendered by default.

vulnerabilities/severity_systems.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,27 @@ def compute(self, scoring_elements: str) -> str:
124124
name="Apache Httpd Severity",
125125
url="https://httpd.apache.org/security/impact_levels.html",
126126
)
127+
APACHE_HTTPD.choices = [
128+
"Critical",
129+
"Important",
130+
"Moderate",
131+
"Low",
132+
]
133+
134+
# This is essentially identical to apache_http except for the addition of the "High" score,
135+
# which seems to be used interchangeably for "Important".
136+
APACHE_TOMCAT = ScoringSystem(
137+
identifier="apache_tomcat",
138+
name="Apache Tomcat Severity",
139+
url="https://tomcat.apache.org/security-impact.html",
140+
)
141+
APACHE_TOMCAT.choices = [
142+
"Critical",
143+
"High",
144+
"Important",
145+
"Moderate",
146+
"Low",
147+
]
127148

128149
SCORING_SYSTEMS = {
129150
system.identifier: system
@@ -137,5 +158,6 @@ def compute(self, scoring_elements: str) -> str:
137158
CVSS31_QUALITY,
138159
GENERIC,
139160
APACHE_HTTPD,
161+
APACHE_TOMCAT,
140162
)
141163
}

vulnerabilities/tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def no_rmtree(monkeypatch):
2626
# Step 3: Migrate all the tests
2727
collect_ignore = [
2828
"test_apache_kafka.py",
29-
"test_apache_tomcat.py",
3029
"test_api.py",
3130
"test_models.py",
3231
"test_package_managers.py",

vulnerabilities/tests/test_apache_tomcat.py

Lines changed: 367 additions & 201 deletions
Large diffs are not rendered by default.

vulnerabilities/tests/test_data/apache_tomcat/apache_tomcat-selected-advisories.html

Lines changed: 395 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)