Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 0 additions & 7 deletions incident-ef7/src/incident/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
properties=OrderedDict([
# required properties
('availability_impact', IntegerProperty(min=0, max=100, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
])
)
class AvailabilityImpactExt:
Expand All @@ -31,7 +30,6 @@ class AvailabilityImpactExt:
properties=OrderedDict([
# required properties
('loss_type', EnumProperty(vocab.CONFIDENTIALITY_LOSS, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
# optional properties
('information_type', OpenVocabProperty(vocab.INFORMATION_TYPE)),
('record_count', IntegerProperty(min=0)),
Expand All @@ -55,7 +53,6 @@ def _check_object_constraints(self):
properties=OrderedDict([
# required properties
('impact_type', OpenVocabProperty(vocab.EXTERNAL_IMPACT, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
])
)
class ExternalImpactExt:
Expand All @@ -68,7 +65,6 @@ class ExternalImpactExt:
properties=OrderedDict([
# required properties
('alteration', EnumProperty(vocab.INTEGRITY_ALTERATION, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
# optional properties
('information_type', OpenVocabProperty(vocab.INFORMATION_TYPE)),
('record_count', IntegerProperty(min=0)),
Expand All @@ -91,7 +87,6 @@ def _check_object_constraints(self):
properties=OrderedDict([
# required properties
('variety', OpenVocabProperty(vocab.ECONOMIC_IMPACT, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
# optional properties
('conversion_rate', FloatProperty()),
('conversion_time', TimestampProperty()),
Expand Down Expand Up @@ -168,7 +163,6 @@ def _check_object_constraints(self):
properties=OrderedDict([
# required properties
('impact_type', EnumProperty(vocab.PHYSICAL_IMPACT, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
# optional properties
('asset_type', OpenVocabProperty(vocab.ASSET_TYPE))
])
Expand All @@ -188,7 +182,6 @@ def _check_object_constraints(self):
properties=OrderedDict([
# required properties
('traceability_impact', EnumProperty(vocab.TRACEABILITY_IMPACT, required=True)),
('extension_type', StringProperty(fixed=None)), # needed to indicate it's a sub object extension
])
)
class TraceabilityImpactExt:
Expand Down
20 changes: 8 additions & 12 deletions observed-string-8b1/src/observed_string/observed_string.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import stix2
from .observed_string_ov import STRING_PURPOSE
from stix2.properties import (OpenVocabProperty,
StringProperty)
from stix2.properties import (OpenVocabProperty, IDProperty, StringProperty, TypeProperty)


OBSERVED_STRING_EXTENSION_ID = "extension-definition--8b1aa84c-5532-4c69-a8e7-b6170facfd3d"


@stix2.v21.CustomExtension(
applies_to = "sco",
type = OBSERVED_STRING_EXTENSION_ID,
properties =
[
# required fields
('purpose', OpenVocabProperty(STRING_PURPOSE, required=True)),
('value', StringProperty(required=True))
]
@stix2.v21.CustomObservable(
'observed-string', [
# required fields
('purpose', OpenVocabProperty(STRING_PURPOSE, required=True)),
('value', StringProperty(required=True))
], ['purpose', 'value'], OBSERVED_STRING_EXTENSION_ID,
)
class ObservedString:
extension_type = 'new-sco'
pass