Skip to content
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/inter framework mappings #584

Merged
merged 83 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f61d605
Decouple i18n-related fields from ReferentialObjectMixin
nas-tabchiche Jun 24, 2024
217a931
Create RequirementMapping and RequirementMappingSet models
nas-tabchiche Jun 24, 2024
bc7a354
Merge branch 'main' into feat/inter-framework-mappings
nas-tabchiche Jun 24, 2024
91592d9
Supply default value for requirement mapping rationale
nas-tabchiche Jun 24, 2024
cda9a35
chore: make migrations
nas-tabchiche Jun 24, 2024
4d5ec91
Test RequirementMapping and RequirementMappingSet objects creation
nas-tabchiche Jun 24, 2024
4d27867
Write sample requirement mapping set library
nas-tabchiche Jun 24, 2024
431321c
Merge branch 'main' into feat/inter-framework-mappings
nas-tabchiche Jun 24, 2024
7920597
Update mapping library file schema
nas-tabchiche Jun 24, 2024
686a5cf
Rename related_requirements and related_framework to focal_requiremen…
nas-tabchiche Jun 25, 2024
a86672a
Swap reference and focal requirements
nas-tabchiche Jun 25, 2024
c416884
Create RequirementMappingSetImporter class
nas-tabchiche Jun 25, 2024
9aeb9e9
Update RequirementMapping model
nas-tabchiche Jun 26, 2024
a33ce89
qAdd library field to RequirementMappingSet
nas-tabchiche Jun 26, 2024
fa9ec6d
chore: squash migrations
nas-tabchiche Jun 26, 2024
e791b1c
Update mapping library schema
nas-tabchiche Jun 26, 2024
9721c1f
Mitigate stack information disclosure
nas-tabchiche Jun 26, 2024
63167d2
Create RequirementMappingSet and RequirementMapping importers
nas-tabchiche Jun 26, 2024
ed78d4b
Add view permission on mappings
nas-tabchiche Jun 26, 2024
1076433
Add endpoints for RequirementMappingSet model
nas-tabchiche Jun 26, 2024
422cb20
Display requirement mapping sets in the frontend
nas-tabchiche Jun 26, 2024
f3bf362
Update backend unit tests
nas-tabchiche Jun 26, 2024
5d1ce4d
Write RequirementAssessment.infer_result method
nas-tabchiche Jun 26, 2024
b875fbd
Fix sample mapping library
nas-tabchiche Jun 26, 2024
2046e4b
Write ComplianceAssessment.compute_requirement_assessments_results me…
nas-tabchiche Jun 26, 2024
85c000d
Fix compute_requirement_assessments_results return type hint
nas-tabchiche Jun 26, 2024
19a47b3
Add compute_mapping endpoint
nas-tabchiche Jun 26, 2024
d038b73
feat: prepare UI
Mohamed-Hacene Jun 27, 2024
dcc24c5
Merge branch 'feat/inter-framework-mappings' of github.com:intuitem/c…
Mohamed-Hacene Jun 27, 2024
77db918
chore: run format
Mohamed-Hacene Jun 27, 2024
e68526c
feat: add audit creation base modal inside audit preview
Mohamed-Hacene Jun 27, 2024
2da58ad
chore: run format
Mohamed-Hacene Jun 27, 2024
b177a9b
Add mapping_inference field to RequirementAssessment model
nas-tabchiche Jun 27, 2024
ca67838
Manage inferences with multiple results
nas-tabchiche Jun 27, 2024
481a4f6
Adjust compute_requirement_assessments_results method
nas-tabchiche Jun 28, 2024
96f546e
Allow picking an Audit as baseline when creating another
nas-tabchiche Jun 28, 2024
de078e7
Properly display mapping inferences
nas-tabchiche Jun 28, 2024
e46befd
Comply with specification
nas-tabchiche Jun 28, 2024
a646b04
Merge branch 'main' into feat/inter-framework-mappings
nas-tabchiche Jun 28, 2024
633008f
chore: squash mapping migrations
nas-tabchiche Jun 28, 2024
4a1acd9
Use result rather than status
nas-tabchiche Jun 28, 2024
5415525
Update RequirementMappingImporter class
nas-tabchiche Jun 28, 2024
007f5a6
Rename Results to Result
nas-tabchiche Jun 28, 2024
e840bad
Update unit tests
nas-tabchiche Jun 28, 2024
eb934da
chore: Run ruff format
nas-tabchiche Jun 28, 2024
77c994f
Map evidences and applied controls to focal requirement assessment
nas-tabchiche Jun 28, 2024
ab65425
fix: missing import core/models.py
Mohamed-Hacene Jun 28, 2024
580c567
Remove obsolete capitalizeSecondWord function and use toCamelCase ins…
nas-tabchiche Jun 28, 2024
9865291
Merge branch 'feat/inter-framework-mappings' of github.com:intuitem/c…
nas-tabchiche Jun 28, 2024
eecd356
Rename origin prop to context
nas-tabchiche Jun 28, 2024
7143670
Add focal and reference framework filterset fields
nas-tabchiche Jun 28, 2024
bf3d4ea
WIP: suggest reference frameworks when a mapping links them to focal
nas-tabchiche Jun 28, 2024
fc42205
Merge branch 'main' into feat/inter-framework-mappings
ab-smith Jun 29, 2024
e5eede8
Fix typo and add mapping for csf 1.1 to 2.0
ab-smith Jun 29, 2024
27192d4
fix uneeded redirect
ab-smith Jun 29, 2024
86d0429
consistency for inference
ab-smith Jun 29, 2024
5629f3d
Visuals
ab-smith Jun 30, 2024
51bd7fa
style: improve mapping tip in tree view
Mohamed-Hacene Jul 1, 2024
b247918
feat: infer status if fully covered
Mohamed-Hacene Jul 1, 2024
60a0b70
feat: improve compliance colors consistency
Mohamed-Hacene Jul 1, 2024
bda8916
style: improve requirements status count display
Mohamed-Hacene Jul 1, 2024
78b86aa
style: synchronize mapping icone
Mohamed-Hacene Jul 1, 2024
ac12d73
feat: filter focal from reference frameworks
Mohamed-Hacene Jul 1, 2024
088c7c5
feat: get score and status on audit duplication
Mohamed-Hacene Jul 1, 2024
7ce96c2
chore: run format
Mohamed-Hacene Jul 1, 2024
f5584cf
feat: set requirement_mapping_set name at import
Mohamed-Hacene Jul 1, 2024
5b544e0
locale: translate libraries table overview column
Mohamed-Hacene Jul 1, 2024
a1e8361
fix: requirement mapping set count in library
Mohamed-Hacene Jul 1, 2024
57849a3
chore: update translations with Fink 🐦
Mohamed-Hacene Jul 1, 2024
dd86272
fix: not callable mapping coverage object
Mohamed-Hacene Jul 1, 2024
d6e438a
fix: framework view
Mohamed-Hacene Jul 1, 2024
3a31339
new mapping and better exceptions management
ab-smith Jul 2, 2024
c324825
fix: typo in tuple index
Mohamed-Hacene Jul 3, 2024
5093e3f
Merge branch 'main' into feat/inter-framework-mappings
ab-smith Jul 4, 2024
989de0d
Fix functionnal tests for loading libraries
monsieurswag Jul 5, 2024
be82183
Update models.py
eric-intuitem Jul 6, 2024
03d0cf6
Update data-model.md
eric-intuitem Jul 6, 2024
4d594f7
Update models.py
eric-intuitem Jul 7, 2024
6683eee
Merge branch 'main' into feat/inter-framework-mappings
Mohamed-Hacene Jul 7, 2024
24659da
chore: update translations with Fink 🐦
Mohamed-Hacene Jul 7, 2024
db901fe
fix: migrations
Mohamed-Hacene Jul 7, 2024
9a79cb5
chore: run format
Mohamed-Hacene Jul 7, 2024
7a59dc0
fix: update backend coverage test
Mohamed-Hacene Jul 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions backend/core/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"view_loadedlibrary",
"view_storedlibrary",
"view_user",
"view_requirementmappingset",
"view_requirementmapping",
]

