Skip to content

Commit

Permalink
Merge branch 'dev' into cloudsql-proxy-sidecar
Browse files Browse the repository at this point in the history
  • Loading branch information
jndeverteuil authored Sep 25, 2024
2 parents 6e4128a + 3564cfa commit b8705d1
Show file tree
Hide file tree
Showing 336 changed files with 10,925 additions and 2,804 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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/support_request.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: 1 addition & 3 deletions .github/workflows/build-docker-images-for-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ jobs:
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
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
20 changes: 0 additions & 20 deletions .github/workflows/release-x-manual-docker-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ 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
Expand All @@ -73,8 +61,6 @@ jobs:
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' }}
Expand All @@ -88,9 +74,3 @@ jobs:
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 }}
4 changes: 2 additions & 2 deletions .github/workflows/rest-framework-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
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
2 changes: 1 addition & 1 deletion components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"metismenu": "~3.0.7",
"moment": "^2.30.1",
"morris.js": "morrisjs/morris.js",
"pdfmake": "^0.2.12",
"pdfmake": "^0.2.13",
"startbootstrap-sb-admin-2": "1.0.7"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions components/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,10 @@ path-parse@^1.0.7:
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

pdfmake@^0.2.12:
version "0.2.12"
resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.12.tgz#5156f91ff73797947942aa342423bedaa0c0bc93"
integrity sha512-TFsqaG6KVtk+TWermmJNNwom3wmB/xiz07prM74KBhdM+7pz3Uwq2b0uoqhhQRn6cYUTpL8lXZY6xF011o1YcQ==
pdfmake@^0.2.13:
version "0.2.13"
resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.13.tgz#ea43fe9f0c8de1e5ec7b08486d6f4f8bbb8619e4"
integrity sha512-qeVE9Bzjm0oPCitH4/HYM/XCGTwoeOAOVAXPnV3s0kpPvTLkTF/bAF4jzorjkaIhXGQhzYk6Xclt0hMDYLY93w==
dependencies:
"@foliojs-fork/linebreak" "^1.1.1"
"@foliojs-fork/pdfkit" "^0.14.0"
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.override.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ services:
published: 8025
protocol: tcp
mode: host
"webhook.endpoint":
image: mccutchen/go-httpbin:v2.15.0@sha256:24528cf5229d0b70065ac27e6c9e4d96f5452a84a3ce4433e56573c18d96827a
2 changes: 2 additions & 0 deletions docker-compose.override.unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ services:
redis:
image: busybox:1.36.1-musl
entrypoint: ['echo', 'skipping', 'redis']
"webhook.endpoint":
image: mccutchen/go-httpbin:v2.15.0@sha256:24528cf5229d0b70065ac27e6c9e4d96f5452a84a3ce4433e56573c18d96827a
volumes:
defectdojo_postgres_unit_tests: {}
defectdojo_media_unit_tests: {}
2 changes: 2 additions & 0 deletions docker-compose.override.unit_tests_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ services:
redis:
image: busybox:1.36.1-musl
entrypoint: ['echo', 'skipping', 'redis']
"webhook.endpoint":
image: mccutchen/go-httpbin:v2.15.0@sha256:24528cf5229d0b70065ac27e6c9e4d96f5452a84a3ce4433e56573c18d96827a
volumes:
defectdojo_postgres_unit_tests: {}
defectdojo_media_unit_tests: {}
4 changes: 2 additions & 2 deletions docker/docker-compose-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ current=$(docker compose version --short)

