Skip to content

Commit 1a999ff

Browse files
Merge branch 'dev' into merge_mobsf
2 parents cf45913 + c446ca6 commit 1a999ff

31 files changed

+412
-334
lines changed

.github/workflows/release-x-manual-helm-chart.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ on:
2222
description: 'Release number'
2323
required: true
2424

25+
make_draft:
26+
type: boolean
27+
description: 'Mark as draft release?'
28+
default: true
29+
30+
make_prerelease:
31+
type: boolean
32+
description: 'Mark as pre-release?'
33+
default: false
34+
35+
make_latest:
36+
type: boolean
37+
description: 'Mark as latest?'
38+
default: false
39+
2540
jobs:
2641
release-chart:
2742
runs-on: ubuntu-latest
@@ -38,7 +53,7 @@ jobs:
3853
# id: get-upload-url
3954
# uses: pdamianik/release-tag-to-upload-url-action@v1.0.1
4055
# with:
41-
# tag: ${{ github.event.inputs.release_number }}
56+
# tag: ${{ inputs.release_number }}
4257
# token: ${{ github.token }}
4358

4459
- name: Configure git
@@ -62,24 +77,25 @@ jobs:
6277
id: pin_image
6378
run: |-
6479
yq --version
65-
yq -i '.tag="${{ github.event.inputs.release_number }}"' helm/defectdojo/values.yaml
80+
yq -i '.tag="${{ inputs.release_number }}"' helm/defectdojo/values.yaml
6681
echo "Current image tag:`yq -r '.tag' helm/defectdojo/values.yaml`"
6782
6883
- name: Package Helm chart
6984
id: package-helm-chart
7085
run: |
7186
mkdir build
7287
helm package helm/defectdojo/ --destination ./build
73-
echo "chart_version=$(ls build | cut -d '-' -f 2 | sed 's|\.tgz||')" >> $GITHUB_ENV
88+
echo "chart_version=$(ls build | cut -d '-' -f 2,3 | sed 's|\.tgz||')" >> $GITHUB_ENV
7489
75-
- name: Create release ${{ github.event.inputs.release_number }}
90+
- name: Create release ${{ inputs.release_number }}
7691
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
7792
with:
78-
name: '${{ github.event.inputs.release_number }} 🌈'
79-
tag_name: ${{ github.event.inputs.release_number }}
93+
name: '${{ inputs.release_number }} 🌈'
94+
tag_name: ${{ inputs.release_number }}
8095
body: Run the release drafter to populate the release notes.
81-
draft: true
82-
prerelease: false
96+
draft: ${{ inputs.make_draft }}
97+
prerelease: ${{ inputs.make_prerelease }}
98+
make_latest: ${{ inputs.make_latest }}
8399
files: ./build/defectdojo-${{ env.chart_version }}.tgz
84100
token: ${{ secrets.GITHUB_TOKEN }}
85101
env:
@@ -96,9 +112,9 @@ jobs:
96112
git checkout helm-charts
97113
git pull
98114
if [ ! -f ./index.yaml ]; then
99-
helm repo index ./build --url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${{ github.event.inputs.release_number }}/"
115+
helm repo index ./build --url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${{ inputs.release_number }}/"
100116
else
101-
helm repo index ./build --url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${{ github.event.inputs.release_number }}/" --merge ./index.yaml
117+
helm repo index ./build --url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${{ inputs.release_number }}/" --merge ./index.yaml
102118
fi
103119
cp -f ./build/index.yaml ./index.yaml
104120
git add ./index.yaml

.github/workflows/release-x-nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@ jobs:
7777
uses: ./.github/workflows/release-x-manual-helm-chart.yml
7878
with:
7979
release_number: ${{ inputs.tag-to-apply }}
80+
make_draft: false
81+
make_prerelease: true
8082
secrets: inherit
81-

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.47.0-dev",
3+
"version": "2.48.0-dev",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

docs/content/en/open_source/installation/running-in-production.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,5 @@ You can execute the following command to see the configuration:
8888
`docker compose exec celerybeat bash -c "celery -A dojo inspect stats"`
8989
and see what is in effect.
9090

