Skip to content

Commit a78e689

Browse files
authored
Merge branch 'DefectDojo:dev' into dev
2 parents 3f050e0 + bfe44ce commit a78e689

File tree

509 files changed

+21506
-3806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

509 files changed

+21506
-3806
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A clear and concise description of what you expected to happen.
3636
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]
3737

3838
**Logs**
39-
Use `docker-compose logs` (or similar, depending on your deployment method) to get the logs and add the relevant sections here showing the error occurring (if applicable).
39+
Use `docker compose logs` (or similar, depending on your deployment method) to get the logs and add the relevant sections here showing the error occurring (if applicable).
4040

4141
**Sample scan files**
4242
If applicable, add sample scan files to help reproduce your problem.

.github/ISSUE_TEMPLATE/support_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A clear and concise description of what you expected to happen.
3636
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]
3737

3838
**Logs**
39-
Use `docker-compose logs` (or similar, depending on your deployment method) to get the logs and add the relevant sections here showing the error occurring (if applicable).
39+
Use `docker compose logs` (or similar, depending on your deployment method) to get the logs and add the relevant sections here showing the error occurring (if applicable).
4040

4141
**Sample scan files**
4242
If applicable, add sample scan files to help reproduce your problem.

.github/workflows/build-docker-images-for-testing.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ jobs:
4545
tags: defectdojo/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }}
4646
file: Dockerfile.${{ matrix.docker-image }}-${{ matrix.os }}
4747
outputs: type=docker,dest=${{ matrix.docker-image }}-${{ matrix.os }}_img
48-
cache-from: type=gha,scope=${{ matrix.docker-image }}
49-
cache-to: type=gha,mode=max,scope=${{ matrix.docker-image }}
50-
48+
5149
# export docker images to be used in next jobs below
5250
- name: Upload image ${{ matrix.docker-image }} as artifact
5351
timeout-minutes: 10

.github/workflows/k8s-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/checkout@v4
3636

3737
- name: Setup Minikube
38-
uses: manusa/actions-setup-minikube@v2.11.0
38+
uses: manusa/actions-setup-minikube@v2.13.0
3939
with:
4040
minikube version: 'v1.33.1'
4141
kubernetes version: ${{ matrix.k8s }}

.github/workflows/release-3-master-into-dev.yml

+8
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ jobs:
5050
CURRENT_CHART_VERSION=$(grep -oP 'version: (\K\S*)?' helm/defectdojo/Chart.yaml | head -1)
5151
sed -ri "0,/version/s/version: \S+/$(echo "version: $CURRENT_CHART_VERSION" | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-dev/" helm/defectdojo/Chart.yaml
5252
53+
- name: Update settings SHA
54+
run: sha256sum dojo/settings/settings.dist.py | cut -d ' ' -f1 > dojo/settings/.settings.dist.py.sha256sum
55+
5356
- name: Check numbers
5457
run: |
5558
grep version dojo/__init__.py
5659
grep appVersion helm/defectdojo/Chart.yaml
5760
grep version components/package.json
61+
cat dojo/settings/.settings.dist.py.sha256sum
5862
5963
- name: Create upgrade notes to documentation
6064
run: |
@@ -132,11 +136,15 @@ jobs:
132136
CURRENT_CHART_VERSION=$(grep -oP 'version: (\K\S*)?' helm/defectdojo/Chart.yaml | head -1)
133137
sed -ri "0,/version/s/version: \S+/$(echo "version: $CURRENT_CHART_VERSION" | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-dev/" helm/defectdojo/Chart.yaml
134138
139+
- name: Update settings SHA
140+
run: sha256sum dojo/settings/settings.dist.py | cut -d ' ' -f1 > dojo/settings/.settings.dist.py.sha256sum
141+
135142
- name: Check numbers
136143
run: |
137144
grep version dojo/__init__.py
138145
grep appVersion helm/defectdojo/Chart.yaml
139146
grep version components/package.json
147+
cat dojo/settings/.settings.dist.py.sha256sum
140148
141149
- name: Push version changes
142150
uses: stefanzweifel/[email protected]

.github/workflows/release-x-manual-docker-containers.yml

-20
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@ jobs:
4949
id: buildx
5050
uses: docker/setup-buildx-action@v3
5151

