Skip to content

Commit 40d89f0

Browse files
authored
Merge pull request #297 from STIXProject/next-release
Next release
2 parents 67f1893 + 9530bca commit 40d89f0

File tree

120 files changed

+2424
-10186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2424
-10186
lines changed

docs/api/utils/nsparser.rst

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,75 @@
33

44
.. module:: stix.utils.nsparser
55

6-
Classes
7-
-------
8-
9-
.. autoclass:: NamespaceParser
10-
:show-inheritance:
11-
:members:
12-
136
Constants
147
---------
158

16-
.. autodata:: XML_NAMESPACES
9+
.. autodata:: NS_CAMPAIGN_OBJECT
10+
11+
.. autodata:: NS_CAPEC_OBJECT
12+
13+
.. autodata:: NS_CIQIDENTITY_OBJECT
14+
15+
.. autodata:: NS_COA_OBJECT
16+
17+
.. autodata:: NS_CVRF_OBJECT
18+
19+
.. autodata:: NS_ET_OBJECT
20+
21+
.. autodata:: NS_GENERICSTRUCTUREDCOA_OBJECT
22+
23+
.. autodata:: NS_GENERICTM_OBJECT
24+
25+
.. autodata:: NS_INCIDENT_OBJECT
26+
27+
.. autodata:: NS_INDICATOR_OBJECT
28+
29+
.. autodata:: NS_IOC_OBJECT
30+
31+
.. autodata:: NS_IOCTR_OBJECT
32+
33+
.. autodata:: NS_MARKING_OBJECT
34+
35+
.. autodata:: NS_OVALDEF_OBJECT
36+
37+
.. autodata:: NS_OVALVAR_OBJECT
38+
39+
.. autodata:: NS_REPORT_OBJECT
40+
41+
.. autodata:: NS_SIMPLEMARKING_OBJECT
42+
43+
.. autodata:: NS_SNORTTM_OBJECT
44+
45+
.. autodata:: NS_STIX_OBJECT
46+
47+
.. autodata:: NS_STIXCAPEC_OBJECT
48+
49+
.. autodata:: NS_STIXCIQADDRESS_OBJECT
50+
51+
.. autodata:: NS_STIXCVRF_OBJECT
52+
53+
.. autodata:: NS_STIXMAEC_OBJECT
54+
55+
.. autodata:: NS_STIXOPENIOC_OBJECT
56+
57+
.. autodata:: NS_STIXOVAL_OBJECT
58+
59+
.. autodata:: NS_STIXCOMMON_OBJECT
60+
61+
.. autodata:: NS_STIXVOCABS_OBJECT
62+
63+
.. autodata:: NS_TA_OBJECT
64+
65+
.. autodata:: NS_TLPMARKING_OBJECT
66+
67+
.. autodata:: NS_TOUMARKING_OBJECT
68+
69+
.. autodata:: NS_TTP_OBJECT
1770

18-
.. autodata:: STIX_NS_TO_SCHEMALOCATION
71+
.. autodata:: NS_XAL_OBJECT
1972

20-
.. autodata:: EXT_NS_TO_SCHEMALOCATION
73+
.. autodata:: NS_XNL_OBJECT
2174

22-
.. autodata:: DEFAULT_STIX_NS_TO_PREFIX
75+
.. autodata:: NS_XPIL_OBJECT
2376

24-
.. autodata:: DEFAULT_EXT_TO_PREFIX
77+
.. autodata:: NS_YARATM_OBJECT

examples/custom_vocabstring.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# builtin
1010
from StringIO import StringIO
1111

12+
import mixbox.namespaces
13+
1214
# python-stix modules
1315
from stix.core import STIXPackage
1416
from stix.common import vocabs
@@ -38,6 +40,11 @@ class CustomVocab(vocabs.VocabString):
3840
_XSI_TYPE = 'customVocabs:CustomVocab-1.0'
3941
_ALLOWED_VALUES = ('FOO', 'BAR')
4042

43+
# Register the namespace of the CustomVocab
44+
mixbox.namespaces.register_namespace(
45+
mixbox.namespaces.Namespace(
46+
'http://customvocabs.com/vocabs-1', 'customVocabs'))
47+
4148
# Register our Custom Vocabulary class so parsing and serialization works
4249
vocabs.add_vocab(CustomVocab)
4350

examples/vuln_affected_software.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# python-stix
1717
from stix.core import STIXPackage
1818
from stix.exploit_target import ExploitTarget
19-
from stix.exploit_target.vulnerability import Vulnerability
19+
from stix.exploit_target.vulnerability import Vulnerability, AffectedSoftware
2020

2121

2222
# Build a Product Object that characterizes our affected software
@@ -32,6 +32,7 @@
3232
# RelatedObservable instances. This wraps our Observable in a
3333
# RelatedObservable layer.
3434
vuln = Vulnerability()
35+
vuln.affected_software = AffectedSoftware()
3536
vuln.affected_software.append(observable)
3637

3738
# Create the Exploit Target

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ def get_version():
3131
'test': [
3232
'nose==1.3.0',
3333
'tox==1.6.1',
34-
'maec>=4.1.0.13.dev1,<4.1.1.0',
34+
'maec>=4.1.0.13.dev4,<4.1.1.0',
3535
],
3636
}
3737

3838

3939
install_requires = [
4040
'lxml>=2.3',
4141
'python-dateutil',
42-
'cybox>=2.1.0.13.dev0,<2.1.1.0',
43-
'mixbox>=0.0.10',
42+
'cybox>=2.1.0.13.dev1,<2.1.1.0',
43+
'mixbox>=0.0.13',
4444
]
4545

4646

stix/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def _lookup_extension(xsi_type):
4747
ValueError: If no class has been registered for the `xsi_type`.
4848
4949
"""
50+
import stix.extensions.malware.maec_4_1_malware
51+
5052
if xsi_type in _EXTENSION_MAP:
5153
return _EXTENSION_MAP[xsi_type]
5254

@@ -86,7 +88,7 @@ def lookup_extension(typeinfo, default=None):
8688
return default
8789

8890
error = "Input %s is missing xml_type attribute. Cannot lookup class."
89-
raise ValueError(error)
91+
raise ValueError(error % type(typeinfo))
9092

9193
# Extension binding classes usually (always?) have an `xmlns_prefix`
9294
# class attribute.
@@ -124,11 +126,9 @@ def register_extension(cls):
124126
add_extension(cls)
125127
return cls
126128

127-
128129
from . import common # noqa
129130
from .version import __version__ # noqa
130131

131-
132132
def supported_stix_version():
133133
"""Returns a tuple of STIX version strings that this version of python-stix
134134
supports (i.e., can parse).

0 commit comments

Comments
 (0)