[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Intelworks implementation of STIX in JSON
Dear all,
With the excellent work going on from @Bret Jordan on STIX in JSON, we thought it helpful to share Intelworks approach to STIX in JSON and ensure the community learned from our mistakes and investments. Props to list- and team member @Wouter Bolsterlee for
his work on this!
In short, lessons learned
Full details further down in this email. Your feedback is much appreciated.
We do have work-in-progress libraries available for (store-less) bi-directional transformation of XML, JSON and YAML notations – which might help those implementing STIX in JSON down the road. If you’d like to know more, please contact me off-list.
Best regards,
Joep
Founder & CEO
Intelworks – Intelligence Powered Defence
www.intelworks.com
Find me at
+31 615489825
@joepgommers
====
The STIX language uses quite a few advanced XML modelling techniques (multiple namespaces, xsi:type substitutions in instance documents, QName identifiers, and so on), making it quite complex to work with/implement. The JSON format used by Intelworks tries to be much simpler to work with. Structurally it mirrors most of the original XML tree structure, but the resulting tree structures are not identical since the JSON representation favours flat objects over nested structures. Compound structures are objectsIn general, each compound structure is converted into a JSON object (dict in Python). These objects always have a {
"type": "indicator",
"...": "..."
}
Each of the main STIX constructs (see the STIX
architecture) is represented as a JSON object. The
Secondary constructs use these additional types (this list is NON EXHAUSTIVE! And just a representation of potential)
Attributes and child elements are key/value pairsBoth the attributes and child elements defined for a compound structure usually map to additional key/value pairs of the JSON objects: {
"type": "indicator",
"negate": false,
"title": "This is the title."
}
Relations are nested objects (or arrays of objects)For one-to-one relations, the value is a nested object, and the key is a singular noun ( {
"type": "indicator",
"observable": {
"type": "observable",
"...": "..."
},
"...": "..."
}
For one-to-many relations, the value is a JSON array containing the child objects, and the key is a plural noun ( {
"type": "package",
"indicators": [
{
"type": "indicator",
"...": "..."
},
{
"type": "indicator",
"...": "..."
}
],
"...": "..."
}
Additionally, the many {
"type": "indicator",
"indicated_ttps": [
{
"type": "ttp",
"relationship": "...",
"relationship_information_source": "...",
"...": "..."
},
{
"type": "ttp",
"relationship": "...",
"relationship_information_source": "...",
"...": "..."
}
],
"...": "..."
}
See also the notes about nesting below. Flat is better than nestedThe STIX XML representation is deeply nested, partly due to the way XML is typically used. The JSON representation tries to be a bit more pragmatic and adheres to the "flat is better than nested" adage. In practice, this means that nested container structures are flattened as much as possible. Unnecessary container structures are simply removed. For example, the To further reduce the number of nested objects, various XML constructs using container elements with (optional) attributes are flattened into the parent object by using multiple related keys. This is best explained using an example. For example, the {
"type": "...",
"description": {
"structuring_format": "html",
"value": "Description goes here."
},
"...": "..."
}
Since the {
"type": "...",
"description": "Description goes here.",
"description_structuring_format": "html",
"...": "..."
}
In case the {
"type": "...",
"description": "Description goes here.",
"...": "..."
}
ID handlingAll The top level object may optionally contain an {
"type": "package",
"id": "{http://example.org/}Package-b3ba766b-d3e6-4d92-82b2-5940f0cb763c",
"id_namespaces": {
"example": "http://example.org/"
}
}
<stix:STIX_Package
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:example="http://example.com/"
id="example:Package-b3ba766b-d3e6-4d92-82b2-5940f0cb763c">
…
</stix:STIX_Package>
In case no Special conversion notes
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]