Skip to content

Commit

Permalink
Merge branch 'dev' into probes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcecagno authored Nov 21, 2024
2 parents 0b71404 + dd63842 commit 7c33943
Show file tree
Hide file tree
Showing 829 changed files with 482,705 additions and 7,272 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A clear and concise description of what you expected to happen.
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]

**Logs**
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).
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).

**Sample scan files**
If applicable, add sample scan files to help reproduce your problem.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/support_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---
**Slack us first!**
The easiest and fastest way to help you is via Slack. There's a free and easy signup to join our #defectdojo channel in the OWASP Slack workspace: [Get Access.](https://owasp-slack.herokuapp.com/)
The easiest and fastest way to help you is via Slack. There's a free and easy signup to join our #defectdojo channel in the OWASP Slack workspace: [Get Access.](https://owasp.org/slack/invite)
If you're confident you've found a bug, or are allergic to Slack, you can submit an issue anyway.

**Be informative**
Expand Down Expand Up @@ -36,7 +36,7 @@ A clear and concise description of what you expected to happen.
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]

**Logs**
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).
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).

**Sample scan files**
If applicable, add sample scan files to help reproduce your problem.
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-docker-images-for-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ jobs:
id: docker_build
uses: docker/build-push-action@v6
timeout-minutes: 10
env:
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
with:
context: .
push: false
tags: defectdojo/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }}
file: Dockerfile.${{ matrix.docker-image }}-${{ matrix.os }}
outputs: type=docker,dest=${{ matrix.docker-image }}-${{ matrix.os }}_img
cache-from: type=gha,scope=${{ matrix.docker-image }}
cache-to: type=gha,mode=max,scope=${{ matrix.docker-image }}


# export docker images to be used in next jobs below
- name: Upload image ${{ matrix.docker-image }} as artifact
timeout-minutes: 10
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.docker-image }}
name: built-docker-image-${{ matrix.docker-image }}-${{ matrix.os }}
path: ${{ matrix.docker-image }}-${{ matrix.os }}_img
retention-days: 1
retention-days: 1
2 changes: 1 addition & 1 deletion .github/workflows/fetch-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: docker compose down

