diff --git a/incident-ef7/src/incident/impact.py b/incident-ef7/src/incident/impact.py index 0bc983f..827f0e2 100644 --- a/incident-ef7/src/incident/impact.py +++ b/incident-ef7/src/incident/impact.py @@ -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: @@ -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)), @@ -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: @@ -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)), @@ -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()), @@ -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)) ]) @@ -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: diff --git a/observed-string-8b1/src/observed_string/observed_string.py b/observed-string-8b1/src/observed_string/observed_string.py index 38294d3..c989014 100644 --- a/observed-string-8b1/src/observed_string/observed_string.py +++ b/observed-string-8b1/src/observed_string/observed_string.py @@ -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