Skip to content

Commit f2c3cf5

Browse files
authored
Merge pull request DefectDojo#9893 from DefectDojo/release/2.33.1
Release: Merge release into master from: release/2.33.1
2 parents ca4250f + c9b0226 commit f2c3cf5

File tree

13 files changed

+6493
-26
lines changed

13 files changed

+6493
-26
lines changed

.github/workflows/fetch-oas.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
docker images
3434
3535
- name: Start Dojo
36-
run: docker-compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env up --no-deps -d postgres nginx uwsgi
36+
run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env up --no-deps -d postgres nginx uwsgi
3737
env:
3838
DJANGO_VERSION: ${{ env.release_version }}-alpine
3939
NGINX_VERSION: ${{ env.release_version }}-alpine
@@ -44,11 +44,11 @@ jobs:
4444
4545
- name: Logs
4646
if: always()
47-
run: docker-compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env logs --tail="2500"
47+
run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env logs --tail="2500"
4848

4949
- name: Shutdown
5050
if: always()
51-
run: docker-compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env down
51+
run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env down
5252

5353
- name: Upload oas.${{ matrix.file-type }} as artifact
5454
uses: actions/upload-artifact@v3

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
integration_tests:
8-
# run tests with docker-compose
8+
# run tests with docker compose
99
name: User Interface Tests
1010
runs-on: ubuntu-latest
1111
strategy:
@@ -61,34 +61,34 @@ jobs:
6161
# phased startup with MySQL and RabbitMQ so we can use the exit code from integrationtest container
6262
- name: Start Dojo MySQL + RabbitMQ
6363
if: matrix.profile == 'mysql-rabbitmq'
64-
run: docker-compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps -d mysql nginx celerybeat celeryworker mailhog uwsgi rabbitmq
64+
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps -d mysql nginx celerybeat celeryworker mailhog uwsgi rabbitmq
6565
env:
6666
DJANGO_VERSION: ${{ matrix.os }}
6767
NGINX_VERSION: ${{ matrix.os }}
6868

6969
- name: Start Dojo PostgreSQL + Redis
7070
if: matrix.profile == 'postgres-redis'
71-
run: docker-compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps -d postgres nginx celerybeat celeryworker mailhog uwsgi redis
71+
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps -d postgres nginx celerybeat celeryworker mailhog uwsgi redis
7272
env:
7373
DJANGO_VERSION: ${{ matrix.os }}
7474
NGINX_VERSION: ${{ matrix.os }}
7575

7676
- name: Initialize
77-
run: docker-compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps --exit-code-from initializer initializer
77+
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps --exit-code-from initializer initializer
7878
env:
7979
DJANGO_VERSION: ${{ matrix.os }}
8080
NGINX_VERSION: ${{ matrix.os }}
8181

8282
- name: Integration tests
83-
run: docker-compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps --exit-code-from integration-tests integration-tests
83+
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps --exit-code-from integration-tests integration-tests
8484
env:
8585
DD_INTEGRATION_TEST_FILENAME: ${{ matrix.test-case }}
8686
INTEGRATION_TESTS_VERSION: debian
8787

8888
- name: Logs
8989
if: always()
90-
run: docker-compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env logs --tail="2500"
90+
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env logs --tail="2500"
9191

9292
- name: Shutdown
9393
if: always()
94-
run: docker-compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env down
94+
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env down

.github/workflows/rest-framework-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ jobs:
2828
docker load -i django/django-${{ matrix.os }}_img
2929
docker images
3030
31-
# run tests with docker-compose
31+
# run tests with docker compose
3232
- name: Set unit-test mode
3333
run: docker/setEnv.sh unit_tests_cicd
3434

3535
# phased startup so we can use the exit code from unit test container
3636
- name: Start MySQL
37-
run: docker-compose --env-file ./docker/environments/mysql-redis.env up -d mysql
37+
run: docker compose --env-file ./docker/environments/mysql-redis.env up -d mysql
3838

3939
# no celery or initializer needed for unit tests
4040
- name: Unit tests
41-
run: docker-compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env up --no-deps --exit-code-from uwsgi uwsgi
41+
run: docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env up --no-deps --exit-code-from uwsgi uwsgi
4242
env:
4343
DJANGO_VERSION: ${{ matrix.os }}
4444

4545
- name: Logs
4646
if: failure()
47-
run: docker-compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env logs --tail="2500" uwsgi
47+
run: docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env logs --tail="2500" uwsgi
4848