52-
- name: Cache Docker layers
53-
uses: actions/cache@v4
54-
env:
55-
docker-image: ${{ matrix.docker-image }}
56-
with:
57-
path: /tmp/.buildx-cache-${{ env.docker-image }}
58-
key: ${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-${{ env.workflow_name }}-${{ github.sha }}-${{ github.run_id }}
59-
restore-keys: |
60-
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-${{ env.workflow_name}}-${{ github.sha }}
61-
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-${{ env.workflow_name }}
62-
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-
63-
6452
- name: Build and push images with debian
6553
if: ${{ matrix.os == 'debian' }}
6654
uses: docker/build-push-action@v6
@@ -73,8 +61,6 @@ jobs:
7361
tags: ${{ env.REPO_ORG }}/defectdojo-${{ env.docker-image}}:${{ github.event.inputs.release_number }}-${{ matrix.os }}, ${{ env.REPO_ORG }}/defectdojo-${{ env.docker-image}}:${{ github.event.inputs.release_number }}, ${{ env.REPO_ORG }}/defectdojo-${{ env.docker-image}}:latest
7462
file: ./Dockerfile.${{ env.docker-image }}-${{ matrix.os }}
7563
context: .
76-
cache-from: type=local,src=/tmp/.buildx-cache-${{ env.docker-image }}
77-
cache-to: type=local,dest=/tmp/.buildx-cache-${{ env.docker-image }}
7864

7965
- name: Build and push images with alpine
8066
if: ${{ matrix.os == 'alpine' }}
@@ -88,9 +74,3 @@ jobs:
8874
tags: ${{ env.REPO_ORG }}/defectdojo-${{ env.docker-image}}:${{ github.event.inputs.release_number }}-${{ matrix.os }}
8975
file: ./Dockerfile.${{ env.docker-image }}-${{ matrix.os }}
9076
context: .
91-
cache-from: type=local,src=/tmp/.buildx-cache-${{ env.docker-image }}
92-
cache-to: type=local,dest=/tmp/.buildx-cache-${{ env.docker-image }}
93-
# platforms: ${{ matrix.platform }}
94-
95-
- name: Image digest
96-
run: echo ${{ steps.docker_build.outputs.digest }}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
run: docker/setEnv.sh unit_tests_cicd
3535

3636
# phased startup so we can use the exit code from unit test container
37-
- name: Start Postgres
38-
run: docker compose up -d postgres
37+
- name: Start Postgres and webhook.endpoint
38+
run: docker compose up -d postgres webhook.endpoint
3939

4040
# no celery or initializer needed for unit tests
4141
- name: Unit tests

Dockerfile.integration-tests-debian

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# code: language=Dockerfile
33

4-
FROM openapitools/openapi-generator-cli:v7.8.0@sha256:c409bfa9b276faf27726d2884b859d18269bf980cb63546e80b72f3b2648c492 AS openapitools
4+
FROM openapitools/openapi-generator-cli:v7.9.0@sha256:bb32f5f0c9f5bdbb7b00959e8009de0230aedc200662701f05fc244c36f967ba AS openapitools
55
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS build
66
WORKDIR /app
77
RUN \

Dockerfile.nginx-alpine

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ COPY manage.py ./
140140
COPY dojo/ ./dojo/
141141
RUN env DD_SECRET_KEY='.' python3 manage.py collectstatic --noinput && true
142142

143-
FROM nginx:1.27.0-alpine@sha256:208b70eefac13ee9be00e486f79c695b15cef861c680527171a27d253d834be9
143+
FROM nginx:1.27.2-alpine@sha256:2140dad235c130ac861018a4e13a6bc8aea3a35f3a40e20c1b060d51a7efd250
144144
ARG uid=1001
145145
ARG appuser=defectdojo
146146
COPY --from=collectstatic /app/static/ /usr/share/nginx/html/static/

Dockerfile.nginx-debian

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ COPY dojo/ ./dojo/
7373

7474
RUN env DD_SECRET_KEY='.' python3 manage.py collectstatic --noinput && true
7575

76-
FROM nginx:1.27.0-alpine@sha256:208b70eefac13ee9be00e486f79c695b15cef861c680527171a27d253d834be9
76+
FROM nginx:1.27.2-alpine@sha256:2140dad235c130ac861018a4e13a6bc8aea3a35f3a40e20c1b060d51a7efd250
7777
ARG uid=1001
7878
ARG appuser=defectdojo
7979
COPY --from=collectstatic /app/static/ /usr/share/nginx/html/static/

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,14 @@ Core Moderators can help you with pull requests or feedback on dev ideas:
132132
* Cody Maffucci ([@Maffooch](https://github.com/maffooch) | [LinkedIn](https://www.linkedin.com/in/cody-maffucci))
133133

134134
Moderators can help you with pull requests or feedback on dev ideas:
135-
* Damien Carol ([@damiencarol](https://github.com/damiencarol) | [LinkedIn](https://www.linkedin.com/in/damien-carol/))
136-
* Jannik Jürgens ([@alles-klar](https://github.com/alles-klar))
137-
* Dubravko Sever ([@dsever](https://github.com/dsever))
138135
* Charles Neill ([@cneill](https://github.com/cneill) | [@ccneill](https://twitter.com/ccneill))
139136
* Jay Paz ([@jjpaz](https://twitter.com/jjpaz))
140137
* Blake Owens ([@blakeaowens](https://github.com/blakeaowens))
141138

142139
## Hall of Fame
143-
140+
* Jannik Jürgens ([@alles-klar](https://github.com/alles-klar)) - Jannik was a long time contributor and moderator for
141+
DefectDojo and made significant contributions to many areas of the platform. Jannik was instrumental in pioneering
142+
and optimizing deployment methods.
144143
* Valentijn Scholten ([@valentijnscholten](https://github.com/valentijnscholten) |
145144
[Sponsor](https://github.com/sponsors/valentijnscholten) |
146145
[LinkedIn](https://www.linkedin.com/in/valentijn-scholten/)) - Valentijn served as a core moderator for 3 years.

components/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "defectdojo",
3-
"version": "2.39.0-dev",
3+
"version": "2.40.0-dev",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {
@@ -35,7 +35,7 @@
3535
"metismenu": "~3.0.7",
3636
"moment": "^2.30.1",
3737
"morris.js": "morrisjs/morris.js",
38-
"pdfmake": "^0.2.12",
38+
"pdfmake": "^0.2.14",
3939
"startbootstrap-sb-admin-2": "1.0.7"
4040
},
4141
"engines": {

components/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,10 @@ path-parse@^1.0.7:
824824
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
825825
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
826826

827-
pdfmake@^0.2.12:
828-
version "0.2.12"
829-
resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.12.tgz#5156f91ff73797947942aa342423bedaa0c0bc93"
830-
integrity sha512-TFsqaG6KVtk+TWermmJNNwom3wmB/xiz07prM74KBhdM+7pz3Uwq2b0uoqhhQRn6cYUTpL8lXZY6xF011o1YcQ==
827+
pdfmake@^0.2.14:
828+
version "0.2.14"
829+
resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.14.tgz#a257a393b54917218add829bff8e490be21e8077"
830+
integrity sha512-x9gXFAY37/CAC/WaZB/683E4Pi0cVW/RMTTNxMpe4I2kRsKv8AE3Pz6+n7iTfn+84/GtSg99BjZkYh7oGFCKmg==
831831
dependencies:
832832
"@foliojs-fork/linebreak" "^1.1.1"
833833
"@foliojs-fork/pdfkit" "^0.14.0"

docker-compose.override.dev.yml

+2
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ services:
5353
published: 8025
5454
protocol: tcp
5555
mode: host
56+
"webhook.endpoint":
57+
image: mccutchen/go-httpbin:v2.15.0@sha256:24528cf5229d0b70065ac27e6c9e4d96f5452a84a3ce4433e56573c18d96827a

docker-compose.override.unit_tests.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
services:
33
nginx:
4-
image: busybox:1.36.1-musl
4+
image: busybox:1.37.0-musl
55
entrypoint: ['echo', 'skipping', 'nginx']
66
volumes:
77
- defectdojo_media_unit_tests:/usr/share/nginx/html/media
@@ -30,13 +30,13 @@ services:
3030
DD_CELERY_BROKER_PATH: '/dojo.celerydb.sqlite'
3131
DD_CELERY_BROKER_PARAMS: ''
3232
celerybeat:
33-
image: busybox:1.36.1-musl
33+
image: busybox:1.37.0-musl
3434
entrypoint: ['echo', 'skipping', 'celery beat']
3535
celeryworker:
36-
image: busybox:1.36.1-musl
36+
image: busybox:1.37.0-musl
3737
entrypoint: ['echo', 'skipping', 'celery worker']
3838
initializer:
39-
image: busybox:1.36.1-musl
39+
image: busybox:1.37.0-musl
4040
entrypoint: ['echo', 'skipping', 'initializer']
4141
postgres:
4242
ports:
@@ -49,8 +49,10 @@ services:
4949
volumes:
5050
- defectdojo_postgres_unit_tests:/var/lib/postgresql/data
5151
redis:
52-
image: busybox:1.36.1-musl
52+
image: busybox:1.37.0-musl
5353
entrypoint: ['echo', 'skipping', 'redis']
54+
"webhook.endpoint":
55+
image: mccutchen/go-httpbin:v2.15.0@sha256:24528cf5229d0b70065ac27e6c9e4d96f5452a84a3ce4433e56573c18d96827a
5456
volumes:
5557
defectdojo_postgres_unit_tests: {}
5658
defectdojo_media_unit_tests: {}

docker-compose.override.unit_tests_cicd.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
services:
33
nginx:
4-
image: busybox:1.36.1-musl
4+
image: busybox:1.37.0-musl
55
entrypoint: ['echo', 'skipping', 'nginx']
66
volumes:
77
- defectdojo_media_unit_tests:/usr/share/nginx/html/media
@@ -29,13 +29,13 @@ services:
2929
DD_CELERY_BROKER_PATH: '/dojo.celerydb.sqlite'
3030
DD_CELERY_BROKER_PARAMS: ''
3131
celerybeat:
32-
image: busybox:1.36.1-musl
32+
image: busybox:1.37.0-musl
3333
entrypoint: ['echo', 'skipping', 'celery beat']
3434
celeryworker:
35-
image: busybox:1.36.1-musl
35+
image: busybox:1.37.0-musl
3636
entrypoint: ['echo', 'skipping', 'celery worker']
3737
initializer:
38-
image: busybox:1.36.1-musl
38+
image: busybox:1.37.0-musl
3939
entrypoint: ['echo', 'skipping', 'initializer']
4040
postgres:
4141
ports:
@@ -48,8 +48,10 @@ services:
4848
volumes:
4949
- defectdojo_postgres_unit_tests:/var/lib/postgresql/data
5050
redis:
51-
image: busybox:1.36.1-musl
51+
image: busybox:1.37.0-musl
5252
entrypoint: ['echo', 'skipping', 'redis']
53+
"webhook.endpoint":
54+
image: mccutchen/go-httpbin:v2.15.0@sha256:24528cf5229d0b70065ac27e6c9e4d96f5452a84a3ce4433e56573c18d96827a
5355
volumes:
5456
defectdojo_postgres_unit_tests: {}
5557
defectdojo_media_unit_tests: {}

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ services:
103103
source: ./docker/extra_settings
104104
target: /app/docker/extra_settings
105105
postgres:
106-
image: postgres:16.4-alpine@sha256:492898505cb45f9835acc327e98711eaa9298ed804e0bb36f29e08394229550d
106+
image: postgres:17.0-alpine@sha256:14195b0729fce792f47ae3c3704d6fd04305826d57af3b01d5b4d004667df174
107107
environment:
108108
POSTGRES_DB: ${DD_DATABASE_NAME:-defectdojo}
109109
POSTGRES_USER: ${DD_DATABASE_USER:-defectdojo}
110110
POSTGRES_PASSWORD: ${DD_DATABASE_PASSWORD:-defectdojo}
111111
volumes:
112112
- defectdojo_postgres:/var/lib/postgresql/data
113113
redis:
114-
image: redis:7.2.5-alpine@sha256:0bc09d9f486508aa42ecc2f18012bb1e3a1b2744ef3a6ad30942fa12579f0b03
114+
image: redis:7.2.5-alpine@sha256:6aaf3f5e6bc8a592fbfe2cccf19eb36d27c39d12dab4f4b01556b7449e7b1f44
115115
volumes:
116116
- defectdojo_redis:/data
117117
volumes:

docker/docker-compose-check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ current=$(docker compose version --short)
66

77
echo 'Checking docker compose version'
88
if [[ $main -lt 2 ]]; then
9-
echo "$current is not a supported docker-compose version, please upgrade to the minimum supported version: 2.0"
9+
echo "$current is not a supported 'docker compose' version, please upgrade to the minimum supported version: 2.0"
1010
exit 1
1111
elif [[ $main -eq 1 ]]; then
1212
if [[ $minor -lt 28 ]]; then
13-
echo "$current is not supported docker-compose version, please upgrade to minimal supported version:1.28"
13+
echo "$current is not supported 'docker compose' version, please upgrade to minimal supported version:1.28"
1414
exit 1
1515
fi
1616
fi

docker/extra_settings/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If a file if placed here, it will be copied on startup to `dojo/settings/local_s
66
For an example, see [template-local_settings](../../dojo/settings/template-local_settings)
77

88
Please note this copy action could fail if you have mounted the full `dojo/` folder, but that is owned by a different user/group.
9-
That's why this copy action only happens in docker-compose release mode, and not in dev/debug/unit_tests/integration_tests modes.
9+
That's why this copy action only happens in docker compose release mode, and not in dev/debug/unit_tests/integration_tests modes.
1010

1111
For advanced usage you can also place a `settings.dist.py` or `settings.py` file. These will also be copied on startup to dojo/settings.
1212

docker/install_chrome_dependencies.py

+20-17
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,47 @@
1010

1111

1212
def find_packages(library_name):
13-
stdout = run_command(["apt-file", "search", library_name])
13+
stdout, stderr, status_code = run_command(["apt-file", "search", library_name])
14+
# Check if ldd has failed for a good reason, or if there are no results
15+
if status_code != 0:
16+
# Any other case should be be caught
17+
msg = f"apt-file search (exit code {status_code}): {stderr}"
18+
raise ValueError(msg)
19+
1420
if not stdout.strip():
1521
return []
1622
libs = [line.split(":")[0] for line in stdout.strip().split("\n")]
1723
return list(set(libs))
1824

1925

2026
def run_command(cmd, cwd=None, env=None):
27+
# Do not raise exception here because some commands are too loose with negative exit codes
2128
result = subprocess.run(cmd, cwd=cwd, env=env, capture_output=True, text=True, check=False)
22-
return result.stdout
29+
return result.stdout.strip(), result.stderr.strip(), result.returncode
2330

2431

2532
def ldd(file_path):
26-
stdout = run_command(["ldd", file_path])
27-
# For simplicity, I'm assuming if we get an error, the code is non-zero.
28-
try:
29-
result = subprocess.run(
30-
["ldd", file_path], capture_output=True, text=True, check=False,
31-
)
32-
stdout = result.stdout
33-
code = result.returncode
34-
except subprocess.CalledProcessError:
35-
stdout = ""
36-
code = 1
37-
return stdout, code
33+
stdout, stderr, status_code = run_command(["ldd", file_path])
34+
# Check if ldd has failed for a good reason, or if there are no results
35+
if status_code != 0:
36+
# It is often the case when stdout will be empty. This is not an error
37+
if not stdout:
38+
return stdout, status_code
39+
# Any other case should be be caught
40+
msg = f"ldd (exit code {status_code}): {stderr}"
41+
raise ValueError(msg)
42+
43+
return stdout, status_code
3844

3945

4046
raw_deps = ldd("/opt/chrome/chrome")
4147
dependencies = raw_deps[0].splitlines()
42-
4348
missing_deps = {
4449
r[0].strip()
4550
for d in dependencies
4651
for r in [d.split("=>")]
4752
if len(r) == 2 and r[1].strip() == "not found"
4853
}
49-
5054
missing_packages = []
5155
for d in missing_deps:
5256
all_packages = find_packages(d)
@@ -59,5 +63,4 @@ def ldd(file_path):
5963
]
6064
for p in packages:
6165
missing_packages.append(p)
62-
6366
logger.info("missing_packages: " + (" ".join(missing_packages)))

0 commit comments

Comments
 (0)