Skip to content

Commit 4aa9830

Browse files
authored
Merge branch 'dev' into master-into-dev/2.43.1-2.44.0-dev
2 parents 09c7d22 + 88e0409 commit 4aa9830

File tree

184 files changed

+1343
-1308
lines changed

Some content is hidden

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

184 files changed

+1343
-1308
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: echo "IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
2929

3030
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
31+
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
3232
with:
3333
buildkitd-flags: --debug
3434
driver-opts: image=moby/buildkit:master # needed to get the fix for https://github.com/moby/buildkit/issues/2426

.github/workflows/k8s-tests.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
./helm/defectdojo \
8686
--set django.ingress.enabled=true \
8787
--set imagePullPolicy=Never \
88+
--set initializer.keepSeconds="-1" \
8889
${{ env[matrix.databases] }} \
8990
${{ env[matrix.brokers] }} \
9091
--set createSecret=true \
@@ -124,10 +125,15 @@ jobs:
124125
RETRY=0
125126
while :
126127
do
128+
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
127129
OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
128130
--overrides='{ "apiVersion": "v1" }' \
129-
--restart=Never -i --rm -- -s -m 20 -I --header "Host: $DD_HOSTNAME" http://`kubectl get service defectdojo-django -o json \
130-
| jq -r '.spec.clusterIP'`/login?next=/)
131+
--restart=Never -i --rm -- \
132+
--silent \
133+
--max-time 20 \
134+
--head \
135+
--header "Host: $DD_HOSTNAME" \
136+
http://$DJANGO_IP/login?next=/)
131137
echo $OUT
132138
CR=`echo $OUT | egrep "^HTTP" | cut -d' ' -f2`
133139
echo $CR
@@ -148,6 +154,26 @@ jobs:
148154
break
149155
fi
150156
done
157+
ADMIN_PASS=$(kubectl get secret/defectdojo -o jsonpath='{.data.DD_ADMIN_PASSWORD}' | base64 -d)
158+
echo "Simple API check"
159+
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
160+
CR=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
161+
--overrides='{ "apiVersion": "v1" }' \
162+
--restart=Never -i --rm -- \
163+
--silent \
164+
--max-time 20 \
165+
--header "Host: $DD_HOSTNAME" \
166+
--data-raw "username=admin&password=$ADMIN_PASS" \
167+
--output /dev/null \
168+
--write-out "%{http_code}\n" \
169+
http://$DJANGO_IP/api/v2/api-token-auth/)
170+
echo $CR
171+
if [[ $CR -ne 200 ]]; then
172+
echo "ERROR: login is not possible; got HTTP code $CR"
173+
exit 1
174+
else
175+
echo "Result received"
176+
fi
151177
echo "Final Check of components"
152178
errors=`kubectl get pods | grep Error | awk '{print $1}'`
153179
if [[ ! -z $errors ]]; then

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Set up Docker Buildx
4949
id: buildx
50-
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
50+
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
5151

5252
- name: Build and push images with debian
5353
if: ${{ matrix.os == 'debian' }}

.github/workflows/update-sample-data.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
# Checkout the repository
1818
- name: Checkout code
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2020
with:
2121
ref: ${{ github.ref_name || 'dev'}}
2222

@@ -43,7 +43,7 @@ jobs:
4343
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
4444
4545
- name: Create Pull Request
46-
uses: peter-evans/create-pull-request@v5
46+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
4747
with:
4848
token: ${{ secrets.GITHUB_TOKEN }}
4949
commit-message: "Update sample data"

Dockerfile.django-alpine

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Dockerfile.nginx to use the caching mechanism of Docker.
66

77
# Ref: https://devguide.python.org/#branchstatus
8-
FROM python:3.11.9-alpine3.20@sha256:df44c0c0761ddbd6388f4549cab42d24d64d257c2a960ad5b276bb7dab9639c7 AS base
8+
FROM python:3.11.9-alpine3.20@sha256:f9ce6fe33d9a5499e35c976df16d24ae80f6ef0a28be5433140236c2ca482686 AS base
99
FROM base AS build
1010
WORKDIR /app
1111
RUN \
@@ -31,7 +31,7 @@ COPY requirements.txt ./
3131
# https://github.com/unbit/uwsgi/issues/1318#issuecomment-542238096
3232
RUN CPUCOUNT=1 pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt
3333

34-
FROM base AS django-alpine
34+
FROM base AS django
3535
WORKDIR /app
3636
ARG uid=1001
3737
ARG gid=1337
@@ -135,5 +135,5 @@ ENV \
135135
DD_UWSGI_NUM_OF_THREADS="2"
136136
ENTRYPOINT ["/entrypoint-uwsgi.sh"]
137137

138-
FROM django-alpine AS django-unittests
138+
FROM django AS django-unittests
139139
COPY unittests/ ./unittests/

Dockerfile.django-debian

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Dockerfile.nginx to use the caching mechanism of Docker.
66

77
# Ref: https://devguide.python.org/#branchstatus
8-
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS base
8+
FROM python:3.11.9-slim-bookworm@sha256:6ed5bff4d7d377e2a27d9285553b8c21cfccc4f00881de1b24c9bc8d90016e82 AS base
99
FROM base AS build
1010
WORKDIR /app
1111
RUN \

Dockerfile.integration-tests-debian

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# code: language=Dockerfile
33

44
FROM openapitools/openapi-generator-cli:v7.11.0@sha256:a9e7091ac8808c6835cf8ec88252bca603f1f889ef1456b63d8add5781feeca7 AS openapitools
5+
# currently only supports x64, no arm yet due to chrome and selenium dependencies
56
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS build
67
WORKDIR /app
78
RUN \

Dockerfile.nginx-alpine

Lines changed: 7 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
# Dockerfile.django-alpine to use the caching mechanism of Docker.
66

77
# Ref: https://devguide.python.org/#branchstatus
8-
FROM python:3.11.9-alpine3.20@sha256:df44c0c0761ddbd6388f4549cab42d24d64d257c2a960ad5b276bb7dab9639c7 AS base
8+
FROM node:20.18.2-alpine3.20@sha256:40cbd847a2db119ba716f2861b04076bcb575a0051923459271a18ff80944f7f AS node
9+
10+
FROM python:3.11.9-alpine3.20@sha256:f9ce6fe33d9a5499e35c976df16d24ae80f6ef0a28be5433140236c2ca482686 AS base
11+
912
FROM base AS build
1013
WORKDIR /app
1114
RUN \
@@ -31,98 +34,11 @@ COPY requirements.txt ./
3134
# https://github.com/unbit/uwsgi/issues/1318#issuecomment-542238096
3235
RUN CPUCOUNT=1 pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt
3336

34-
FROM build AS collectstatic
35-
36-
# Node installation from https://github.com/nodejs/docker-node
37-
ENV NODE_VERSION=20.11.0
38-
39-
RUN addgroup -g 1000 node \
40-
&& adduser -u 1000 -G node -s /bin/sh -D node \
41-
&& apk add --no-cache \
42-
libstdc++ \
43-
&& apk add --no-cache --virtual .build-deps \
44-
curl \
45-
&& ARCH= && alpineArch="$(apk --print-arch)" \
46-
&& case "${alpineArch##*-}" in \
47-
x86_64) \
48-
ARCH='x64' \
49-
CHECKSUM=$(curl -sSL --compressed "https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/SHASUMS256.txt" | grep "node-v${NODE_VERSION}-linux-x64-musl.tar.xz" | cut -d' ' -f1) \
50-
;; \
51-
*) ;; \
52-
esac \
53-
&& if [ -n "${CHECKSUM}" ]; then \
54-
set -eu; \
55-
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz"; \
56-
echo "$CHECKSUM node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" | sha256sum -c - \
57-
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
58-
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs; \
59-
else \
60-
echo "Building from source" \
61-
# backup build
62-
&& apk add --no-cache --virtual .build-deps-full \
63-
binutils-gold \
64-
g++ \
65-
gcc \
66-
gnupg \
67-
libgcc \
68-
linux-headers \
69-
make \
70-
python3 \
71-
# gpg keys listed at https://github.com/nodejs/node#release-keys
72-
&& for key in \
73-
4ED778F539E3634C779C87C6D7062848A1AB005C \
74-
141F07595B7B3FFE74309A937405533BE57C7D57 \
75-
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
76-
61FC681DFB92A079F1685E77973F295594EC4689 \
77-
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
78-
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
79-
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
80-
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
81-
108F52B48DB57BB0CC439B2997B01419BD92F80A \
82-
; do \
83-
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
84-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
85-
done \
86-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
87-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
88-
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
89-
&& grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
90-
&& tar -xf "node-v$NODE_VERSION.tar.xz" \
91-
&& cd "node-v$NODE_VERSION" \
92-
&& ./configure \
93-
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
94-
&& make install \
95-
&& apk del .build-deps-full \
96-
&& cd .. \
97-
&& rm -Rf "node-v$NODE_VERSION" \
98-
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt; \
99-
fi \
100-
&& rm -f "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
101-
&& apk del .build-deps \
102-
# smoke tests
103-
&& node --version \
104-
&& npm --version
10537

106-
ENV YARN_VERSION=1.22.19
38+
FROM build AS collectstatic
39+
RUN apk add nodejs npm
40+
RUN npm install -g yarn --force
10741

108-
RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
109-
&& for key in \
110-
6A010C5166006599AA17F08146C2130DFD2497F5 \
111-
; do \
112-
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
113-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
114-
done \
115-
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
116-
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
117-
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
118-
&& mkdir -p /opt \
119-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
120-
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
121-
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
122-
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
123-
&& apk del .build-deps-yarn \
124-
# smoke test
125-
&& yarn --version
12642

12743
# installing DefectDojo packages
12844
RUN pip3 install \

Dockerfile.nginx-debian

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Dockerfile.django-debian to use the caching mechanism of Docker.
66

77
# Ref: https://devguide.python.org/#branchstatus
8-
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS base
8+
FROM python:3.11.9-slim-bookworm@sha256:6ed5bff4d7d377e2a27d9285553b8c21cfccc4f00881de1b24c9bc8d90016e82 AS base
99
FROM base AS build
1010
WORKDIR /app
1111
RUN \
@@ -42,8 +42,8 @@ RUN \
4242
apt-get -y update && \
4343
apt-get -y install --no-install-recommends apt-transport-https ca-certificates curl wget gnupg && \
4444
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add --no-tty - && \
45-
echo 'deb https://deb.nodesource.com/node_20.x bullseye main' > /etc/apt/sources.list.d/nodesource.list && \
46-
echo 'deb-src https://deb.nodesource.com/node_20.x bullseye main' >> /etc/apt/sources.list.d/nodesource.list && \
45+
echo 'deb https://deb.nodesource.com/node_20.x bookworm main' > /etc/apt/sources.list.d/nodesource.list && \
46+
echo 'deb-src https://deb.nodesource.com/node_20.x bookworm main' >> /etc/apt/sources.list.d/nodesource.list && \
4747
apt-get update -y -o Dir::Etc::sourcelist="sources.list.d/nodesource.list" \
4848
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" && \
4949
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ services:
105105
source: ./docker/extra_settings
106106
target: /app/docker/extra_settings
107107
postgres:
108-
image: postgres:17.2-alpine@sha256:0bcc5bbbb2aa9c9b4c6505845918c7eb55d783cf5c1f434fac33012579fb149d
108+
image: postgres:17.2-alpine@sha256:7e5df973a74872482e320dcbdeb055e178d6f42de0558b083892c50cda833c96
109109
environment:
110110
POSTGRES_DB: ${DD_DATABASE_NAME:-defectdojo}
111111
POSTGRES_USER: ${DD_DATABASE_USER:-defectdojo}

0 commit comments

Comments
 (0)