APPROVER_PERMISSIONS_LIST = [
Expand All @@ -53,6 +55,8 @@
"view_storedlibrary",
"view_loadedlibrary",
"view_user",
"view_requirementmappingset",
"view_requirementmapping",
]

ANALYST_PERMISSIONS_LIST = [
Expand Down Expand Up @@ -107,6 +111,8 @@
"view_storedlibrary",
"view_loadedlibrary",
"view_user",
"view_requirementmappingset",
"view_requirementmapping",
]

DOMAIN_MANAGER_PERMISSIONS_LIST = [
Expand Down Expand Up @@ -166,6 +172,8 @@
"view_storedlibrary",
"view_loadedlibrary",
"view_user",
"view_requirementmappingset",
"view_requirementmapping",
]

ADMINISTRATOR_PERMISSIONS_LIST = [
Expand Down Expand Up @@ -250,6 +258,8 @@
"restore",
"view_globalsettings",
"change_globalsettings",
"view_requirementmappingset",
"view_requirementmapping",
]


Expand Down
4 changes: 4 additions & 0 deletions backend/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def get_sorted_requirement_nodes_rec(start: list) -> dict:
"is_scored": req_as.is_scored if req_as else None,
"score": req_as.score if req_as else None,
"max_score": max_score if req_as else None,
"mapping_inference": req_as.mapping_inference if req_as else None,
"status_display": req_as.get_status_display() if req_as else None,
"status_i18n": camel_case(req_as.status) if req_as else None,
"result_i18n": camel_case(req_as.result)
Expand Down Expand Up @@ -311,6 +312,9 @@ def get_sorted_requirement_nodes_rec(start: list) -> dict:
"is_scored": child_req_as.is_scored if child_req_as else None,
"score": child_req_as.score if child_req_as else None,
"max_score": max_score if child_req_as else None,
"mapping_inference": child_req_as.mapping_inference
if child_req_as
else None,
"status_display": child_req_as.get_status_display()
if child_req_as
else None,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Generated by Django 5.0.6 on 2024-06-28 11:59