91-
### Asynchronous Import
92-
93-
<span style="background-color:rgba(242, 86, 29, 0.3)">This experimental feature has been deprecated as of DefectDojo 2.44.0 (March release). Please exercise caution if using this feature with an older version of DefectDojo, as results may be inconsistent.</span>
94-
95-
Import and Re-Import can also be configured to handle uploads asynchronously to aid in
96-
processing especially large scans. It works by batching Findings and Endpoints by a
97-
configurable amount. Each batch will be be processed in separate celery tasks.
98-
99-
The following variables impact async imports.
100-
101-
- `DD_ASYNC_FINDING_IMPORT` defaults to False
102-
- `DD_ASYNC_FINDING_IMPORT_CHUNK_SIZE` defaults to 100
103-
104-
When using asynchronous imports with dynamic scanners, Endpoints will continue to "trickle" in
105-
even after the import has returned a successful response. This is because processing continues
106-
to occur after the Findings have already been imported.
107-
108-
To determine if an import has been fully completed, please see the progress bar in the appropriate test.
91+
### Asynchronous Import: Deprecated
92+
This feature has been removed in 2.47.0

docs/content/en/open_source/upgrading/2.47.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ description: Drop support for PostgreSQL-HA in HELM
99
This release removes support for the PostgreSQL-HA (High Availability) Helm chart as a dependency in the DefectDojo Helm chart. Users relying on the PostgreSQL-HA Helm chart will need to transition to using the standard PostgreSQL configuration or an external PostgreSQL database.
1010

1111
There are no special instructions for upgrading to 2.47.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.47.0) for the contents of the release.
12+
13+
## Removal of Asynchronous Import
14+
15+
Please note that asynchronous import has been removed as it was announced in 2.46. If you haven't migrated from this feature yet, we recommend doing before upgrading to 2.47.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: 'Upgrading to DefectDojo Version 2.48.x'
33
toc_hide: true
4-
weight: -20250505
4+
weight: -20250602
55
description: Recalculate hashes for MobSF parser
66
---
77
### Merging Mobsfscan Scan and MobSF Scan
88

9-
The two scan types Mobsfscan Scan and MobSF Scan were merged in this release. We recommend to recalculate the hashcodes if you use these parsers as the deduplication settings have been changed.
9+
The two scan types Mobsfscan Scan and MobSF Scan were merged in this release. We recommend to recalculate the hashcodes if you use these parsers as the deduplication settings have been changed.

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.47.0-dev"
7+
__version__ = "2.48.0-dev"
88
__url__ = "https://github.com/DefectDojo/django-DefectDojo"
99
__docs__ = "https://documentation.defectdojo.com"

dojo/api_v2/exception_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from rest_framework.views import exception_handler
1313

1414
from dojo.models import System_Settings
15+
from dojo.product_announcements import ErrorPageProductAnnouncement
1516

1617
logger = logging.getLogger(__name__)
1718

@@ -36,6 +37,7 @@ def custom_exception_handler(exc, context):
3637
response.status_code = HTTP_400_BAD_REQUEST
3738
response.data = {}
3839
response.data["message"] = str(exc)
40+
ErrorPageProductAnnouncement(response=response)
3941
elif response is None:
4042
if System_Settings.objects.get().api_expose_error_details:
4143
exception_message = str(exc.args[0])
@@ -51,6 +53,7 @@ def custom_exception_handler(exc, context):
5153
response.data[
5254
"message"
5355
] = exception_message
56+
ErrorPageProductAnnouncement(response=response)
5457
elif response.status_code < 500:
5558
# HTTP status codes lower than 500 are no technical errors.
5659
# They need not to be logged and we provide the exception
@@ -60,6 +63,7 @@ def custom_exception_handler(exc, context):
6063
exc,
6164
) != response.data.get("detail", ""):
6265
response.data["message"] = str(exc)
66+
ErrorPageProductAnnouncement(response=response)
6367
else:
6468
# HTTP status code 500 or higher are technical errors.
6569
# They get logged and we don't change the response.

