-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into master-into-dev/2.34.4-2.35.0-dev
- Loading branch information
Showing
52 changed files
with
985 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: 'Upgrading to DefectDojo Version 2.35.x' | ||
toc_hide: true | ||
weight: -20240506 | ||
description: Integrity checker announced | ||
--- | ||
|
||
From 2.35.0, DefectDojo will perform an integrity check of the `settings.dist.py` file to ensure it has not been modified. If the user changed this file (in the past or even now) the DefectDojo instance will not start until those changes have been reverted. | ||
Any customization of variables needs to be done via environmental variables or in 'local_settings.py'. | ||
For more information check [Configuration documentation page](https://documentation.defectdojo.com/getting_started/configuration/). | ||
|
||
There are no other special instructions for upgrading to 2.35.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.35.0) for the contents of the release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
dojo/db_migrations/0212_sla_configuration_enforce_critical_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Generated by Django 4.1.13 on 2024-05-09 08:03 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dojo', '0211_system_settings_enable_similar_findings'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='sla_configuration', | ||
name='enforce_critical', | ||
field=models.BooleanField(default=True, help_text='When enabled, critical findings will be assigned an SLA expiration date based on the critical finding SLA days within this SLA configuration.', verbose_name='Enforce Critical Finding SLA Days'), | ||
), | ||
migrations.AddField( | ||
model_name='sla_configuration', | ||
name='enforce_high', | ||
field=models.BooleanField(default=True, help_text='When enabled, high findings will be assigned an SLA expiration date based on the high finding SLA days within this SLA configuration.', verbose_name='Enforce High Finding SLA Days'), | ||
), | ||
migrations.AddField( | ||
model_name='sla_configuration', | ||
name='enforce_low', | ||
field=models.BooleanField(default=True, help_text='When enabled, low findings will be assigned an SLA expiration date based on the low finding SLA days within this SLA configuration.', verbose_name='Enforce Low Finding SLA Days'), | ||
), | ||
migrations.AddField( | ||
model_name='sla_configuration', | ||
name='enforce_medium', | ||
field=models.BooleanField(default=True, help_text='When enabled, medium findings will be assigned an SLA expiration date based on the medium finding SLA days within this SLA configuration.', verbose_name='Enforce Medium Finding SLA Days'), | ||
), | ||
migrations.AlterField( | ||
model_name='sla_configuration', | ||
name='critical', | ||
field=models.IntegerField(default=7, help_text='The number of days to remediate a critical finding.', verbose_name='Critical Finding SLA Days'), | ||
), | ||
migrations.AlterField( | ||
model_name='sla_configuration', | ||
name='high', | ||
field=models.IntegerField(default=30, help_text='The number of days to remediate a high finding.', verbose_name='High Finding SLA Days'), | ||
), | ||
migrations.AlterField( | ||
model_name='sla_configuration', | ||
name='low', | ||
field=models.IntegerField(default=120, help_text='The number of days to remediate a low finding.', verbose_name='Low Finding SLA Days'), | ||
), | ||
migrations.AlterField( | ||
model_name='sla_configuration', | ||
name='medium', | ||
field=models.IntegerField(default=90, help_text='The number of days to remediate a medium finding.', verbose_name='Medium Finding SLA Days'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from auditlog.models import LogEntry | ||
from django.conf import settings | ||
from django.contrib.contenttypes.models import ContentType | ||
from django.db.models.signals import post_delete | ||
from django.dispatch import receiver | ||
from django.urls import reverse | ||
from django.utils.translation import gettext as _ | ||
|
||
from dojo.models import Endpoint | ||
from dojo.notifications.helper import create_notification | ||
|
||
|
||
@receiver(post_delete, sender=Endpoint) | ||
def endpoint_post_delete(sender, instance, using, origin, **kwargs): | ||
if instance == origin: | ||
if settings.ENABLE_AUDITLOG: | ||
le = LogEntry.objects.get( | ||
action=LogEntry.Action.DELETE, | ||
content_type=ContentType.objects.get(app_label='dojo', model='endpoint'), | ||
object_id=instance.id | ||
) | ||
description = _('The endpoint "%(name)s" was deleted by %(user)s') % { | ||
'name': str(instance), 'user': le.actor} | ||
else: | ||
description = _('The endpoint "%(name)s" was deleted') % {'name': str(instance)} | ||
create_notification(event='endpoint_deleted', # template does not exists, it will default to "other" but this event name needs to stay because of unit testing | ||
title=_('Deletion of %(name)s') % {'name': str(instance)}, | ||
description=description, | ||
url=reverse('endpoint'), | ||
icon="exclamation-triangle") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from auditlog.models import LogEntry | ||
from django.conf import settings | ||
from django.contrib.contenttypes.models import ContentType | ||
from django.db.models.signals import post_delete, post_save, pre_save | ||
from django.dispatch import receiver | ||
from django.urls import reverse | ||
from django.utils.translation import gettext as _ | ||
|
||
from dojo.models import Engagement | ||
from dojo.notifications.helper import create_notification | ||
|
||
|
||
@receiver(post_save, sender=Engagement) | ||
def engagement_post_save(sender, instance, created, **kwargs): | ||
if created: | ||
title = _('Engagement created for "%(product)s": %(name)s') % {'product': instance.product, 'name': instance.name} | ||
create_notification(event='engagement_added', title=title, engagement=instance, product=instance.product, | ||
url=reverse('view_engagement', args=(instance.id,))) | ||
|
||
|
||
@receiver(pre_save, sender=Engagement) | ||
def engagement_pre_save(sender, instance, **kwargs): | ||
old = sender.objects.filter(pk=instance.pk).first() | ||
if old and instance.status != old.status: | ||
if instance.status in ["Cancelled", "Completed"]: | ||
create_notification(event='engagement_closed', | ||
title=_('Closure of %s') % instance.name, | ||
description=_('The engagement "%s" was closed') % (instance.name), | ||
engagement=instance, url=reverse('engagement_all_findings', args=(instance.id, ))) | ||
elif instance.status in ["In Progress"] and old.status not in ["Not Started"]: | ||
create_notification(event='engagement_reopened', | ||
title=_('Reopening of %s') % instance.name, | ||
engagement=instance, | ||
description=_('The engagement "%s" was reopened') % (instance.name), | ||
url=reverse('view_engagement', args=(instance.id, ))) | ||
|
||
|
||
@receiver(post_delete, sender=Engagement) | ||
def engagement_post_delete(sender, instance, using, origin, **kwargs): | ||
if instance == origin: | ||
if settings.ENABLE_AUDITLOG: | ||
le = LogEntry.objects.get( | ||
action=LogEntry.Action.DELETE, | ||
content_type=ContentType.objects.get(app_label='dojo', model='engagement'), | ||
object_id=instance.id | ||
) | ||
description = _('The engagement "%(name)s" was deleted by %(user)s') % { | ||
'name': instance.name, 'user': le.actor} | ||
else: | ||
description = _('The engagement "%(name)s" was deleted') % {'name': instance.name} | ||
create_notification(event='engagement_deleted', # template does not exists, it will default to "other" but this event name needs to stay because of unit testing | ||
title=_('Deletion of %(name)s') % {'name': instance.name}, | ||
description=description, | ||
product=instance.product, | ||
url=reverse('view_product', args=(instance.product.id, )), | ||
recipients=[instance.lead], | ||
icon="exclamation-triangle") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.