import django.core.validators
import django.db.models.deletion
import iam.models
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("core", "0015_remove_complianceassessment_result_and_more"),
("iam", "0004_ssosettings_user_is_sso"),
]

operations = [
migrations.AddField(
model_name="requirementassessment",
name="mapping_inference",
field=models.JSONField(default=dict, verbose_name="Mapping inference"),
),
migrations.CreateModel(
name="RequirementMappingSet",
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"),
),
(
"urn",
models.CharField(
blank=True,
max_length=100,
null=True,
unique=True,
verbose_name="URN",
),
),
(
"ref_id",
models.CharField(
blank=True,
max_length=100,
null=True,
verbose_name="Reference ID",
),
),
(
"provider",
models.CharField(
blank=True, max_length=200, null=True, verbose_name="Provider"
),
),
(
"name",
models.CharField(max_length=200, null=True, verbose_name="Name"),
),
(
"description",
models.TextField(blank=True, null=True, verbose_name="Description"),
),
(
"annotation",
models.TextField(blank=True, null=True, verbose_name="Annotation"),
),
(
"version",
models.IntegerField(
default=1,
help_text="Version of the mapping set",
verbose_name="Version",
),
),
(
"focal_framework",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="focal_framework",
to="core.framework",
verbose_name="Focal framework",
),
),
(
"folder",
models.ForeignKey(
default=iam.models.Folder.get_root_folder,
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)s_folder",
to="iam.folder",
),
),
(
"library",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="requirement_mapping_sets",
to="core.loadedlibrary",
),
),
(
"reference_framework",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="reference_framework",
to="core.framework",
verbose_name="Reference framework",
),
),
],
options={
"abstract": False,
},
),
migrations.CreateModel(
name="RequirementMapping",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"relationship",
models.CharField(
choices=[
("subset", "Subset"),
("intersect", "Intersect"),
("equal", "Equal"),
("superset", "Superset"),
("not_related", "Not related"),
],
default="not_related",
max_length=20,
verbose_name="Relationship",
),
),
(
"rationale",
models.CharField(
blank=True,
choices=[
("syntactic", "Syntactic"),
("semantic", "Semantic"),
("functional", "Functional"),
],
max_length=20,
null=True,
verbose_name="Rationale",
),
),
(
"strength_of_relationship",
models.PositiveSmallIntegerField(
null=True,
validators=[django.core.validators.MaxValueValidator(10)],
verbose_name="Strength of relationship",
),
),
(
"annotation",
models.TextField(blank=True, null=True, verbose_name="Annotation"),
),
(
"focal_requirement",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="focal_requirement",
to="core.requirementnode",
verbose_name="Focal requirement",
),
),
(
"reference_requirement",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="reference_requirement",
to="core.requirementnode",
verbose_name="Reference requirement",
),
),
(
"mapping_set",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="mappings",
to="core.requirementmappingset",
verbose_name="Mapping set",
),
),
],
),
]
12 changes: 12 additions & 0 deletions backend/core/migrations/0017_merge_20240707_1307.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Generated by Django 5.0.4 on 2024-07-07 13:07

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("core", "0016_requirementassessment_mapping_inference_and_more"),
("core", "0016_riskscenario_owner"),
]

operations = []
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.0.4 on 2024-07-07 13:07

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("core", "0017_merge_20240707_1307"),
]

operations = [
migrations.RemoveField(
model_name="requirementmappingset",
name="version",
),
]
Loading
Loading