From 03fc5cc457e297d1aaea12b31c7da67e0819453b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?In=C3=AAs=20Martins?= <123470320+inesmartins-swordhealth@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:10:53 +0000 Subject: [PATCH] Syncs with upstream dev (#100) --- .../workflows/release-3-master-into-dev.yml | 18 +- README.md | 152 +-- docker-compose.yml | 2 +- docs/content/en/getting_started/upgrading.md | 864 ------------------ .../en/getting_started/upgrading/1.10.md | 50 + .../en/getting_started/upgrading/1.11.md | 8 + .../en/getting_started/upgrading/1.12.md | 8 + .../en/getting_started/upgrading/1.13.md | 17 + .../en/getting_started/upgrading/1.14.md | 15 + .../en/getting_started/upgrading/1.15.md | 20 + .../en/getting_started/upgrading/1.2.2.md | 11 + .../en/getting_started/upgrading/1.2.3.md | 12 + .../en/getting_started/upgrading/1.2.4.md | 10 + .../en/getting_started/upgrading/1.2.8.md | 15 + .../en/getting_started/upgrading/1.2.9.md | 16 + .../en/getting_started/upgrading/1.3.1.md | 22 + .../en/getting_started/upgrading/1.7.0.md | 130 +++ .../en/getting_started/upgrading/1.8.0.md | 42 + .../en/getting_started/upgrading/1.9.3.md | 44 + .../en/getting_started/upgrading/2.0.md | 66 ++ .../en/getting_started/upgrading/2.10.md | 10 + .../en/getting_started/upgrading/2.12.md | 8 + .../en/getting_started/upgrading/2.13.md | 37 + .../en/getting_started/upgrading/2.15.md | 7 + .../en/getting_started/upgrading/2.16.md | 7 + .../en/getting_started/upgrading/2.17.md | 7 + .../en/getting_started/upgrading/2.18.md | 23 + .../en/getting_started/upgrading/2.19.md | 13 + .../en/getting_started/upgrading/2.2.md | 11 + .../en/getting_started/upgrading/2.20.md | 7 + .../en/getting_started/upgrading/2.21.md | 7 + .../en/getting_started/upgrading/2.22.md | 7 + .../en/getting_started/upgrading/2.23.md | 21 + .../en/getting_started/upgrading/2.24.md | 8 + .../en/getting_started/upgrading/2.25.md | 31 + .../en/getting_started/upgrading/2.26.md | 7 + .../en/getting_started/upgrading/2.27.md | 7 + .../en/getting_started/upgrading/2.28.md | 7 + .../en/getting_started/upgrading/2.29.md | 7 + .../en/getting_started/upgrading/2.3.md | 12 + .../en/getting_started/upgrading/2.4.md | 14 + .../en/getting_started/upgrading/2.5.md | 25 + .../en/getting_started/upgrading/2.6.md | 9 + .../en/getting_started/upgrading/2.7.md | 19 + .../en/getting_started/upgrading/2.8.md | 15 + .../en/getting_started/upgrading/2.9.md | 8 + .../en/getting_started/upgrading/_index.md | 73 ++ .../parsers/file/trivy_operator.md | 2 + .../0192_notifications_scan_added_empty.py | 19 + dojo/importers/importer/importer.py | 3 +- dojo/importers/reimporter/reimporter.py | 17 +- dojo/models.py | 14 +- dojo/notifications/helper.py | 8 +- dojo/settings/settings.dist.py | 16 +- dojo/templates/dojo/view_finding.html | 6 + dojo/templates/dojo/view_risk_acceptance.html | 8 +- .../notifications/alert/scan_added_empty.tpl | 1 + .../notifications/mail/scan_added_empty.tpl | 1 + .../msteams/scan_added_empty.tpl | 1 + .../notifications/slack/scan_added_empty.tpl | 1 + dojo/tools/bundler_audit/parser.py | 3 + dojo/tools/harbor_vulnerability/parser.py | 10 +- dojo/tools/nuclei/parser.py | 2 + dojo/tools/sonarqube/parser.py | 17 +- dojo/utils.py | 70 +- helm/defectdojo/Chart.yaml | 2 +- requirements.txt | 10 +- .../harbor_vulnerability/harborapipip.json | 86 ++ unittests/scans/nmap_scanme.json | 190 ---- .../sonar-table-in-table-with-whitespace.html | 598 ++++++++++++ .../tools/test_harbor_vulnerability_parser.py | 11 + unittests/tools/test_sonarqube_parser.py | 83 ++ 72 files changed, 1943 insertions(+), 1165 deletions(-) delete mode 100644 docs/content/en/getting_started/upgrading.md create mode 100644 docs/content/en/getting_started/upgrading/1.10.md create mode 100644 docs/content/en/getting_started/upgrading/1.11.md create mode 100644 docs/content/en/getting_started/upgrading/1.12.md create mode 100644 docs/content/en/getting_started/upgrading/1.13.md create mode 100644 docs/content/en/getting_started/upgrading/1.14.md create mode 100644 docs/content/en/getting_started/upgrading/1.15.md create mode 100644 docs/content/en/getting_started/upgrading/1.2.2.md create mode 100644 docs/content/en/getting_started/upgrading/1.2.3.md create mode 100644 docs/content/en/getting_started/upgrading/1.2.4.md create mode 100644 docs/content/en/getting_started/upgrading/1.2.8.md create mode 100644 docs/content/en/getting_started/upgrading/1.2.9.md create mode 100644 docs/content/en/getting_started/upgrading/1.3.1.md create mode 100644 docs/content/en/getting_started/upgrading/1.7.0.md create mode 100644 docs/content/en/getting_started/upgrading/1.8.0.md create mode 100644 docs/content/en/getting_started/upgrading/1.9.3.md create mode 100644 docs/content/en/getting_started/upgrading/2.0.md create mode 100644 docs/content/en/getting_started/upgrading/2.10.md create mode 100644 docs/content/en/getting_started/upgrading/2.12.md create mode 100644 docs/content/en/getting_started/upgrading/2.13.md create mode 100644 docs/content/en/getting_started/upgrading/2.15.md create mode 100644 docs/content/en/getting_started/upgrading/2.16.md create mode 100644 docs/content/en/getting_started/upgrading/2.17.md create mode 100644 docs/content/en/getting_started/upgrading/2.18.md create mode 100644 docs/content/en/getting_started/upgrading/2.19.md create mode 100644 docs/content/en/getting_started/upgrading/2.2.md create mode 100644 docs/content/en/getting_started/upgrading/2.20.md create mode 100644 docs/content/en/getting_started/upgrading/2.21.md create mode 100644 docs/content/en/getting_started/upgrading/2.22.md create mode 100644 docs/content/en/getting_started/upgrading/2.23.md create mode 100644 docs/content/en/getting_started/upgrading/2.24.md create mode 100644 docs/content/en/getting_started/upgrading/2.25.md create mode 100644 docs/content/en/getting_started/upgrading/2.26.md create mode 100644 docs/content/en/getting_started/upgrading/2.27.md create mode 100644 docs/content/en/getting_started/upgrading/2.28.md create mode 100644 docs/content/en/getting_started/upgrading/2.29.md create mode 100644 docs/content/en/getting_started/upgrading/2.3.md create mode 100644 docs/content/en/getting_started/upgrading/2.4.md create mode 100644 docs/content/en/getting_started/upgrading/2.5.md create mode 100644 docs/content/en/getting_started/upgrading/2.6.md create mode 100644 docs/content/en/getting_started/upgrading/2.7.md create mode 100644 docs/content/en/getting_started/upgrading/2.8.md create mode 100644 docs/content/en/getting_started/upgrading/2.9.md create mode 100644 docs/content/en/getting_started/upgrading/_index.md create mode 100644 dojo/db_migrations/0192_notifications_scan_added_empty.py create mode 120000 dojo/templates/notifications/alert/scan_added_empty.tpl create mode 120000 dojo/templates/notifications/mail/scan_added_empty.tpl create mode 120000 dojo/templates/notifications/msteams/scan_added_empty.tpl create mode 120000 dojo/templates/notifications/slack/scan_added_empty.tpl create mode 100644 unittests/scans/harbor_vulnerability/harborapipip.json delete mode 100644 unittests/scans/nmap_scanme.json create mode 100644 unittests/scans/sonarqube/sonar-table-in-table-with-whitespace.html diff --git a/.github/workflows/release-3-master-into-dev.yml b/.github/workflows/release-3-master-into-dev.yml index 621c180ad5..465a8fc2e9 100644 --- a/.github/workflows/release-3-master-into-dev.yml +++ b/.github/workflows/release-3-master-into-dev.yml @@ -55,7 +55,23 @@ jobs: grep version dojo/__init__.py grep appVersion helm/defectdojo/Chart.yaml grep version components/package.json - + + - name: Create upgrade notes to documentation + run: | + minorv=$(echo ${{ github.event.inputs.release_number_dev }} | cut -d '.' -f -2) + patchv=$(echo ${{ github.event.inputs.release_number_dev }} | cut -d '-' -f -1) + weight=$(date +%Y%m%d) + echo -n "--- + title: 'Upgrading to DefectDojo Version $minorv.x' + toc_hide: true + weight: -$weight + description: No special instructions. + --- + There are no special instructions for upgrading to $minorv.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/$patchv) for the contents of the release. + " > docs/content/en/getting_started/upgrading/$minorv.md + git add docs/content/en/getting_started/upgrading/$minorv.md + if: endsWith(github.event.inputs.release_number_dev, '.0-dev') + - name: Push version changes uses: stefanzweifel/git-auto-commit-action@v5.0.0 with: diff --git a/README.md b/README.md index 3eb26774ce..296288dbe6 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,70 @@ # DefectDojo
- - | -- - - | -
---|---|
+ + + + | ++ + + | +
+ | Severity | +Number of Issues | +
---|---|---|
+ | BLOCKER | ++ 0 + | +
+ | CRITICAL | ++ 2 + | +
+ | MAJOR | ++ 0 + | +
+ | MINOR | ++ 5 + | +
Rule | +Severity | +Component | +Line | +Description | +Message | +Key | +Status | +
---|---|---|---|---|---|---|---|
+ squid:S2975 + | ++ BLOCKER + | ++ java/org/apache/catalina/util/URLEncoder.java + | ++ 190 + | ++ "clone" should not be overridden + | ++ Remove this "clone" implementation; use a copy constructor or copy factory instead. + | ++ AWK40IMu-pl6AHs22MnV + | +TO_REVIEW | +
Rule | +Description | +||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
squid:S864 + | +
+
+
+ The rules of operator precedence are complicated and can lead to errors. For this reason, + parentheses should be used for clarification in complex + statements. However, this does not mean that parentheses should be gratuitously added around + every operation. +This rule raises issues when
Noncompliant Code Example++x = a + b - c; +x = a + 1 << b; // Noncompliant + +if ( a > b || c < d || a == d) {...} +if ( a > b && c < d || a == b) {...} // Noncompliant +if (a = f(b,c) == 1) { ... } // Noncompliant; == evaluated first ++ Compliant Solution++x = a + b - c; +x = (a + 1) << b; + +if ( a > b || c < d || a == d) {...} +if ( (a > b && c < d) || a == b) {...} +if ( (a = f(b,c)) == 1) { ... } ++ See+
|
+ ||||||||||||||||||||||||||||||||||||
squid:S2115 + | +
+
+
+ Failure to password-protect a database is so careless or naive as to be almost negligent. + Databases should always be password protected, but the + use of a database connection with an empty password is a clear indication of a database that + is not protected. +This rule flags database connections with empty passwords. +Noncompliant Code Example++Connection conn = DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "AppLogin", ""); +Connection conn2 = DriverManager.getConnection("jdbc:derby:memory:myDB;create=true?user=user&password="); ++ Compliant Solution++DriverManager.getConnection("jdbc:derby:memory:myDB;create=true?user=user&password=password"); + +DriverManager.getConnection("jdbc:mysql://address=(host=myhost1)(port=1111)(key1=value1)(user=sandy)(password=secret),address=(host=myhost2)(port=2222)(key2=value2)(user=sandy)(password=secret)/db"); + +DriverManager.getConnection("jdbc:mysql://sandy:secret@[myhost1:1111,myhost2:2222]/db"); + +String url = "jdbc:postgresql://localhost/test"; +Properties props = new Properties(); +props.setProperty("user", "fred"); +props.setProperty("password", "secret"); +DriverManager.getConnection(url, props); ++ See+
|
+ ||||||||||||||||||||||||||||||||||||
squid:S1148 + | +
+
+
+
Loggers should be used instead to print
This rule raises an issue when Noncompliant Code Example++try { + /* ... */ +} catch(Exception e) { + e.printStackTrace(); // Noncompliant +} ++ Compliant Solution++try { + /* ... */ +} catch(Exception e) { + LOGGER.log("context", e); +} ++ See+
|
+ ||||||||||||||||||||||||||||||||||||
squid:S2975 + | +
+
+
+ Many consider + Object's clone method is very tricky. It's based on field copies, and it's "extra-linguistic." It creates an object without calling a constructor. + There are no guarantees that it preserves the invariants established by the constructors. There have been lots of bugs over the years, both in and + outside Sun, stemming from the fact that if you just call super.clone repeatedly up the chain until you have cloned an object, you have a shallow + copy of the object. The clone generally shares state with the object being cloned. If that state is mutable, you don't have two independent objects. + If you modify one, the other changes as well. And all of a sudden, you get random behavior. ++ A copy constructor or copy factory should be used instead. +This rule raises an issue when Noncompliant Code Example++public class MyClass { + // ... + + public Object clone() { // Noncompliant + //... + } +} ++ Compliant Solution++public class MyClass { + // ... + + MyClass (MyClass source) { + //... + } +} ++ See+ +See Also+ + |
+