- name: Upload oas.${{ matrix.file-type }} as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: oas-${{ matrix.file-type }}
path: oas.${{ matrix.file-type }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ jobs:

# load docker images from build jobs
- name: Load images from artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: built-docker-image
pattern: built-docker-image-*
merge-multiple: true

- name: Load docker images
timeout-minutes: 10
run: |-
docker load -i nginx/nginx-${{ matrix.os }}_img
docker load -i django/django-${{ matrix.os }}_img
docker load -i integration-tests/integration-tests-debian_img
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
docker load -i built-docker-image/django-${{ matrix.os }}_img
docker load -i built-docker-image/integration-tests-debian_img
docker images
- name: Set integration-test mode
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/k8s-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
# are tested (https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#available-versions)
- databases: pgsql
brokers: redis
k8s: 'v1.26.11'
k8s: 'v1.30.3'
os: debian
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Minikube
uses: manusa/actions-setup-minikube@v2.11.0
uses: manusa/actions-setup-minikube@v2.13.0
with:
minikube version: 'v1.31.2'
minikube version: 'v1.33.1'
kubernetes version: ${{ matrix.k8s }}
driver: docker
start args: '--addons=ingress --cni calico'
Expand All @@ -48,14 +48,18 @@ jobs:
minikube status
- name: Load images from artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: built-docker-image
pattern: built-docker-image-*
merge-multiple: true

- name: Load docker images
timeout-minutes: 10
run: |-
eval $(minikube docker-env)
docker load -i nginx/nginx-${{ matrix.os }}_img
docker load -i django/django-${{ matrix.os }}_img
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
docker load -i built-docker-image/django-${{ matrix.os }}_img
docker images
- name: Configure HELM repos
Expand All @@ -70,26 +74,28 @@ jobs:
echo "pgsql=${{ env.HELM_PG_DATABASE_SETTINGS }}" >> $GITHUB_ENV
echo "redis=${{ env.HELM_REDIS_BROKER_SETTINGS }}" >> $GITHUB_ENV
- name: Deploying Djano application with ${{ matrix.databases }} ${{ matrix.brokers }}
timeout-minutes: 10
- name: Deploying Django application with ${{ matrix.databases }} ${{ matrix.brokers }}
timeout-minutes: 15
run: |-
helm install \
--timeout 800s \
--wait \
--wait-for-jobs \
defectdojo \
./helm/defectdojo \
--set django.ingress.enabled=true \
--set imagePullPolicy=Never \
${{ env[matrix.databases] }} \
${{ env[matrix.brokers] }} \
--set createSecret=true \
--set tag=${{ matrix.os }} \
# --set imagePullSecrets=defectdojoregistrykey
--set tag=${{ matrix.os }}
- name: Check deployment status
if: always()
run: |-
kubectl get pods
kubectl get ingress
kubectl get services
kubectl get all,ingress # all = pods, services, deployments, replicasets, statefulsets, jobs
helm status defectdojo
helm history defectdojo
- name: Check Application
timeout-minutes: 10
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release-3-master-into-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ jobs:
CURRENT_CHART_VERSION=$(grep -oP 'version: (\K\S*)?' helm/defectdojo/Chart.yaml | head -1)
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
- name: Update settings SHA
run: sha256sum dojo/settings/settings.dist.py | cut -d ' ' -f1 > dojo/settings/.settings.dist.py.sha256sum

- name: Check numbers
run: |
grep version dojo/__init__.py
grep appVersion helm/defectdojo/Chart.yaml
grep version components/package.json
cat dojo/settings/.settings.dist.py.sha256sum
- name: Create upgrade notes to documentation
run: |
Expand Down Expand Up @@ -132,11 +136,15 @@ jobs:
CURRENT_CHART_VERSION=$(grep -oP 'version: (\K\S*)?' helm/defectdojo/Chart.yaml | head -1)
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
- name: Update settings SHA
run: sha256sum dojo/settings/settings.dist.py | cut -d ' ' -f1 > dojo/settings/.settings.dist.py.sha256sum

- name: Check numbers
run: |
grep version dojo/__init__.py
grep appVersion helm/defectdojo/Chart.yaml
grep version components/package.json
cat dojo/settings/.settings.dist.py.sha256sum
- name: Push version changes
uses: stefanzweifel/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Load OAS files from artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
pattern: oas-*

- name: Upload Release Asset - OpenAPI Specification - YAML
id: upload-release-asset-yaml
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/release-x-manual-docker-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,46 +49,28 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
env:
docker-image: ${{ matrix.docker-image }}
with:
path: /tmp/.buildx-cache-${{ env.docker-image }}
key: ${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-${{ env.workflow_name }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-${{ env.workflow_name}}-${{ github.sha }}
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-${{ env.workflow_name }}
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ matrix.os }}-
- name: Build and push images with debian
if: ${{ matrix.os == 'debian' }}
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
REPO_ORG: ${{ env.repoorg }}
docker-image: ${{ matrix.docker-image }}
with:
push: true
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
file: ./Dockerfile.${{ env.docker-image }}-${{ matrix.os }}
context: .
cache-from: type=local,src=/tmp/.buildx-cache-${{ env.docker-image }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ env.docker-image }}

- name: Build and push images with alpine
if: ${{ matrix.os == 'alpine' }}
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
REPO_ORG: ${{ env.repoorg }}
docker-image: ${{ matrix.docker-image }}
with:
push: true
tags: ${{ env.REPO_ORG }}/defectdojo-${{ env.docker-image}}:${{ github.event.inputs.release_number }}-${{ matrix.os }}
file: ./Dockerfile.${{ env.docker-image }}-${{ matrix.os }}
context: .
cache-from: type=local,src=/tmp/.buildx-cache-${{ env.docker-image }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ env.docker-image }}
# platforms: ${{ matrix.platform }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
14 changes: 9 additions & 5 deletions .github/workflows/rest-framework-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,26 @@ jobs:

# load docker images from build jobs
- name: Load images from artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: built-docker-image
pattern: built-docker-image-*
merge-multiple: true

- name: Load docker images
timeout-minutes: 10
run: |-
docker load -i nginx/nginx-${{ matrix.os }}_img
docker load -i django/django-${{ matrix.os }}_img
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
docker load -i built-docker-image/django-${{ matrix.os }}_img
docker images
# run tests with docker compose
- name: Set unit-test mode
run: docker/setEnv.sh unit_tests_cicd

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

# no celery or initializer needed for unit tests
- name: Unit tests
Expand Down
15 changes: 12 additions & 3 deletions Dockerfile.integration-tests-debian
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# code: language=Dockerfile

