{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--46498844-7689-4e7b-be25-b119d8401159",\n",
- " "created": "2020-06-24T20:55:56.088861Z",\n",
- " "modified": "2020-06-24T20:55:56.088861Z",\n",
+ " "id": "indicator--a315ce0b-1211-478e-812a-cd6d3eecc3c1",\n",
+ " "created": "2021-04-09T13:59:48.911595Z",\n",
+ " "modified": "2021-04-09T13:59:48.911595Z",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:55:56.088861Z",\n",
+ " "valid_from": "2021-04-09T13:59:48.911595Z",\n",
" "object_marking_refs": [\n",
" "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ]\n",
@@ -176,7 +181,7 @@
"indicator = Indicator(pattern_type=\"stix\",\n",
" pattern=\"[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']\",\n",
" object_marking_refs=TLP_AMBER)\n",
- "print(indicator)"
+ "print(indicator.serialize(pretty=True))"
]
},
{
@@ -194,8 +199,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "marking-definition",\n",
" "spec_version": "2.1",\n",
- " "id": "marking-definition--9a4efc30-a7ac-42d0-8776-16f390a0fd44",\n",
- " "created": "2020-06-24T20:56:06.779241Z",\n",
+ " "id": "marking-definition--4b8e86b5-d505-46a4-91b4-a8db17f4ff4d",\n",
+ " "created": "2021-04-09T13:59:50.587649Z",\n",
" "definition_type": "statement",\n",
" "definition": {\n",
" "statement": "Copyright 2017, Example Corp"\n",
@@ -290,7 +300,7 @@
" definition_type=\"statement\", \n",
" definition=StatementMarking(statement=\"Copyright 2017, Example Corp\")\n",
")\n",
- "print(marking_definition)"
+ "print(marking_definition.serialize(pretty=True))"
]
},
{
@@ -308,8 +318,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--75d66696-9960-4229-ba89-2caac50891b3",\n",
- " "created": "2020-06-24T20:56:29.80259Z",\n",
- " "modified": "2020-06-24T20:56:29.80259Z",\n",
+ " "id": "indicator--91ed23a6-c5f0-4b16-8369-64cf39f974bf",\n",
+ " "created": "2021-04-09T13:59:52.602254Z",\n",
+ " "modified": "2021-04-09T13:59:52.602254Z",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:56:29.80259Z",\n",
+ " "valid_from": "2021-04-09T13:59:52.602254Z",\n",
" "object_marking_refs": [\n",
- " "marking-definition--9a4efc30-a7ac-42d0-8776-16f390a0fd44"\n",
+ " "marking-definition--4b8e86b5-d505-46a4-91b4-a8db17f4ff4d"\n",
" ]\n",
"}\n",
" \n"
@@ -405,7 +420,7 @@
"indicator2 = Indicator(pattern_type=\"stix\",\n",
" pattern=\"[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']\",\n",
" object_marking_refs=marking_definition)\n",
- "print(indicator2)"
+ "print(indicator2.serialize(pretty=True))"
]
},
{
@@ -416,8 +431,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--757ea853-138c-44e2-bb00-e78eebfaa378",\n",
- " "created": "2020-06-24T20:56:43.703563Z",\n",
- " "modified": "2020-06-24T20:56:43.703563Z",\n",
+ " "id": "indicator--42ae262e-4839-4c1a-a50a-3a6690623a9d",\n",
+ " "created": "2021-04-09T13:59:54.207797Z",\n",
+ " "modified": "2021-04-09T13:59:54.207797Z",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:56:43.703563Z",\n",
+ " "valid_from": "2021-04-09T13:59:54.207797Z",\n",
" "object_marking_refs": [\n",
" "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ]\n",
@@ -513,7 +533,7 @@
"indicator3 = Indicator(pattern_type=\"stix\",\n",
" pattern=\"[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']\",\n",
" object_marking_refs=\"marking-definition--f88d31f6-486f-44da-b317-01333bde0b82\")\n",
- "print(indicator3)"
+ "print(indicator3.serialize(pretty=True))"
]
},
{
@@ -525,14 +545,19 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "{\n",
" "type": "malware",\n",
" "spec_version": "2.1",\n",
- " "id": "malware--1752bbec-765a-4711-a304-f0e92ca902ae",\n",
- " "created": "2020-06-24T21:21:07.148194Z",\n",
- " "modified": "2020-06-24T21:21:07.148194Z",\n",
+ " "id": "malware--2658ac6a-44e9-44ea-8c8a-d67abae4d0d5",\n",
+ " "created": "2021-04-09T13:59:56.556801Z",\n",
+ " "modified": "2021-04-09T13:59:56.556801Z",\n",
" "name": "Poison Ivy",\n",
" "description": "A ransomware related to ...",\n",
" "is_family": false,\n",
" "granular_markings": [\n",
" {\n",
- " "marking_ref": "marking-definition--9a4efc30-a7ac-42d0-8776-16f390a0fd44",\n",
+ " "marking_ref": "marking-definition--4b8e86b5-d505-46a4-91b4-a8db17f4ff4d",\n",
" "selectors": [\n",
" "description"\n",
" ]\n",
@@ -629,7 +654,7 @@
""
]
},
- "execution_count": 8,
+ "execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
@@ -650,7 +675,7 @@
" \"marking_ref\": TLP_WHITE\n",
" }\n",
" ])\n",
- "print(malware)"
+ "print(malware.serialize(pretty=True))"
]
},
{
@@ -662,7 +687,7 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
@@ -706,14 +731,19 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--46498844-7689-4e7b-be25-b119d8401159",\n",
- " "created": "2020-06-24T20:55:56.088861Z",\n",
- " "modified": "2020-06-24T21:21:39.898475Z",\n",
+ " "id": "indicator--a315ce0b-1211-478e-812a-cd6d3eecc3c1",\n",
+ " "created": "2021-04-09T13:59:48.911595Z",\n",
+ " "modified": "2021-04-09T14:00:01.165749Z",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:55:56.088861Z",\n",
+ " "valid_from": "2021-04-09T13:59:48.911595Z",\n",
" "object_marking_refs": [\n",
- " "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82",\n",
- " "marking-definition--9a4efc30-a7ac-42d0-8776-16f390a0fd44"\n",
+ " "marking-definition--4b8e86b5-d505-46a4-91b4-a8db17f4ff4d",\n",
+ " "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
+ " ]\n",
+ "}\n",
+ " \n"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "indicator4 = indicator.add_markings(marking_definition)\n",
+ "print(indicator4.serialize(pretty=True))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "You can also remove specific markings from STIX objects. This will also create a new version of the object."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "{\n",
+ " "type": "indicator",\n",
+ " "spec_version": "2.1",\n",
+ " "id": "indicator--a315ce0b-1211-478e-812a-cd6d3eecc3c1",\n",
+ " "created": "2021-04-09T13:59:48.911595Z",\n",
+ " "modified": "2021-04-09T14:00:03.00911Z",\n",
+ " "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
+ " "pattern_type": "stix",\n",
+ " "pattern_version": "2.1",\n",
+ " "valid_from": "2021-04-09T13:59:48.911595Z",\n",
+ " "object_marking_refs": [\n",
+ " "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ]\n",
"}\n",
" \n"
@@ -807,15 +955,15 @@
}
],
"source": [
- "indicator4 = indicator.add_markings(marking_definition)\n",
- "print(indicator4)"
+ "indicator5 = indicator4.remove_markings(marking_definition)\n",
+ "print(indicator5.serialize(pretty=True))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "You can also remove specific markings from STIX objects. This will also create a new version of the object."
+ "The markings on an object can be replaced with a different set of markings:"
]
},
{
@@ -826,8 +974,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--46498844-7689-4e7b-be25-b119d8401159",\n",
- " "created": "2020-06-24T20:55:56.088861Z",\n",
- " "modified": "2020-06-24T21:21:43.529702Z",\n",
+ " "id": "indicator--a315ce0b-1211-478e-812a-cd6d3eecc3c1",\n",
+ " "created": "2021-04-09T13:59:48.911595Z",\n",
+ " "modified": "2021-04-09T14:00:04.531083Z",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:55:56.088861Z",\n",
+ " "valid_from": "2021-04-09T13:59:48.911595Z",\n",
" "object_marking_refs": [\n",
- " "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
+ " "marking-definition--34098fce-860f-48ae-8e50-ebd3cc5e41da",\n",
+ " "marking-definition--4b8e86b5-d505-46a4-91b4-a8db17f4ff4d"\n",
" ]\n",
"}\n",
" \n"
@@ -920,15 +1074,17 @@
}
],
"source": [
- "indicator5 = indicator4.remove_markings(marking_definition)\n",
- "print(indicator5)"
+ "from stix2 import TLP_GREEN\n",
+ "\n",
+ "indicator6 = indicator5.set_markings([TLP_GREEN, marking_definition])\n",
+ "print(indicator6.serialize(pretty=True))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "The markings on an object can be replaced with a different set of markings:"
+ "STIX objects can also be cleared of all markings with [clear_markings()](../api/stix2.markings.rst#stix2.markings.clear_markings):"
]
},
{
@@ -939,8 +1095,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--46498844-7689-4e7b-be25-b119d8401159",\n",
- " "created": "2020-06-24T20:55:56.088861Z",\n",
- " "modified": "2020-06-24T21:21:47.703212Z",\n",
+ " "id": "indicator--a315ce0b-1211-478e-812a-cd6d3eecc3c1",\n",
+ " "created": "2021-04-09T13:59:48.911595Z",\n",
+ " "modified": "2021-04-09T14:00:06.512465Z",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:55:56.088861Z",\n",
- " "object_marking_refs": [\n",
- " "marking-definition--9a4efc30-a7ac-42d0-8776-16f390a0fd44",\n",
- " "marking-definition--34098fce-860f-48ae-8e50-ebd3cc5e41da"\n",
- " ]\n",
+ " "valid_from": "2021-04-09T13:59:48.911595Z"\n",
"}\n",
" \n"
],
@@ -1033,121 +1190,9 @@
"output_type": "execute_result"
}
],
- "source": [
- "from stix2 import TLP_GREEN\n",
- "\n",
- "indicator6 = indicator5.set_markings([TLP_GREEN, marking_definition])\n",
- "print(indicator6)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "STIX objects can also be cleared of all markings with [clear_markings()](../api/stix2.markings.rst#stix2.markings.clear_markings):"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 13,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "{\n",
- " "type": "indicator",\n",
- " "spec_version": "2.1",\n",
- " "id": "indicator--46498844-7689-4e7b-be25-b119d8401159",\n",
- " "created": "2020-06-24T20:55:56.088861Z",\n",
- " "modified": "2020-06-24T21:21:53.287178Z",\n",
- " "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
- " "pattern_type": "stix",\n",
- " "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T20:55:56.088861Z"\n",
- "}\n",
- " \n"
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": 13,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
"source": [
"indicator7 = indicator5.clear_markings()\n",
- "print(indicator7)"
+ "print(indicator7.serialize(pretty=True))"
]
},
{
@@ -1168,17 +1213,17 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "['marking-definition--9a4efc30-a7ac-42d0-8776-16f390a0fd44',\n",
- " 'marking-definition--34098fce-860f-48ae-8e50-ebd3cc5e41da']"
+ "['marking-definition--34098fce-860f-48ae-8e50-ebd3cc5e41da',\n",
+ " 'marking-definition--4b8e86b5-d505-46a4-91b4-a8db17f4ff4d']"
]
},
- "execution_count": 14,
+ "execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
@@ -1196,7 +1241,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 14,
"metadata": {},
"outputs": [
{
@@ -1205,7 +1250,7 @@
"['marking-definition--613f2e26-407d-48c7-9eca-b8e91df99dc9']"
]
},
- "execution_count": 15,
+ "execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -1225,7 +1270,7 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 15,
"metadata": {},
"outputs": [
{
@@ -1234,7 +1279,7 @@
"['marking-definition--613f2e26-407d-48c7-9eca-b8e91df99dc9']"
]
},
- "execution_count": 16,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
@@ -1250,6 +1295,26 @@
"Finally, you may also check if an object is marked by a specific markings. Again, for granular markings, pass in the selector or list of selectors."
]
},
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 16,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "indicator.is_marked(TLP_AMBER.id)"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 17,
@@ -1266,33 +1331,13 @@
"output_type": "execute_result"
}
],
- "source": [
- "indicator.is_marked(TLP_AMBER.id)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 18,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 18,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
"source": [
"malware.is_marked(TLP_WHITE.id, 'name')"
]
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 18,
"metadata": {
"scrolled": true
},
@@ -1303,7 +1348,7 @@
"False"
]
},
- "execution_count": 19,
+ "execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
@@ -1323,14 +1368,19 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--f4004de9-a6d9-4c7b-823e-3d8199173c09",\n",
- " "created": "2020-06-24T21:35:08.630228Z",\n",
- " "modified": "2020-06-24T21:35:08.630228Z",\n",
+ " "id": "indicator--a2fd263a-ec46-4fff-84af-27419f0b9f15",\n",
+ " "created": "2021-04-09T14:02:31.991141Z",\n",
+ " "modified": "2021-04-09T14:02:31.991141Z",\n",
" "description": "Una descripcion sobre este indicador",\n",
" "indicator_types": [\n",
" "malware"\n",
@@ -1410,7 +1460,7 @@
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T21:35:08.630228Z",\n",
+ " "valid_from": "2021-04-09T14:02:31.991141Z",\n",
" "object_marking_refs": [\n",
" "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ],\n",
@@ -1435,15 +1485,20 @@
""
]
},
- "execution_count": 20,
+ "execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--f4004de9-a6d9-4c7b-823e-3d8199173c09",\n",
- " "created": "2020-06-24T21:35:08.630228Z",\n",
- " "modified": "2020-06-24T21:35:14.54482Z",\n",
+ " "id": "indicator--a2fd263a-ec46-4fff-84af-27419f0b9f15",\n",
+ " "created": "2021-04-09T14:02:31.991141Z",\n",
+ " "modified": "2021-04-09T14:03:11.817032Z",\n",
" "description": "Una descripcion sobre este indicador",\n",
" "indicator_types": [\n",
" "malware"\n",
@@ -1814,7 +1884,7 @@
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T21:35:08.630228Z",\n",
+ " "valid_from": "2021-04-09T14:02:31.991141Z",\n",
" "object_marking_refs": [\n",
" "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ]\n",
@@ -1831,7 +1901,8 @@
}
],
"source": [
- "print(v21_indicator.clear_markings(\"description\")) # By default, both types of markings will be removed"
+ "# By default, both types of markings will be removed\n",
+ "print(v21_indicator.clear_markings(\"description\").serialize(pretty=True))"
]
},
{
@@ -1842,8 +1913,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--f4004de9-a6d9-4c7b-823e-3d8199173c09",\n",
- " "created": "2020-06-24T21:35:08.630228Z",\n",
- " "modified": "2020-06-24T21:35:39.298138Z",\n",
+ " "id": "indicator--a2fd263a-ec46-4fff-84af-27419f0b9f15",\n",
+ " "created": "2021-04-09T14:02:31.991141Z",\n",
+ " "modified": "2021-04-09T14:03:24.701927Z",\n",
" "description": "Una descripcion sobre este indicador",\n",
" "indicator_types": [\n",
" "malware"\n",
@@ -1923,7 +1999,7 @@
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T21:35:08.630228Z",\n",
+ " "valid_from": "2021-04-09T14:02:31.991141Z",\n",
" "object_marking_refs": [\n",
" "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ],\n",
@@ -1949,7 +2025,7 @@
],
"source": [
"# If lang is False, no lang markings will be removed\n",
- "print(v21_indicator.clear_markings(\"description\", lang=False))"
+ "print(v21_indicator.clear_markings(\"description\", lang=False).serialize(pretty=True))"
]
},
{
@@ -1960,8 +2036,13 @@
{
"data": {
"text/html": [
- "{\n",
" "type": "indicator",\n",
" "spec_version": "2.1",\n",
- " "id": "indicator--f4004de9-a6d9-4c7b-823e-3d8199173c09",\n",
- " "created": "2020-06-24T21:35:08.630228Z",\n",
- " "modified": "2020-06-24T21:35:42.684794Z",\n",
+ " "id": "indicator--a2fd263a-ec46-4fff-84af-27419f0b9f15",\n",
+ " "created": "2021-04-09T14:02:31.991141Z",\n",
+ " "modified": "2021-04-09T14:03:29.751985Z",\n",
" "description": "Una descripcion sobre este indicador",\n",
" "indicator_types": [\n",
" "malware"\n",
@@ -2041,7 +2122,7 @@
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "pattern_type": "stix",\n",
" "pattern_version": "2.1",\n",
- " "valid_from": "2020-06-24T21:35:08.630228Z",\n",
+ " "valid_from": "2021-04-09T14:02:31.991141Z",\n",
" "object_marking_refs": [\n",
" "marking-definition--f88d31f6-486f-44da-b317-01333bde0b82"\n",
" ],\n",
@@ -2067,7 +2148,7 @@
],
"source": [
"# If marking_ref is False, no marking-definition markings will be removed\n",
- "print(v21_indicator.clear_markings(\"description\", marking_ref=False))"
+ "print(v21_indicator.clear_markings(\"description\", marking_ref=False).serialize(pretty=True))"
]
}
],
@@ -2087,7 +2168,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.9.0a6"
+ "version": "3.9.2"
}
},
"nbformat": 4,
diff --git a/docs/guide/memory.ipynb b/docs/guide/memory.ipynb
index d8a7000..cf9f035 100644
--- a/docs/guide/memory.ipynb
+++ b/docs/guide/memory.ipynb
@@ -187,7 +187,7 @@
"mem.add(ind)\n",
"\n",
"# for visual purposes\n",
- "print(mem.get(ind.id))\n"
+ "print(mem.get(ind.id).serialize(pretty=True))\n"
]
},
{
@@ -304,7 +304,7 @@
"mem.add([ind2,ind3, mal])\n",
"\n",
"# for visual purposes\n",
- "print(mem.get(ind3.id))"
+ "print(mem.get(ind3.id).serialize(pretty=True))"
]
},
{
@@ -412,7 +412,7 @@
"from stix2 import Filter\n",
"\n",
"mal = mem.query([Filter(\"malware_types\",\"=\", \"rootkit\")])[0]\n",
- "print(mal)"
+ "print(mal.serialize(pretty=True))"
]
},
{
@@ -533,7 +533,7 @@
"report = mem_2.get(\"malware--6cee28b8-4d42-4e72-bd77-ea47897672c0\")\n",
"\n",
"# for visual purposes\n",
- "print(report)"
+ "print(report.serialize(pretty=True))"
]
}
],
diff --git a/docs/guide/parsing.ipynb b/docs/guide/parsing.ipynb
index 5fd9499..fe4df7d 100644
--- a/docs/guide/parsing.ipynb
+++ b/docs/guide/parsing.ipynb
@@ -64,7 +64,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Parsing STIX content is as easy as calling the [parse()](../api/stix2.parsing.rst#stix2.parsing.parse) function on a JSON string, dictionary, or file-like object. It will automatically determine the type of the object. The STIX objects within `bundle` objects, and any cyber observables contained within `observed-data` objects will be parsed as well.\n",
+ "Parsing STIX content is as easy as calling the [parse()](../api/stix2.parsing.rst#stix2.parsing.parse) function on a JSON string, dictionary, or file-like object. It will automatically determine the type of the object. The STIX objects within `bundle` objects will be parsed as well.\n",
"\n",
"**Parsing a string**"
]
@@ -77,8 +77,13 @@
{
"data": {
"text/html": [
- "