You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to parse an input document with a custom CV without registering a VocabString class for it, I get a parse error. This is on python-stix 1.2.0.1.dev0.
My foobar:FooVocab-1.0 instance below causes problems, but shouldn't.
<stix:STIX_Packagexmlns:coa="http://stix.mitre.org/CourseOfAction-1"xmlns:cybox="http://cybox.mitre.org/cybox-2"xmlns:cyboxCommon="http://cybox.mitre.org/common-2"xmlns:cyboxVocabs="http://cybox.mitre.org/default_vocabularies-2"xmlns:example="http://example.com"xmlns:incident="http://stix.mitre.org/Incident-1"xmlns:stix="http://stix.mitre.org/stix-1"xmlns:stixCommon="http://stix.mitre.org/common-1"xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"xmlns:foobar="a:testing:namespace"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"id="example:Package-73ce966d-52d2-4092-af41-114e45721814"version="1.2"timestamp="2015-06-02T20:21:54.139127+00:00">
<stix:Incidents>
<stix:Incidentid="example:incident-b44bc002-4f4c-4dea-ab8b-2dbef815d016"timestamp="2015-06-02T20:21:54.139254+00:00"xsi:type='incident:IncidentType'>
<incident:Title>Breach</incident:Title>
<incident:COA_Requested>
<incident:Course_Of_Actionid="example:coa-9b5c8e6f-c7e4-45dc-812e-098d455bf023"timestamp="2015-06-02T20:21:54.139444+00:00"xsi:type='coa:CourseOfActionType'>
<coa:Title>Monitor activity related to known compromised accounts</coa:Title>
<coa:Typexsi:type="foobar:FooVocab-1.0">THIS SHOULD BE FINE</coa:Type>
<coa:Objective>
<coa:Description>This will further our investigation into the intruders who are re-using compromised accounts.</coa:Description>
</coa:Objective>
</incident:Course_Of_Action>
</incident:COA_Requested>
</stix:Incident>
</stix:Incidents>
</stix:STIX_Package>
Parse output:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "stix/core/stix_package.py", line 508, in from_xml
return entity_parser.parse_xml(xml_file, encoding=encoding)
File "stix/utils/parser.py", line 259, in parse_xml
stix_package = STIXPackage().from_obj(stix_package_obj)
File "stix/core/stix_package.py", line 455, in from_obj
return_obj.incidents = Incidents.from_obj(obj.Incidents)
File "stix/base.py", line 384, in from_obj
return_obj.append(contained_type.from_obj(item))
File "stix/incident/__init__.py", line 530, in from_obj
return_obj.coa_requested = _COAsRequested.from_obj(obj.COA_Requested)
File "stix/base.py", line 497, in from_obj
return cls(items)
File "stix/base.py", line 530, in __init__
TypedCollection.__init__(self, *args)
File "stix/base.py", line 440, in __init__
self._initialize_inner(*args)
File "stix/base.py", line 539, in _initialize_inner
self.extend(arg)
File "/home/bworrell/.virtualenvs/python-stix/lib/python2.7/_abcoll.py", line 669, in extend
for v in values:
File "stix/base.py", line 496, in <genexpr>
items = (contained_type.from_obj(x) for x in obj_list)
File "stix/incident/coa.py", line 124, in from_obj
super(COARequested, cls).from_obj(obj, return_obj=return_obj)
File "stix/incident/coa.py", line 61, in from_obj
return_obj.course_of_action = CourseOfAction.from_obj(obj.Course_Of_Action)
File "stix/coa/__init__.py", line 209, in from_obj
return_obj.type_ = VocabString.from_obj(obj.Type)
File "stix/common/vocabs.py", line 108, in from_obj
klass = stix.lookup_extension(vocab_obj.xsi_type, default=cls)
File "stix/__init__.py", line 79, in lookup_extension
return _lookup_extension(typeinfo)
File "stix/__init__.py", line 51, in _lookup_extension
raise ValueError("Unregistered xsi:type %s" % xsi_type)
ValueError: Unregistered xsi:type foobar:FooVocab-1.0
The text was updated successfully, but these errors were encountered:
If I try to parse an input document with a custom CV without registering a
VocabString
class for it, I get a parse error. This is on python-stix 1.2.0.1.dev0.My
foobar:FooVocab-1.0
instance below causes problems, but shouldn't.Parse output:
The text was updated successfully, but these errors were encountered: