Skip to content

Commit 3f050e0

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

File tree

452 files changed

+12063
-3141
lines changed

Some content is hidden

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

452 files changed

+12063
-3141
lines changed

.github/renovate.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
"baseBranches": ["dev"],
88
"rebaseWhen": "conflicted",
99
"ignorePaths": ["requirements.txt", "requirements-lint.txt", "components/package.json", "components/package-lock.json", "dojo/components/yarn.lock", "dojo/components/package.json", "Dockerfile**"],
10-
"ignoreDeps": [
11-
"mysql",
12-
"rabbitmq"
13-
],
10+
"ignoreDeps": [],
1411
"packageRules": [{
1512
"packagePatterns": ["*"],
1613
"commitMessageExtra": "from {{currentVersion}} to {{#if isMajor}}v{{{newMajor}}}{{else}}{{#if isSingleVersion}}v{{{toVersion}}}{{else}}{{{newValue}}}{{/if}}{{/if}}",

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
id: docker_build
3838
uses: docker/build-push-action@v6
3939
timeout-minutes: 10
40+
env:
41+
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
4042
with:
4143
context: .
4244
push: false
@@ -53,4 +55,4 @@ jobs:
5355
with:
5456
name: ${{ matrix.docker-image }}
5557
path: ${{ matrix.docker-image }}-${{ matrix.os }}_img
56-
retention-days: 1
58+
retention-days: 1

.github/workflows/fetch-oas.yml

+3-3
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 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 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 down
5252

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

.github/workflows/integration-tests.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
"tests/tool_config.py",
3737
"openapi-validatator",
3838
]
39-
profile: ["postgres-rabbitmq", "postgres-redis"]
4039
os: [alpine, debian]
4140
fail-fast: false
4241

@@ -59,39 +58,30 @@ jobs:
5958
- name: Set integration-test mode
6059
run: ln -s docker-compose.override.integration_tests.yml docker-compose.override.yml
6160

62-
# phased startup with PostgreSQL and RabbitMQ so we can use the exit code from integrationtest container
63-
- name: Start Dojo PostgreSQL + RabbitMQ
64-
if: matrix.profile == 'postgres-rabbitmq'
65-
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps -d postgres nginx celerybeat celeryworker mailhog uwsgi rabbitmq
66-
env:
67-
DJANGO_VERSION: ${{ matrix.os }}
68-
NGINX_VERSION: ${{ matrix.os }}
69-
70-
- name: Start Dojo PostgreSQL + Redis
71-
if: matrix.profile == 'postgres-redis'
72-
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps -d postgres nginx celerybeat celeryworker mailhog uwsgi redis
61+
- name: Start Dojo
62+
run: docker compose up --no-deps -d postgres nginx celerybeat celeryworker mailhog uwsgi redis
7363
env:
7464
DJANGO_VERSION: ${{ matrix.os }}
7565
NGINX_VERSION: ${{ matrix.os }}
7666

7767
- name: Initialize
7868
timeout-minutes: 10
79-
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps --exit-code-from initializer initializer
69+
run: docker compose up --no-deps --exit-code-from initializer initializer
8070
env:
8171
DJANGO_VERSION: ${{ matrix.os }}
8272
NGINX_VERSION: ${{ matrix.os }}
8373

8474
- name: Integration tests
8575
timeout-minutes: 10
86-
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env up --no-deps --exit-code-from integration-tests integration-tests
76+
run: docker compose up --no-deps --exit-code-from integration-tests integration-tests
8777
env:
8878
DD_INTEGRATION_TEST_FILENAME: ${{ matrix.test-case }}
8979
INTEGRATION_TESTS_VERSION: debian
9080

9181
- name: Logs
9282
if: always()
93-
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env logs --tail="2500"
83+
run: docker compose logs --tail="2500"
9484

9585
- name: Shutdown
9686
if: always()
97-
run: docker compose --profile ${{ matrix.profile }} --env-file ./docker/environments/${{ matrix.profile }}.env down
87+
run: docker compose down

.github/workflows/k8s-tests.yml

+11-42
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,14 @@ on:
55

66
env:
77
DD_HOSTNAME: defectdojo.default.minikube.local
8-
HELM_RABBIT_BROKER_SETTINGS: " \
9-
--set redis.enabled=false \
10-
--set rabbitmq.enabled=true \
11-
--set celery.broker=rabbitmq \
12-
--set createRabbitMqSecret=true \
13-
"
148
HELM_REDIS_BROKER_SETTINGS: " \
159
--set redis.enabled=true \
16-
--set rabbitmq.enabled=false \
1710
--set celery.broker=redis \
1811
--set createRedisSecret=true \
1912
"
20-
HELM_MYSQL_DATABASE_SETTINGS: " \
21-
--set database=mysql \
22-
--set postgresql.enabled=false \
23-
--set mysql.enabled=true \
24-
--set createMysqlSecret=true \
25-
"
2613
HELM_PG_DATABASE_SETTINGS: " \
2714
--set database=postgresql \
2815
--set postgresql.enabled=true \
29-
--set mysql.enabled=false \
3016
--set createPostgresqlSecret=true \
3117
"
3218
jobs:
@@ -42,33 +28,16 @@ jobs:
4228
# are tested (https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#available-versions)
4329
- databases: pgsql
4430
brokers: redis
45-
k8s: 'v1.26.11'
46-
os: debian
47-
- databases: mysql
48-
brokers: rabbit
49-
k8s: 'v1.26.11'
50-
os: debian
51-
- databases: pgsql
52-
brokers: rabbit
53-
k8s: 'v1.29.2'
54-
os: debian
55-
- databases: mysql
56-
brokers: redis
57-
k8s: 'v1.29.2'
31+
k8s: 'v1.30.3'
5832
os: debian
59-
- databases: pgsql
60-
brokers: rabbit
61-
k8s: 'v1.29.2'
62-
os: alpine
63-
6433
steps:
6534
- name: Checkout
6635
uses: actions/checkout@v4
6736

6837
- name: Setup Minikube
6938
uses: manusa/[email protected]
7039
with:
71-
minikube version: 'v1.31.2'
40+
minikube version: 'v1.33.1'
7241
kubernetes version: ${{ matrix.k8s }}
7342
driver: docker
7443
start args: '--addons=ingress --cni calico'
@@ -99,30 +68,30 @@ jobs:
9968
id: set
10069
run: |-
10170
echo "pgsql=${{ env.HELM_PG_DATABASE_SETTINGS }}" >> $GITHUB_ENV
102-
echo "mysql=${{ env.HELM_MYSQL_DATABASE_SETTINGS }}" >> $GITHUB_ENV
10371
echo "redis=${{ env.HELM_REDIS_BROKER_SETTINGS }}" >> $GITHUB_ENV
104-
echo "rabbit=${{ env.HELM_RABBIT_BROKER_SETTINGS }}" >> $GITHUB_ENV
10572
106-
- name: Deploying Djano application with ${{ matrix.databases }} ${{ matrix.brokers }}
107-
timeout-minutes: 10
73+
- name: Deploying Django application with ${{ matrix.databases }} ${{ matrix.brokers }}
74+
timeout-minutes: 15
10875
run: |-
10976
helm install \
11077
--timeout 800s \
78+
--wait \
79+
--wait-for-jobs \
11180
defectdojo \
11281
./helm/defectdojo \
11382
--set django.ingress.enabled=true \
11483
--set imagePullPolicy=Never \
11584
${{ env[matrix.databases] }} \
11685
${{ env[matrix.brokers] }} \
11786
--set createSecret=true \
118-
--set tag=${{ matrix.os }} \
119-
# --set imagePullSecrets=defectdojoregistrykey
87+
--set tag=${{ matrix.os }}
12088
12189
- name: Check deployment status
90+
if: always()
12291
run: |-
123-
kubectl get pods
124-
kubectl get ingress
125-
kubectl get services
92+
kubectl get all,ingress # all = pods, services, deployments, replicasets, statefulsets, jobs
93+
helm status defectdojo
94+
helm history defectdojo
12695
12796
- name: Check Application
12897
timeout-minutes: 10

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

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
if: ${{ matrix.os == 'debian' }}
6666
uses: docker/build-push-action@v6
6767
env:
68+
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
6869
REPO_ORG: ${{ env.repoorg }}
6970
docker-image: ${{ matrix.docker-image }}
7071
with:
@@ -79,6 +80,7 @@ jobs:
7980
if: ${{ matrix.os == 'alpine' }}
8081
uses: docker/build-push-action@v6
8182
env:
83+
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
8284
REPO_ORG: ${{ env.repoorg }}
8385
docker-image: ${{ matrix.docker-image }}
8486
with:

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ jobs:
3535

3636
# phased startup so we can use the exit code from unit test container
3737
- name: Start Postgres
38-
run: docker compose --env-file ./docker/environments/postgres-redis.env up -d postgres
38+
run: docker compose up -d postgres
3939

4040
# no celery or initializer needed for unit tests
4141
- name: Unit tests
4242
timeout-minutes: 10
43-
run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env up --no-deps --exit-code-from uwsgi uwsgi
43+
run: docker compose up --no-deps --exit-code-from uwsgi uwsgi
4444
env:
4545
DJANGO_VERSION: ${{ matrix.os }}
4646

4747
- name: Logs
4848
if: failure()
49-
run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env logs --tail="2500" uwsgi
49+
run: docker compose logs --tail="2500" uwsgi
5050

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

Dockerfile.django-alpine

-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ RUN \
1414
gcc \
1515
build-base \
1616
bind-tools \
17-
mysql-client \
18-
mariadb-dev \
1917
postgresql16-client \
2018
xmlsec \
2119
git \
@@ -46,8 +44,6 @@ RUN \
4644
jpeg \
4745
tiff \
4846
bind-tools \
49-
mysql-client \
50-
mariadb-dev \
5147
xmlsec \
5248
git \
5349
util-linux \

Dockerfile.django-debian

-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ RUN \
1414
gcc \
1515
build-essential \
1616
dnsutils \
17-
default-mysql-client \
18-
libmariadb-dev-compat \
1917
libpq-dev \
2018
postgresql-client \
2119
xmlsec1 \
@@ -48,8 +46,6 @@ RUN \
4846
libjpeg62 \
4947
libtiff6 \
5048
dnsutils \
51-
default-mysql-client \
52-
libmariadb3 \
5349
xmlsec1 \
5450
git \
5551
uuid-runtime \

Dockerfile.integration-tests-debian

+12-3
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.7.0@sha256:99924315933d49e7b33a7d2074bb2b64fc8def8f74519939036e24eb48f00336 AS openapitools
4+
FROM openapitools/openapi-generator-cli:v7.8.0@sha256:c409bfa9b276faf27726d2884b859d18269bf980cb63546e80b72f3b2648c492 AS openapitools
55
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS build
66
WORKDIR /app
77
RUN \
@@ -25,8 +25,13 @@ RUN pip install --no-cache-dir selenium==4.9.0 requests
2525

2626
# Install the latest Google Chrome stable release
2727
WORKDIR /opt/chrome
28+
29+
# TODO: figure out whatever fix is necessary to use Chrome >= 128 and put this back in the RUN below so we stay
30+
# up-to-date
31+
# chrome_url=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels[] | select(.channel == "Stable") | .downloads.chrome[] | select(.platform == "linux64").url') && \
32+
2833
RUN \
29-
chrome_url=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels[] | select(.channel == "Stable") | .downloads.chrome[] | select(.platform == "linux64").url') && \
34+
chrome_url="https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chrome-linux64.zip" && \
3035
wget $chrome_url && \
3136
unzip chrome-linux64.zip && \
3237
rm -rf chrome-linux64.zip && \
@@ -49,8 +54,12 @@ RUN apt-get install -y libxi6 libgconf-2-4 jq libjq1 libonig5 libxkbcommon0 libx
4954

5055
# Installing the latest stable Google Chrome driver release
5156
WORKDIR /opt/chrome-driver
57+
# TODO: figure out whatever fix is necessary to use Chrome >= 128 and put this back in the RUN below so we stay
58+
# up-to-date
59+
# chromedriver_url=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels[] | select(.channel == "Stable") | .downloads.chromedriver[] | select(.platform == "linux64").url') && \
60+
5261
RUN \
53-
chromedriver_url=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels[] | select(.channel == "Stable") | .downloads.chromedriver[] | select(.platform == "linux64").url') && \
62+
chromedriver_url="https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chromedriver-linux64.zip" && \
5463
wget $chromedriver_url && \
5564
unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver && \
5665
rm -rf chromedriver-linux64.zip && \

Dockerfile.nginx-alpine

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ RUN \
1414
gcc \
1515
build-base \
1616
bind-tools \
17-
mysql-client \
18-
mariadb-dev \
1917
postgresql16-client \
2018
xmlsec \
2119
git \

Dockerfile.nginx-debian

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ RUN \
1414
gcc \
1515
build-essential \
1616
dnsutils \
17-
default-mysql-client \
18-
libmariadb-dev-compat \
1917
libpq-dev \
2018
postgresql-client \
2119
xmlsec1 \

0 commit comments

Comments
 (0)