FROM openapitools/openapi-generator-cli:v7.7.0@sha256:99924315933d49e7b33a7d2074bb2b64fc8def8f74519939036e24eb48f00336 AS openapitools
FROM openapitools/openapi-generator-cli:v7.10.0@sha256:f2054a5a7908ad81017d0f0839514ba5eab06ae628914ff71554d46fac1bcf7a AS openapitools
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS build
WORKDIR /app
RUN \
Expand All @@ -25,8 +25,13 @@ RUN pip install --no-cache-dir selenium==4.9.0 requests

# Install the latest Google Chrome stable release
WORKDIR /opt/chrome

# TODO: figure out whatever fix is necessary to use Chrome >= 128 and put this back in the RUN below so we stay
# up-to-date
# 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') && \

RUN \
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') && \
chrome_url="https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chrome-linux64.zip" && \
wget $chrome_url && \
unzip chrome-linux64.zip && \
rm -rf chrome-linux64.zip && \
Expand All @@ -49,8 +54,12 @@ RUN apt-get install -y libxi6 libgconf-2-4 jq libjq1 libonig5 libxkbcommon0 libx

# Installing the latest stable Google Chrome driver release
WORKDIR /opt/chrome-driver
# TODO: figure out whatever fix is necessary to use Chrome >= 128 and put this back in the RUN below so we stay
# up-to-date
# 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') && \

RUN \
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') && \
chromedriver_url="https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chromedriver-linux64.zip" && \
wget $chromedriver_url && \
unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver && \
rm -rf chromedriver-linux64.zip && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.nginx-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ COPY manage.py ./
COPY dojo/ ./dojo/
RUN env DD_SECRET_KEY='.' python3 manage.py collectstatic --noinput && true

FROM nginx:1.27.0-alpine@sha256:208b70eefac13ee9be00e486f79c695b15cef861c680527171a27d253d834be9
FROM nginx:1.27.2-alpine@sha256:74175cf34632e88c6cfe206897cbfe2d2fecf9bf033c40e7f9775a3689e8adc7
ARG uid=1001
ARG appuser=defectdojo
COPY --from=collectstatic /app/static/ /usr/share/nginx/html/static/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.nginx-debian
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ COPY dojo/ ./dojo/

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

FROM nginx:1.27.0-alpine@sha256:208b70eefac13ee9be00e486f79c695b15cef861c680527171a27d253d834be9
FROM nginx:1.27.2-alpine@sha256:74175cf34632e88c6cfe206897cbfe2d2fecf9bf033c40e7f9775a3689e8adc7
ARG uid=1001
ARG appuser=defectdojo
COPY --from=collectstatic /app/static/ /usr/share/nginx/html/static/
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DefectDojo is licensed under the 3-Clause BSD License: https://github.com/DefectDojo/django-DefectDojo/blob/master/LICENSE.md


However, DefectDojos dependencies may have different licensing requirements and terms.
However, DefectDojo's dependencies may have different licensing requirements and terms.
Complete source code for DefectDojo dependencies are made available on PyPi: https://pypi.org/

THIRD-PARTY SOFTWARE NOTICES FOR DEFECTDOJO
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,18 @@ Core Moderators can help you with pull requests or feedback on dev ideas:
* Cody Maffucci ([@Maffooch](https://github.com/maffooch) | [LinkedIn](https://www.linkedin.com/in/cody-maffucci))

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

## Hall of Fame

* Jannik Jürgens ([@alles-klar](https://github.com/alles-klar)) - Jannik was a long time contributor and moderator for
DefectDojo and made significant contributions to many areas of the platform. Jannik was instrumental in pioneering
and optimizing deployment methods.
* Valentijn Scholten ([@valentijnscholten](https://github.com/valentijnscholten) |
[Sponsor](https://github.com/sponsors/valentijnscholten) |
[LinkedIn](https://www.linkedin.com/in/valentijn-scholten/)) - Valentijn served as a core moderator for 3 years.
Valentijns contributions were numerous and extensive. He overhauled, improved, and optimized many parts of the
Valentijn's contributions were numerous and extensive. He overhauled, improved, and optimized many parts of the
codebase. He consistently fielded questions, provided feedback on pull requests, and provided a helping hand wherever
it was needed.
* Fred Blaise ([@madchap](https://github.com/madchap) | [LinkedIn](https://www.linkedin.com/in/fredblaise/)) - Fred
Expand Down
Loading

0 comments on commit 7c33943

Please sign in to comment.