Skip to content

Commit 6bbb041

Browse files
Merge pull request #2931 from DefectDojo/release/1.8.0
Release 1.8.0
2 parents d8fb1cd + a2dc4f5 commit 6bbb041

File tree

290 files changed

+14496
-96664
lines changed

Some content is hidden

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

290 files changed

+14496
-96664
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Flake8 your PR
2+
# run on pull_request_target instead of just pull_request as we need write access to update the status check
3+
on: [pull_request_target]
4+
jobs:
5+
flake8-your-pr:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
fetch-depth: 2
11+
12+
# - uses: tayfun/flake8-your-pr@master
13+
- uses: valentijnscholten/flake8-your-pr@master
14+
env:
15+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Integration tests
2+
# run on pull_request_target instead of just pull_request as we need write access to update the status check
3+
on: [pull_request_target]
4+
jobs:
5+
integration_test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
10+
- name: Set integration-test mode
11+
run: docker/setEnv.sh integration_tests
12+
13+
# Pull the latest image to build, and avoid caching pull-only images.
14+
# (docker pull is faster than caching in most cases.)
15+
- run: docker-compose pull
16+
# In this step, this action saves a list of existing images,
17+
# the cache is created without them in the post run.
18+
# It also restores the cache if it exists.
19+
- uses: satackey/action-docker-layer-caching@master
20+
# Ignore the failure of a step and avoid terminating the job.
21+
continue-on-error: true
22+
23+
- name: Build the stack
24+
run: docker-compose build
25+
26+
# phased startup so we can use the exit code from integrationtest container
27+
- name: Stary MySQL
28+
run: docker-compose up -d
29+
30+
- name: Initialize
31+
run: docker-compose up --exit-code-from initializer initializer
32+
33+
- name: Start Dojo
34+
# implicity starts uwsgi and rabbitmq
35+
run: docker-compose up -d nginx celerybeat celeryworker
36+
37+
- name: Integration tests
38+
run: docker-compose up --exit-code-from integrationtest integrationtest
39+
40+
- name: Logs
41+
if: failure()
42+
run: docker-compose logs --tail="2500" uwsgi
43+
44+
- name: Shutdown
45+
if: always()
46+
run: docker-compose down

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ dojo/uploads/risk/*
7676
dojo/uploads/reports/*
7777
dojo/scans/scan*
7878
dojo/uploads/threat/*
79+
dojo/fixtures/initial_surveys.json
7980
.idea
8081
*.sqlite
8182
*.db
@@ -113,3 +114,10 @@ quick.bash
113114
Pipfile
114115
Pipfile*
115116

117+
118+
#ignore locally added certs
119+
certs/
120+
121+
# Helm dependencies
122+
helm/defectdojo/charts
123+

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ services:
44
- docker
55
env:
66
global:
7-
- K8S_VERSION=v1.13.4
8-
- MINIKUBE_VERSION=v0.35.0
9-
- HELM_VERSION=v2.13.0
7+
- K8S_VERSION=v1.19.0
8+
- MINIKUBE_VERSION=v1.12.3
9+
- HELM_VERSION=v3.3.2
1010
- CHANGE_MINIKUBE_NONE_USER=true
1111
matrix:
1212
- TEST=flake8
@@ -15,12 +15,14 @@ env:
1515
- BROKER=rabbitmq DATABASE=postgresql
1616
- BROKER=redis DATABASE=mysql
1717
- BROKER=redis DATABASE=postgresql
18+
- BROKER=rabbitmq DATABASE=postgresql REPLICATION=enabled
19+
- BROKER=rabbitmq DATABASE=postgresql EXTRAVAL=enabled
1820
- TEST=snyk
19-
matrix:
21+
matrix:
2022
allow_failures:
2123
- env: TEST=snyk
2224
jobs:
23-
include:
25+
include:
2426
- stage: deploy
2527
env: TEST=deploy
2628
before_install: ['./travis/before-install.sh']

BRANCHING-MODEL.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@ This section describes
33
- how branches are handled
44
- defectdojo release cycle
55

6+
Please be careful to submit your pull requests to the correct branch:
7+
- bugfix: latest "release/a.b.x" branch (+ merge using a separate PR against the dev branch)
8+
- evolutions: dev branch
9+
10+
If in doubt please use dev branch.
11+
612
# Release and hotfix model
713
![Schemas](doc/branching_model.png)
8-
## Releasing
9-
- Start a release/x.y.0 release branch off dev branch
10-
- Commit only bug fixes from `dev` branch onto this branch
11-
- Dev branch keeps living with further evolutions
12-
- Every 4-8 weeks, merge the release branch to master and tag x.y.0: this is when the new release is out: x.(y+1).0
13-
14-
# Issuing a hotfix
15-
- In case of major issue found after releasing, and fixed in `dev`:
16-
- Issue a hotfix branch (first is x.y.1) holding this fix
17-
- Merge to `master` and the next release branch
1814

1915

20-
Diagrams created with https://www.planttext.com
16+
Diagrams created with https://www.planttext.com/
2117

22-
This model is close to gitflow https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow, https://nvie.com/posts/a-successful-git-branching-model/ with the feature branch being made in each contributor repository.
18+
This model is inspired by https://nvie.com/posts/a-successful-git-branching-model/ with the feature branch being made in each contributor repository.

Dockerfile.django

Lines changed: 25 additions & 5 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.6.11-slim-buster@sha256:9111ff37d96bdcd84bcac261951ac410ee276144eb8a02f06e5907ff4ff2ffea as build
8+
FROM python:3.6.12-slim-buster@sha256:e5259113df5a7c4dae16ad37c2ca53b1cf722e051cfd5f624e7b76aa72389e0c as build
99
WORKDIR /app
1010
RUN \
1111
apt-get -y update && \
@@ -24,8 +24,11 @@ RUN \
2424
COPY requirements.txt ./
2525
RUN pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt
2626

27-
FROM python:3.6.11-slim-buster@sha256:9111ff37d96bdcd84bcac261951ac410ee276144eb8a02f06e5907ff4ff2ffea
27+
FROM python:3.6.12-slim-buster@sha256:e5259113df5a7c4dae16ad37c2ca53b1cf722e051cfd5f624e7b76aa72389e0c
2828
WORKDIR /app
29+
ARG uid=1001
30+
ARG appuser=defectdojo
31+
ENV appuser ${appuser}
2932
RUN \
3033
apt-get -y update && \
3134
# ugly fix to install postgresql-client without errors
@@ -64,6 +67,7 @@ COPY \
6467
docker/entrypoint-unit-tests.sh \
6568
docker/entrypoint-unit-tests-devDocker.sh \
6669
docker/wait-for-it.sh \
70+
certs/* \
6771
/
6872
COPY wsgi.py manage.py tests/unit-tests.sh ./
6973
COPY dojo/ ./dojo/
@@ -74,11 +78,17 @@ COPY tests/ ./tests/
7478
RUN \
7579
mkdir -p dojo/migrations && \
7680
chmod g=u dojo/migrations && \
77-
chmod g=u /var/run && \
7881
true
7982
USER root
80-
RUN chmod -R 0777 /app
81-
USER 1001
83+
RUN \
84+
adduser --system --no-create-home --disabled-password --gecos '' \
85+
--uid ${uid} ${appuser} && \
86+
chown -R ${appuser} /app && \
87+
chmod 0700 /app && \
88+
chmod 0750 -R /app/* && \
89+
mkdir /var/run/${appuser} && \
90+
chown ${appuser} /var/run/${appuser}
91+
USER ${appuser}
8292
ENV \
8393
DD_ADMIN_USER=admin \
8494
@@ -94,6 +104,14 @@ ENV \
94104
DD_CELERY_BROKER_PORT="5672" \
95105
DD_CELERY_BROKER_PATH="//" \
96106
DD_CELERY_LOG_LEVEL="INFO" \
107+
DD_CELERY_WORKER_POOL_TYPE="solo" \
108+
# Enable prefork and options below to ramp-up celeryworker performance. Presets should work fine for a machine with 8GB of RAM, while still leaving room.
109+
# See https://docs.celeryproject.org/en/stable/userguide/workers.html#id12 for more details
110+
# DD_CELERY_WORKER_POOL_TYPE="prefork" \
111+
# DD_CELERY_WORKER_AUTOSCALE_MIN="2" \
112+
# DD_CELERY_WORKER_AUTOSCALE_MAX="8" \
113+
# DD_CELERY_WORKER_CONCURRENCY="8" \
114+
# DD_CELERY_WORKER_PREFETCH_MULTIPLIER="128" \
97115
DD_DATABASE_ENGINE="django.db.backends.mysql" \
98116
DD_DATABASE_HOST="mysql" \
99117
DD_DATABASE_NAME="defectdojo" \
@@ -103,6 +121,8 @@ ENV \
103121
DD_INITIALIZE=true \
104122
DD_UWSGI_MODE="socket" \
105123
DD_UWSGI_ENDPOINT="0.0.0.0:3031" \
124+
DD_UWSGI_NUM_OF_PROCESSES="2" \
125+
DD_UWSGI_NUM_OF_THREADS="2" \
106126
DD_DJANGO_ADMIN_ENABLED="True" \
107127
DD_TRACK_MIGRATIONS="True" \
108128
DD_DJANGO_METRICS_ENABLED="False"

Dockerfile.integration-tests

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

22
# code: language=Dockerfile
33

4-
FROM python:3.6.11-slim-buster@sha256:9111ff37d96bdcd84bcac261951ac410ee276144eb8a02f06e5907ff4ff2ffea as build
4+
FROM python:3.6.12-slim-buster@sha256:e5259113df5a7c4dae16ad37c2ca53b1cf722e051cfd5f624e7b76aa72389e0c as build
55
WORKDIR /app
66
RUN \
77
apt-get -y update && \

Dockerfile.nginx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# The code for the build image should be idendical with the code in
44
# Dockerfile.django to use the caching mechanism of Docker.
55

6-
FROM python:3.6.11-slim-buster@sha256:9111ff37d96bdcd84bcac261951ac410ee276144eb8a02f06e5907ff4ff2ffea as build
6+
FROM python:3.6.12-slim-buster@sha256:e5259113df5a7c4dae16ad37c2ca53b1cf722e051cfd5f624e7b76aa72389e0c as build
77
WORKDIR /app
88
RUN \
99
apt-get -y update && \
@@ -64,14 +64,17 @@ RUN \
6464
python3 manage.py collectstatic --noinput && \
6565
true
6666

67-
FROM nginx:1.19.1-alpine@sha256:966f134cf5ddeb12a56ede0f40fff754c0c0a749182295125f01a83957391d84
67+
FROM nginx:1.19.2-alpine@sha256:4635b632d2aaf8c37c8a1cf76a1f96d11b899f74caa2c6946ea56d0a5af02c0c
68+
ARG uid=1001
69+
ARG appuser=defectdojo
6870
COPY --from=collectstatic /app/static/ /usr/share/nginx/html/static/
6971
COPY wsgi_params nginx/nginx.conf nginx/nginx_TLS.conf /etc/nginx/
7072
COPY docker/entrypoint-nginx.sh /
7173
RUN \
7274
apk add --no-cache openssl && \
7375
chmod -R g=u /var/cache/nginx && \
74-
chmod -R g=u /var/run && \
76+
mkdir /var/run/defectdojo && \
77+
chmod -R g=u /var/run/defectdojo && \
7578
mkdir -p /etc/nginx/ssl && \
7679
chmod -R g=u /etc/nginx && \
7780
true
@@ -84,6 +87,6 @@ ENV \
8487
NGINX_METRICS_ENABLED="false" \
8588
METRICS_HTTP_AUTH_USER="" \
8689
METRICS_HTTP_AUTH_PASSWORD=""
87-
USER 1001
90+
USER ${uid}
8891
EXPOSE 8080
8992
ENTRYPOINT ["/entrypoint-nginx.sh"]

PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
This template is for your information. Please clear everything when submitting your pull request.
22

3-
**Note: DefectDojo is now on Python3.6 and Django 2.2.x. Please submit your pull requests to the 'dev' branch as the 'legacy-python2.7' branch is only for bug fixes. Any new features submitted to the legacy branch will be ignored and closed.**
3+
**Note: DefectDojo is now on Python3.6 and Django 2.2.x.**
4+
5+
**Please submit your pull requests to :**
6+
7+
**- evolutions: dev branch**
8+
9+
**- bugfix: latest "release/x.y.z" branch**
10+
11+
**- hotfixes: master branch**
12+
13+
If in doubt you can use dev branch, it will just roll-out later.
414

515
When submitting a pull request, please make sure you have completed the following checklist:
616

components/package.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
"bootstrap-social": "^4.0.0",
66
"bootstrap-wysiwyg": "^2.0.0",
77
"bootswatch": "3.4.1",
8-
"chosen": "harvesthq/bower-chosen#~1.4.0",
9-
"chosen-bootstrap": "dbtek/chosen-bootstrap#~1.1.0",
8+
"chosen-bootstrap": "https://github.com/dbtek/chosen-bootstrap",
9+
"chosen-js": "^1.8.7",
1010
"clipboard": "^2.0.6",
1111
"components-jqueryui": "^1.0.0",
12-
"datatables": "1.10.18",
12+
"datatables.net": "^1.10.22",
13+
"datatables.net-bs": "^1.10.22",
14+
"datatables.net-buttons-bs": "^1.6.4",
15+
"datatables.net-buttons-dt": "^1.6.4",
16+
"datatables.net-colreorder": "^1.5.2",
17+
"datatables.net-dt": "^1.10.22",
1318
"drmonty-datatables-plugins": "^1.0.0",
1419
"drmonty-datatables-responsive": "^1.0.0",
1520
"easymde": "^2.11.0",
@@ -18,15 +23,17 @@
1823
"font-awesome": "^4.0.0",
1924
"fullcalendar": "^3.10.2",
2025
"google-code-prettify": "^1.0.0",
21-
"jquery": "^3.4.0",
26+
"jquery": "^3.5.1",
2227
"jquery-highlight": "3.5.0",
2328
"jquery.cookie": "1.4.1",
2429
"jquery.flot.tooltip": "^0.9.0",
2530
"jquery.hotkeys": "jeresig/jquery.hotkeys#master",
26-
"justgage": "^1.3.0",
31+
"jszip": "^3.5.0",
32+
"justgage": "^1.4.0",
2733
"metismenu": "~3.0.6",
28-
"moment": "^2.27.0",
34+
"moment": "^2.29.0",
2935
"morris.js": "morrisjs/morris.js",
36+
"pdfmake": "^0.1.68",
3037
"startbootstrap-sb-admin-2": "1.0.7"
3138
},
3239
"engines": {

0 commit comments

Comments
 (0)