-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: security exceptions #1486
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
0a79b17
feat(backend): add exception object
Mohamed-Hacene e006166
fix(backend): typos
Mohamed-Hacene f121950
feat(backend): add severity display in Exception serializer
Mohamed-Hacene aadf275
feat(frontend): add Exception crud
Mohamed-Hacene ebd29a6
feat: add exeption field in related objects
Mohamed-Hacene f320ded
chore: run format
Mohamed-Hacene 5ff9596
fix: exception creation from list view
Mohamed-Hacene 7884c83
feat: add migration
Mohamed-Hacene c0f8fda
chore: format migration
Mohamed-Hacene e012f31
fix: add max_length for models.CharField
Mohamed-Hacene 6c5e0ec
feat(locale): add exception fr translations
Mohamed-Hacene f93e87d
fix(locale): add missing owners translation
Mohamed-Hacene 57b8a42
fix: remove requirement_assessments field from ExceptionReadSerializer
Mohamed-Hacene 0c5b9d3
feat: update Exception icon
Mohamed-Hacene f630589
chore: add simple quotes
Mohamed-Hacene e509970
rename exception->security_exception
eric-intuitem 1e5eecf
fix casing
eric-intuitem aa78743
add default value
eric-intuitem 283792a
Merge branch 'main' into CA-837-implement-security-exceptions
eric-intuitem 2b541c1
rename exceptionsToReview to acceptancesToReview
eric-intuitem 786182a
Update 0052_securityexception_appliedcontrol_security_exceptions_and_…
eric-intuitem 2672584
fix _/- errors
eric-intuitem de03a66
add boolean to disable double-dash addition
eric-intuitem 240c275
Update SecurityExceptionForm.svelte
eric-intuitem 6693d33
fix -/_ mismatch
eric-intuitem da07e11
feat: add approver field
Mohamed-Hacene bd05a85
Merge branch 'main' into CA-837-implement-security-exceptions
Mohamed-Hacene 9743d05
chore: adapt security exceptions AutocompleteSelect forms
Mohamed-Hacene db5a857
chore: run format
Mohamed-Hacene c2ccb4e
feat: use crud.ts reverseForeignKeys without add and delete buttons
Mohamed-Hacene 0550811
feat: add security exceptions filters
Mohamed-Hacene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
179 changes: 179 additions & 0 deletions
179
...end/core/migrations/0052_securityexception_appliedcontrol_security_exceptions_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,179 @@ | ||
# Generated by Django 5.1.5 on 2025-02-10 09:32 | ||
|
||
import django.db.models.deletion | ||
import iam.models | ||
import uuid | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0051_rename_project_perimeter_alter_perimeter_options_and_more"), | ||
("iam", "0010_user_preferences"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="SecurityException", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
editable=False, | ||
primary_key=True, | ||
serialize=False, | ||
), | ||
), | ||
( | ||
"created_at", | ||
models.DateTimeField(auto_now_add=True, verbose_name="Created at"), | ||
), | ||
( | ||
"updated_at", | ||
models.DateTimeField(auto_now=True, verbose_name="Updated at"), | ||
), | ||
( | ||
"is_published", | ||
models.BooleanField(default=False, verbose_name="published"), | ||
), | ||
("name", models.CharField(max_length=200, verbose_name="Name")), | ||
( | ||
"description", | ||
models.TextField(blank=True, null=True, verbose_name="Description"), | ||
), | ||
( | ||
"ref_id", | ||
models.CharField( | ||
blank=True, | ||
max_length=100, | ||
null=True, | ||
verbose_name="Reference ID", | ||
), | ||
), | ||
( | ||
"severity", | ||
models.SmallIntegerField( | ||
choices=[ | ||
(-1, "undefined"), | ||
(0, "low"), | ||
(1, "medium"), | ||
(2, "high"), | ||
(3, "critical"), | ||
], | ||
default=-1, | ||
verbose_name="Severity", | ||
), | ||
), | ||
( | ||
"status", | ||
models.CharField( | ||
choices=[ | ||
("draft", "draft"), | ||
("in_review", "in review"), | ||
("approved", "approved"), | ||
("resolved", "resolved"), | ||
("expired", "expired"), | ||
("deprecated", "deprecated"), | ||
], | ||
default="draft", | ||
max_length=20, | ||
verbose_name="Status", | ||
), | ||
), | ||
( | ||
"expiration_date", | ||
models.DateField( | ||
help_text="Specify when the security exception will no longer apply", | ||
null=True, | ||
verbose_name="Expiration date", | ||
), | ||
), | ||
( | ||
"approver", | ||
models.ForeignKey( | ||
blank=True, | ||
max_length=200, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to=settings.AUTH_USER_MODEL, | ||
verbose_name="Approver", | ||
), | ||
), | ||
( | ||
"folder", | ||
models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
( | ||
"owners", | ||
models.ManyToManyField( | ||
blank=True, | ||
related_name="security_exceptions", | ||
to=settings.AUTH_USER_MODEL, | ||
verbose_name="Owner", | ||
), | ||
), | ||
], | ||
options={ | ||
"ordering": ["name"], | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="appliedcontrol", | ||
name="security_exceptions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="applied_controls", | ||
to="core.securityexception", | ||
verbose_name="Security exceptions", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="asset", | ||
name="security_exceptions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="assets", | ||
to="core.securityexception", | ||
verbose_name="Security exceptions", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="requirementassessment", | ||
name="security_exceptions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="requirement_assessments", | ||
to="core.securityexception", | ||
verbose_name="Security exceptions", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="riskscenario", | ||
name="security_exceptions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="risk_scenarios", | ||
to="core.securityexception", | ||
verbose_name="Security exceptions", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="vulnerability", | ||
name="security_exceptions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="vulnerabilities", | ||
to="core.securityexception", | ||
verbose_name="Security exceptions", | ||
), | ||
), | ||
] |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider adding severity validation.
The severity field allows an 'undefined' value which might lead to ambiguity in security exception tracking.
Apply this diff to make severity a required field with a more appropriate default:
📝 Committable suggestion