-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ca 546 enrich assets to support security objectives and rto rpo mtd (#…
…993)
- Loading branch information
Showing
33 changed files
with
1,245 additions
and
75 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
backend/core/migrations/0037_asset_disaster_recovery_objectives_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,99 @@ | ||
# Generated by Django 5.1.1 on 2024-11-20 18:29 | ||
|
||
import core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0036_asset_owner"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="asset", | ||
name="disaster_recovery_objectives", | ||
field=models.JSONField( | ||
blank=True, | ||
default=dict, | ||
help_text="The disaster recovery objectives of the asset", | ||
validators=[ | ||
core.validators.JSONSchemaInstanceValidator( | ||
{ | ||
"$id": "https://ciso-assistant.com/schemas/assets/security_objectives.schema.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "The security objectives of the asset", | ||
"properties": { | ||
"objectives": { | ||
"patternProperties": { | ||
"^[a-z_]+$": { | ||
"properties": { | ||
"value": { | ||
"minimum": 0, | ||
"type": "integer", | ||
} | ||
}, | ||
"type": "object", | ||
} | ||
}, | ||
"type": "object", | ||
} | ||
}, | ||
"title": "Security objectives", | ||
"type": "object", | ||
} | ||
) | ||
], | ||
verbose_name="Disaster recovery objectives", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="asset", | ||
name="reference_link", | ||
field=models.URLField( | ||
blank=True, | ||
help_text="External url for action follow-up (eg. Jira ticket)", | ||
max_length=2048, | ||
null=True, | ||
verbose_name="Link", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="asset", | ||
name="security_objectives", | ||
field=models.JSONField( | ||
blank=True, | ||
default=dict, | ||
help_text="The security objectives of the asset", | ||
validators=[ | ||
core.validators.JSONSchemaInstanceValidator( | ||
{ | ||
"$id": "https://ciso-assistant.com/schemas/assets/security_objectives.schema.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "The security objectives of the asset", | ||
"properties": { | ||
"objectives": { | ||
"patternProperties": { | ||
"^[a-z_]+$": { | ||
"properties": { | ||
"is_enabled": {"type": "boolean"}, | ||
"value": { | ||
"minimum": 0, | ||
"type": "integer", | ||
}, | ||
}, | ||
"type": "object", | ||
} | ||
}, | ||
"type": "object", | ||
} | ||
}, | ||
"title": "Security objectives", | ||
"type": "object", | ||
} | ||
) | ||
], | ||
verbose_name="Security objectives", | ||
), | ||
), | ||
] |
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.