Skip to content

Commit 5b8ac92

Browse files
authored
Merge pull request #11935 from DefectDojo/bugfix
Release 2.44.0: Merge Bugfix into Dev
2 parents d65d9ca + fd35843 commit 5b8ac92

23 files changed

+1395
-188
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ A clear and concise description of what you expected to happen.
3333

3434
**Environment information**
3535
- Operating System: [e.g. Ubuntu 18.04]
36+
- Docker Compose or Helm version (Output of `docker compose version` or `helm version`)
3637
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]
3738

3839
**Logs**

.github/ISSUE_TEMPLATE/support_request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ A clear and concise description of what you expected to happen.
3333

3434
**Environment information**
3535
- Operating System: [e.g. Ubuntu 18.04]
36+
- Docker Compose or Helm version (Output of `docker compose version` or `helm version`)
3637
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]
3738

3839
**Logs**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ our channel there, [#defectdojo](https://owasp.slack.com/channels/defectdojo). F
109109

110110
:warning: We have instituted a [feature freeze](https://github.com/DefectDojo/django-DefectDojo/discussions/8002) on v2
111111
of DefectDojo as we begin work on v3. Please see our [contributing guidelines](readme-docs/CONTRIBUTING.md) for more
112-
information. Check out our latest update on v3 [here](https://github.com/DefectDojo/django-DefectDojo/discussions/8974).
112+
information. Check out our latest update on v3 [here](https://github.com/DefectDojo/django-DefectDojo/discussions/11199).
113113

114114
## Pro Edition
115115
[Upgrade to DefectDojo Pro](https://www.defectdojo.com/) today to take your DevSecOps to 11. DefectDojo Pro is

docker-compose.override.unit_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ services:
2929
DD_CELERY_BROKER_PORT: "-1"
3030
DD_CELERY_BROKER_PATH: '/dojo.celerydb.sqlite'
3131
DD_CELERY_BROKER_PARAMS: ''
32+
DD_JIRA_EXTRA_ISSUE_TYPES: 'Vulnerability' # Shouldn't trigger a migration error
3233
celerybeat:
3334
image: busybox:1.37.0-musl
3435
entrypoint: ['echo', 'skipping', 'celery beat']

docker-compose.override.unit_tests_cicd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
DD_CELERY_BROKER_PORT: "-1"
2929
DD_CELERY_BROKER_PATH: '/dojo.celerydb.sqlite'
3030
DD_CELERY_BROKER_PARAMS: ''
31+
DD_JIRA_EXTRA_ISSUE_TYPES: 'Vulnerability' # Shouldn't trigger a migration error
3132
celerybeat:
3233
image: busybox:1.37.0-musl
3334
entrypoint: ['echo', 'skipping', 'celery beat']

docs/content/en/connecting_your_tools/parsers/file/ms_defender.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ toc_hide: true
55
This parser helps to parse Microsoft Defender Findings and supports two types of imports:
66
- You can import a JSON output file from the api/vulnerabilities/machinesVulnerabilities endpoint of Microsoft defender.
77
- You can upload a custom zip file which include multiple JSON files from two Microsoft Defender Endpoints. For that you have to make your own zip file and include two folders (machines/ and vulnerabilities/) within the zip file. For vulnerabilities/ you can attach multiple JSON files from the api/vulnerabilities/machinesVulnerabilities REST API endpoint of Microsoft Defender. Furthermore, in machines/ you can attach the JSON output from the api/machines REST API endpoint of Microsoft Defender. Then, the parser uses the information in both folders to add more specific information like the affected IP Address to the finding.
8+
<br>However, if you have a fast changing environment with a huge number of vulnerabilities and endpoints, it is recommended to leave the folder machines/ empty. Then, for stability reasons the machine info is skipped and only the machineID is added to the finding.
89

910
### Sample Scan Data
1011
Sample MS Defender Parser scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/ms_defender).

dojo/db_migrations/0027_jira_issue_type_settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by Django 2.2.4 on 2020-01-02 15:33
22

3+
from django.conf import settings
34
from django.db import migrations, models
45

56

@@ -13,6 +14,6 @@ class Migration(migrations.Migration):
1314
migrations.AlterField(
1415
model_name='jira_conf',
1516
name='default_issue_type',
16-
field=models.CharField(choices=[('Task', 'Task'), ('Story', 'Story'), ('Epic', 'Epic'), ('Spike', 'Spike'), ('Bug', 'Bug'), ('Security', 'Security')], default='Bug', help_text='You can define extra issue types in settings.py', max_length=15),
17+
field=models.CharField(choices=settings.JIRA_ISSUE_TYPE_CHOICES_CONFIG, default='Bug', help_text='You can define extra issue types in settings.py', max_length=15),
1718
),
1819
]

dojo/db_migrations/0182_alter_jira_instance_default_issue_type.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by Django 4.1.7 on 2023-03-06 11:38
22

3+
from django.conf import settings
34
from django.db import migrations, models
45

56

@@ -13,6 +14,6 @@ class Migration(migrations.Migration):
1314
migrations.AlterField(
1415
model_name='jira_instance',
1516
name='default_issue_type',
16-
field=models.CharField(choices=[('Task', 'Task'), ('Story', 'Story'), ('Epic', 'Epic'), ('Spike', 'Spike'), ('Bug', 'Bug'), ('Security', 'Security')], default='Bug', help_text='You can define extra issue types in settings.py', max_length=255),
17+
field=models.CharField(choices=settings.JIRA_ISSUE_TYPE_CHOICES_CONFIG, default='Bug', help_text='You can define extra issue types in settings.py', max_length=255),
1718
),
1819
]

dojo/settings/settings.dist.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,9 +1761,12 @@ def saml2_attrib_map_format(din):
17611761
"ALBA-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/ALBA-2019:3411
17621762
"ALSA-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/ALSA-2024:0827
17631763
"AVD": "https://avd.aquasec.com/misconfig/", # e.g. https://avd.aquasec.com/misconfig/avd-ksv-01010
1764+
"BAM-": "https://jira.atlassian.com/browse/", # e.g. https://jira.atlassian.com/browse/BAM-25498
1765+
"BSERV-": "https://jira.atlassian.com/browse/", # e.g. https://jira.atlassian.com/browse/BSERV-19020
17641766
"C-": "https://hub.armosec.io/docs/", # e.g. https://hub.armosec.io/docs/c-0085
17651767
"CAPEC": "https://capec.mitre.org/data/definitions/&&.html", # e.g. https://capec.mitre.org/data/definitions/157.html
17661768
"CGA-": "https://images.chainguard.dev/security/", # e.g. https://images.chainguard.dev/security/CGA-24pq-h5fw-43v3
1769+
"CONFSERVER-": "https://jira.atlassian.com/browse/", # e.g. https://jira.atlassian.com/browse/CONFSERVER-93361
17671770
"CVE-": "https://nvd.nist.gov/vuln/detail/", # e.g. https://nvd.nist.gov/vuln/detail/cve-2022-22965
17681771
"CWE": "https://cwe.mitre.org/data/definitions/&&.html", # e.g. https://cwe.mitre.org/data/definitions/79.html
17691772
"DLA-": "https://security-tracker.debian.org/tracker/", # e.g. https://security-tracker.debian.org/tracker/DLA-3917-1
@@ -1774,9 +1777,12 @@ def saml2_attrib_map_format(din):
17741777
"FEDORA-": "https://bodhi.fedoraproject.org/updates/", # e.g. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-06aa7dc422
17751778
"GHSA-": "https://github.com/advisories/", # e.g. https://github.com/advisories/GHSA-58vj-cv5w-v4v6
17761779
"GLSA": "https://security.gentoo.org/", # e.g. https://security.gentoo.org/glsa/202409-32
1780+
"JSDSERVER-": "https://jira.atlassian.com/browse/", # e.g. https://jira.atlassian.com/browse/JSDSERVER-14872
17771781
"KHV": "https://avd.aquasec.com/misconfig/kubernetes/", # e.g. https://avd.aquasec.com/misconfig/kubernetes/khv045
1782+
"MGAA-": "https://advisories.mageia.org/&&.html", # e.g. https://advisories.mageia.org/MGAA-2013-0054.html
17781783
"MGASA-": "https://advisories.mageia.org/&&.html", # e.g. https://advisories.mageia.org/MGASA-2025-0023.html
17791784
"OSV-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/OSV-2024-1330
1785+
"PAN-SA-": "https://security.paloaltonetworks.com/", # e.g. https://security.paloaltonetworks.com/PAN-SA-2024-0010
17801786
"PMASA-": "https://www.phpmyadmin.net/security/", # e.g. https://www.phpmyadmin.net/security/PMASA-2025-1
17811787
"PYSEC-": "https://osv.dev/vulnerability/", # e.g. https://osv.dev/vulnerability/PYSEC-2024-48
17821788
"RHBA-": "https://access.redhat.com/errata/", # e.g. https://access.redhat.com/errata/RHBA-2024:2406
@@ -1787,6 +1793,7 @@ def saml2_attrib_map_format(din):
17871793
"RUSTSEC-": "https://rustsec.org/advisories/", # e.g. https://rustsec.org/advisories/RUSTSEC-2024-0432
17881794
"RXSA-": "https://errata.rockylinux.org/", # e.g. https://errata.rockylinux.org/RXSA-2024:4928
17891795
"SNYK-": "https://snyk.io/vuln/", # e.g. https://security.snyk.io/vuln/SNYK-JS-SOLANAWEB3JS-8453984
1796+
"SUSE-SU-": "https://www.suse.com/support/update/announcement/", # e.g. https://www.suse.com/support/update/announcement/2024/suse-su-20244196-1
17901797
"TEMP-": "https://security-tracker.debian.org/tracker/", # e.g. https://security-tracker.debian.org/tracker/TEMP-0841856-B18BAF
17911798
"TYPO3-": "https://typo3.org/security/advisory/", # e.g. https://typo3.org/security/advisory/typo3-core-sa-2025-010
17921799
"USN-": "https://ubuntu.com/security/notices/", # e.g. https://ubuntu.com/security/notices/USN-6642-1

dojo/static/dojo/js/metrics.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,75 @@ function accepted_per_week_2(critical, high, medium, low) {
738738
options);
739739
}
740740

741+
742+
// This function is valid besides metrics.html also for the dashboard-metrics.html,
743+
// dashboard.html, and product-metrics.html
744+
function updatePunchcardTable(punchcardData, ticks) {
745+
let tableBody = $("#punchcard-table tbody");
746+
747+
const daysMap = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
748+
let formattedData = {};
749+
750+
// No table processing in case of no data
751+
if (punchcardData.length === 0 || ticks.length === 0) return;
752+
753+
// Removing html elements from the ticks dates
754+
let ticksMap = {};
755+
ticks.forEach(entry => {
756+
let weekIndex = String(entry[0]);
757+
let rawHtml = entry[1];
758+
759+
// Goodbye <span> + space instead of <br/>
760+
let cleanDate = rawHtml.replace(/<\/?span[^>]*>/g, "").replace(/<br\s*\/?>/g, " ");
761+
cleanDate = cleanDate.trim();
762+
ticksMap[weekIndex] = cleanDate;
763+
});
764+
765+
let minWeekOffset = ticks[0][0];
766+
let maxWeekOffset = ticks[ticks.length - 1][0];
767+
768+
for (let weekOffset = minWeekOffset; weekOffset <= maxWeekOffset; weekOffset++) {
769+
let formattedDate = ticksMap[String(weekOffset)] || "Unknown Date";
770+
let formattedWeek = `Week ${weekOffset - minWeekOffset + 1}, starting on ${formattedDate}`;
771+
772+
formattedData[formattedWeek] = {
773+
"Monday": 0, "Tuesday": 0, "Wednesday": 0,
774+
"Thursday": 0, "Friday": 0, "Saturday": 0, "Sunday": 0
775+
};
776+
}
777+
778+
// Populating week data
779+
punchcardData.forEach(entry => {
780+
let weekOffset = entry[0];
781+
let day = daysMap[entry[1]];
782+
let value = entry[3] || 0;
783+
784+
let formattedDate = ticksMap[String(weekOffset)] || "Unknown Date";
785+
let formattedWeek = `Week ${weekOffset - minWeekOffset + 1}, starting on ${formattedDate}`;
786+
787+
if (formattedData[formattedWeek]) {
788+
formattedData[formattedWeek][day] = value;
789+
}
790+
});
791+
792+
// Rendering accessibility table body
793+
Object.entries(formattedData).forEach(([week, values]) => {
794+
let newRow = `
795+
<tr>
796+
<td scope="row">${week}</td>
797+
<td>${values.Monday || '0'}</td>
798+
<td>${values.Tuesday || '0'}</td>
799+
<td>${values.Wednesday || '0'}</td>
800+
<td>${values.Thursday || '0'}</td>
801+
<td>${values.Friday || '0'}</td>
802+
<td>${values.Saturday || '0'}</td>
803+
<td>${values.Sunday || '0'}</td>
804+
</tr>
805+
`;
806+
tableBody.append(newRow);
807+
});
808+
}
809+
741810
/*
742811
product_metrics.html
743812
*/

0 commit comments

Comments
 (0)