4949
- name: Shutdown
5050
if: always()
51-
run: docker-compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env down
51+
run: docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env down

components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "defectdojo",
3-
"version": "2.33.0",
3+
"version": "2.33.1",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

dojo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Django starts so that shared_task will use this app.
55
from .celery import app as celery_app # noqa: F401
66

7-
__version__ = '2.33.0'
7+
__version__ = '2.33.1'
88
__url__ = 'https://github.com/DefectDojo/django-DefectDojo'
99
__docs__ = 'https://documentation.defectdojo.com'

dojo/tools/generic/parser.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def _get_findings_csv(self, filename):
173173
title=row["Title"],
174174
description=row["Description"],
175175
date=parse(row["Date"]).date(),
176-
severity=row["Severity"],
176+
severity=self.get_severity(row["Severity"]),
177177
duplicate=self._convert_bool(
178178
row.get("Duplicate", "FALSE")
179179
), # bool False by default
@@ -213,9 +213,6 @@ def _get_findings_csv(self, filename):
213213
# manage CWE
214214
if "CweId" in row:
215215
finding.cwe = int(row["CweId"])
216-
# FIXME remove this severity hack
217-
if finding.severity == "Unknown":
218-
finding.severity = "Info"
219216

220217
if "CVSSV3" in row:
221218
cvss_objects = cvss_parser.parse_cvss_from_text(row["CVSSV3"])
@@ -253,3 +250,9 @@ def _get_findings_csv(self, filename):
253250

254251
def _convert_bool(self, val):
255252
return val.lower()[0:1] == "t" # bool False by default
253+
254+
def get_severity(self, input):
255+
if input in ["Info", "Low", "Medium", "High", "Critical"]:
256+
return input
257+
else:
258+
return "Info"

dojo/tools/redhatsatellite/parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def get_findings(self, filename, test):
6060
description += "**hosts_available_count:** " + str(hosts_available_count) + "\n"
6161
description += "**hosts_applicable_count:** " + str(hosts_applicable_count) + "\n"
6262
description += "**installable:** " + str(installable) + "\n"
63-
description += "**cves:** " + str(cves) + "\n"
6463
description += "**bugs:** " + str(bugs) + "\n"
6564
description += "**module_streams:** " + str(module_streams) + "\n"
6665
find = Finding(
@@ -75,5 +74,8 @@ def get_findings(self, filename, test):
7574
if errata_id is not None:
7675
find.unsaved_vulnerability_ids = list()
7776
find.unsaved_vulnerability_ids.append(errata_id)
77+
if cves is not None:
78+
for cve in cves:
79+
find.unsaved_vulnerability_ids.append(cve["cve_id"])
7880
findings.append(find)
7981
return findings

dojo/tools/sslyze/parser_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def get_items(self, tree, test):
241241

242242

243243
def get_heartbleed(node, test, endpoint):
244-
if "heartbleed" in node:
244+
if "heartbleed" in node and node["heartbleed"] is not None:
245245
heartbleed = node["heartbleed"]
246246
if heartbleed.get("status") == "NOT_SCHEDULED":
247247
return None

dojo/tools/whitehat_sentinel/parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
import re
55
from typing import Union, List
6-
6+
from datetime import datetime
77
from dojo.models import Finding, Endpoint
88

99

@@ -203,6 +203,8 @@ def _convert_whitehat_sentinel_vulns_to_dojo_finding(
203203
for whitehat_vuln in whitehat_sentinel_vulns:
204204
date_created = whitehat_vuln["found"].split("T")[0]
205205
mitigated_ts = whitehat_vuln.get("closed".split("T")[0], None)
206+
if mitigated_ts is not None:
207+
mitigated_ts = datetime.strptime(mitigated_ts, "%Y-%m-%dT%H:%M:%SZ")
206208
cwe = self._parse_cwe_from_tags(
207209
whitehat_vuln["attack_vectors"][0].get("scanner_tags", [])
208210
)

helm/defectdojo/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
2-
appVersion: "2.33.0"
2+
appVersion: "2.33.1"
33
description: A Helm chart for Kubernetes to install DefectDojo
44
name: defectdojo
5-
version: 1.6.118
5+
version: 1.6.119
66
icon: https://www.defectdojo.org/img/favicon.ico
77
maintainers:
88
- name: madchap

0 commit comments

Comments
 (0)