dojo/api_v2/serializers.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import logging
55
import re
6+
import time
67
from datetime import datetime
78

89
import six
@@ -112,6 +113,10 @@
112113
Vulnerability_Id_Template,
113114
get_current_date,
114115
)
116+
from dojo.product_announcements import (
117+
LargeScanSizeProductAnnouncement,
118+
ScanTypeProductAnnouncement,
119+
)
115120
from dojo.tools.factory import (
116121
get_choices_sorted,
117122
requires_file,
@@ -2193,6 +2198,7 @@ class CommonImportScanSerializer(serializers.Serializer):
21932198
product_id = serializers.IntegerField(read_only=True)
21942199
product_type_id = serializers.IntegerField(read_only=True)
21952200
statistics = ImportStatisticsSerializer(read_only=True, required=False)
2201+
pro = serializers.ListField(read_only=True, required=False)
21962202
apply_tags_to_findings = serializers.BooleanField(
21972203
help_text="If set to True, the tags will be applied to the findings",
21982204
required=False,
@@ -2224,6 +2230,7 @@ def process_scan(
22242230
Raises exceptions in the event of an error
22252231
"""
22262232
try:
2233+
start_time = time.perf_counter()
22272234
importer = self.get_importer(**context)
22282235
context["test"], _, _, _, _, _, _ = importer.process_scan(
22292236
context.pop("scan", None),
@@ -2236,6 +2243,9 @@ def process_scan(
22362243
data["product_id"] = test.engagement.product.id
22372244
data["product_type_id"] = test.engagement.product.prod_type.id
22382245
data["statistics"] = {"after": test.statistics}
2246+
duration = time.perf_counter() - start_time
2247+
LargeScanSizeProductAnnouncement(response_data=data, duration=duration)
2248+
ScanTypeProductAnnouncement(response_data=data, scan_type=context.get("scan_type"))
22392249
# convert to exception otherwise django rest framework will swallow them as 400 error
22402250
# exceptions are already logged in the importer
22412251
except SyntaxError as se:
@@ -2491,6 +2501,7 @@ def process_scan(
24912501
"""
24922502
statistics_before, statistics_delta = None, None
24932503
try:
2504+
start_time = time.perf_counter()
24942505
if test := context.get("test"):
24952506
statistics_before = test.statistics
24962507
context["test"], _, _, _, _, _, test_import = self.get_reimporter(
@@ -2525,6 +2536,9 @@ def process_scan(
25252536
if statistics_delta:
25262537
data["statistics"]["delta"] = statistics_delta
25272538
data["statistics"]["after"] = test.statistics
2539+
duration = time.perf_counter() - start_time
2540+
LargeScanSizeProductAnnouncement(response_data=data, duration=duration)
2541+
ScanTypeProductAnnouncement(response_data=data, scan_type=context.get("scan_type"))
25282542
# convert to exception otherwise django rest framework will swallow them as 400 error
25292543
# exceptions are already logged in the importer
25302544
except SyntaxError as se:

dojo/api_v2/views.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
from dojo.filters import (
5353
ApiAppAnalysisFilter,
5454
ApiCredentialsFilter,
55+
ApiDojoMetaFilter,
5556
ApiEndpointFilter,
5657
ApiEngagementFilter,
5758
ApiFindingFilter,
@@ -1643,14 +1644,7 @@ class DojoMetaViewSet(
16431644
serializer_class = serializers.MetaSerializer
16441645
queryset = DojoMeta.objects.none()
16451646
filter_backends = (DjangoFilterBackend,)
1646-
filterset_fields = [
1647-
"id",
1648-
"product",
1649-
"endpoint",
1650-
"finding",
1651-
"name",
1652-
"value",
1653-
]
1647+
filterset_class = ApiDojoMetaFilter
16541648
permission_classes = (
16551649
IsAuthenticated,
16561650
permissions.UserHasDojoMetaPermission,

0 commit comments

Comments
 (0)