echo 'Checking docker compose version'
if [[ $main -lt 2 ]]; then
echo "$current is not a supported docker-compose version, please upgrade to the minimum supported version: 2.0"
echo "$current is not a supported 'docker compose' version, please upgrade to the minimum supported version: 2.0"
exit 1
elif [[ $main -eq 1 ]]; then
if [[ $minor -lt 28 ]]; then
echo "$current is not supported docker-compose version, please upgrade to minimal supported version:1.28"
echo "$current is not supported 'docker compose' version, please upgrade to minimal supported version:1.28"
exit 1
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion docker/extra_settings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If a file if placed here, it will be copied on startup to `dojo/settings/local_s
For an example, see [template-local_settings](../../dojo/settings/template-local_settings)

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

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.

Expand Down
14 changes: 7 additions & 7 deletions docs/content/en/contributing/how-to-write-a-parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All commands assume that you're located at the root of the django-DefectDojo clo
- Checkout `dev` and make sure you're up to date with the latest changes.
- It's advised that you create a dedicated branch for your development, such as `git checkout -b parser-name`.

It is easiest to use the docker-compose deployment as it has hot-reload capbility for uWSGI.
It is easiest to use the docker compose deployment as it has hot-reload capbility for uWSGI.
Set up your environment to use the debug environment:

`$ docker/setEnv.sh debug`
Expand All @@ -27,7 +27,7 @@ Please have a look at [DOCKER.md](https://github.com/DefectDojo/django-DefectDoj
You will want to build your docker images locally, and eventually pass in your local user's `uid` to be able to write to the image (handy for database migration files). Assuming your user's `uid` is `1000`, then:

{{< highlight bash >}}
$ docker-compose build --build-arg uid=1000
$ docker compose build --build-arg uid=1000
{{< /highlight >}}

## Which files do you need to modify?
Expand Down Expand Up @@ -279,7 +279,7 @@ This ensures the file is closed at the end of the with statement, even if an exc

### Test database

To test your unit tests locally, you first need to grant some rights. Get your MySQL root password from the docker-compose logs, login as root and issue the following commands:
To test your unit tests locally, you first need to grant some rights. Get your MySQL root password from the docker compose logs, login as root and issue the following commands:

{{< highlight mysql >}}
MYSQL> grant all privileges on test_defectdojo.* to defectdojo@'%';
Expand All @@ -291,17 +291,17 @@ MYSQL> flush privileges;
This local command will launch the unit test for your new parser

{{< highlight bash >}}
$ docker-compose exec uwsgi bash -c 'python manage.py test unittests.tools.<your_unittest_py_file>.<main_class_name> -v2'
$ docker compose exec uwsgi bash -c 'python manage.py test unittests.tools.<your_unittest_py_file>.<main_class_name> -v2'
{{< /highlight >}}

Example for the blackduck hub parser:

{{< highlight bash >}}
$ docker-compose exec uwsgi bash -c 'python manage.py test unittests.tools.test_blackduck_csv_parser.TestBlackduckHubParser -v2'
$ docker compose exec uwsgi bash -c 'python manage.py test unittests.tools.test_blackduck_csv_parser.TestBlackduckHubParser -v2'
{{< /highlight >}}

{{% alert title="Information" color="info" %}}
If you want to run all unit tests, simply run `$ docker-compose exec uwsgi bash -c 'python manage.py test unittests -v2'`
If you want to run all unit tests, simply run `$ docker compose exec uwsgi bash -c 'python manage.py test unittests -v2'`
{{% /alert %}}

### Endpoint validation
Expand Down Expand Up @@ -330,7 +330,7 @@ In the event where you'd have to change the model, e.g. to increase a database c
* Create a new migration file in dojo/db_migrations by running and including as part of your PR

{{< highlight bash >}}
$ docker-compose exec uwsgi bash -c 'python manage.py makemigrations -v2'
$ docker compose exec uwsgi bash -c 'python manage.py makemigrations -v2'
{{< /highlight >}}

### Accept a different type of file to upload
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/getting_started/running-in-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ draft: false
weight: 4
---

## Production use with docker-compose
## Production use with docker compose

The docker-compose.yml file in this repository is fully functional to evaluate DefectDojo in your local environment.

Expand Down Expand Up @@ -76,7 +76,7 @@ Dockerfile.django-* for in-file references.

You can execute the following command to see the configuration:

`docker-compose exec celerybeat bash -c "celery -A dojo inspect stats"`
`docker compose exec celerybeat bash -c "celery -A dojo inspect stats"`
and see what is in effect.

#### Asynchronous Import
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/getting_started/upgrading/2.23.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ There is a migration process built into the upgrade that will automatically conv
- If your deployment uses the MySQL containerized database, please see the following updates to run DefectDojo:
- Use of the helper script "dc-up": `./dc-up.sh mysql-rabbitmq` or `./dc-up.sh mysql-redis`
- Use of the helper script "dc-up-d": `./dc-up-d.sh mysql-rabbitmq` or `./dc-up-d.sh mysql-redis`
- Use of Docker Compose directly: `docker-compose --profile mysql-rabbitmq --env-file ./docker/environments/mysql-rabbitmq.env up` or `docker-compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env up`
- Use of Docker Compose directly: `docker compose --profile mysql-rabbitmq --env-file ./docker/environments/mysql-rabbitmq.env up` or `docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env up`

For all other changes, check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.23.0) for the contents of the release.
2 changes: 1 addition & 1 deletion docs/content/en/getting_started/upgrading/2.30.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There are instructions for upgrading to 2.30.0 if you disabled `enable_auditlog`

Parameter `enable_auditlog` is not possible to set through System settings anymore. If you set this parameter or you need to change it to `False` (to disable audit logging), set environmental variable `DD_ENABLE_AUDITLOG` to `False`.

If you are using docker-compose, another EnvVar should be added to the `docker-compose.yml` file in all the containers ran by the django image. This should do the trick
If you are using docker compose, another EnvVar should be added to the `docker-compose.yml` file in all the containers ran by the django image. This should do the trick
```yaml
DD_ENABLE_AUDITLOG: ${DD_ENABLE_AUDITLOG:-False}
```
Expand Down
12 changes: 6 additions & 6 deletions docs/content/en/getting_started/upgrading/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ draft: false
weight: 5
---

## Docker-compose
## Docker compose

When you deploy a vanilla docker-compose, it will create a persistent
When you deploy a vanilla docker compose, it will create a persistent
volume for your Postgres database. As long as your volume is there, you
should not lose any data.

Expand All @@ -19,7 +19,7 @@ DockerHub to update.
{{% /alert %}}


The generic upgrade method for docker-compose are as follows:
The generic upgrade method for docker compose are as follows:
- Pull the latest version

``` {.sourceCode .bash}
Expand All @@ -46,10 +46,10 @@ The generic upgrade method for docker-compose are as follows:
- Re-start DefectDojo, allowing for container recreation:
`./dc-up-d.sh`
- Database migrations will be run automatically by the initializer.
Check the output via `docker-compose logs initializer` or relevant k8s command
Check the output via `docker compose logs initializer` or relevant k8s command
- If you have the initializer disabled (or if you want to be on the
safe side), run the migration command:
`docker-compose exec uwsgi /bin/bash -c "python manage.py migrate"`
`docker compose exec uwsgi /bin/bash -c "python manage.py migrate"`
### Building your local images
Expand All @@ -64,7 +64,7 @@ first.
git merge origin/master
```
Then replace the first step of the above generic upgrade method for docker-compose with: `docker-compose build`
Then replace the first step of the above generic upgrade method for docker compose with: `docker compose build`
## godojo installations
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/integrations/burp-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Defect Dojo Burp plugin"
description: "Export findings directly from Burp to DefectDojo."
draft: false
weight: 8
weight: 9
---

**Please note: The DefectDojo Burp Plugin has been sunset and is no longer a supported feature.**
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/integrations/exporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Exporting"
description: "DefectDojo has the ability to export findings."
draft: false
weight: 11
weight: 12
---


Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/integrations/google-sheets-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Google Sheets synchronisation"
description: "Export finding details to Google Sheets and upload changes from Google Sheets."
draft: false
weight: 7
weight: 8
---

**Please note - the Google Sheets feature has been deprecated as of DefectDojo version 2.21.0 - these documents are for reference only.**
Expand Down
6 changes: 3 additions & 3 deletions docs/content/en/integrations/jira.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,19 @@ optional arguments:
This can be executed from the uwsgi docker container using:

{{< highlight bash >}}
$ docker-compose exec uwsgi /bin/bash -c 'python manage.py jira_status_reconciliation'
$ docker compose exec uwsgi /bin/bash -c 'python manage.py jira_status_reconciliation'
{{< /highlight >}}

DEBUG output can be obtains via `-v 3`, but only after increasing the logging to DEBUG level in your settings.dist.py or local_settings.py file

{{< highlight bash >}}
$ docker-compose exec uwsgi /bin/bash -c 'python manage.py jira_status_reconciliation -v 3'
$ docker compose exec uwsgi /bin/bash -c 'python manage.py jira_status_reconciliation -v 3'
{{< /highlight >}}

At the end of the command a semicolon seperated CSV summary will be printed. This can be captured by redirecting stdout to a file:

{{< highlight bash >}}
$ docker-compose exec uwsgi /bin/bash -c 'python manage.py jira_status_reconciliation > jira_reconciliation.csv'
$ docker compose exec uwsgi /bin/bash -c 'python manage.py jira_status_reconciliation > jira_reconciliation.csv'
{{< /highlight >}}


Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/integrations/languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Languages and lines of code"
description: "You can import an analysis of languages used in a project, including lines of code."
draft: false
weight: 9
weight: 10
---

## Import of languages for a project
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/integrations/ldap-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Read the docs for Django Authentication with LDAP here: https://django-auth-ldap

#### docker-compose.yml

In order to pass the variables to the settings.dist.py file via docker, it's a good idea to add these to the docker-compose file.
In order to pass the variables to the settings.dist.py file via docker, it's a good idea to add these to the docker compose file.

You can do this by adding the following variables to the environment section for the uwsgi image:
```yaml
Expand Down
Loading

0 comments on commit b8705d1

Please sign in to comment.