{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": { "nbsphinx": "hidden" }, "outputs": [], "source": [ "# Delete this cell to re-enable tracebacks\n", "import sys\n", "ipython = get_ipython()\n", "\n", "def hide_traceback(exc_tuple=None, filename=None, tb_offset=None,\n", " exception_only=False, running_compiled_code=False):\n", " etype, value, tb = sys.exc_info()\n", " return ipython._showtraceback(etype, value, ipython.InteractiveTB.get_exception_only(etype, value))\n", "\n", "ipython.showtraceback = hide_traceback" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "nbsphinx": "hidden" }, "outputs": [], "source": [ "# JSON output syntax highlighting\n", "from __future__ import print_function\n", "from pygments import highlight\n", "from pygments.lexers import JsonLexer, TextLexer\n", "from pygments.formatters import HtmlFormatter\n", "from IPython.display import display, HTML\n", "from IPython.core.interactiveshell import InteractiveShell\n", "\n", "InteractiveShell.ast_node_interactivity = \"all\"\n", "\n", "def json_print(inpt):\n", " string = str(inpt)\n", " formatter = HtmlFormatter()\n", " if string[0] == '{':\n", " lexer = JsonLexer()\n", " else:\n", " lexer = TextLexer()\n", " return HTML('{}'.format(\n", " formatter.get_style_defs('.highlight'),\n", " highlight(string, lexer, formatter)))\n", "\n", "globals()['print'] = json_print" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Versioning" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To create a new version of an existing object, specify the property(ies) you want to change and their new values:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
{\n",
" "type": "indicator",\n",
" "id": "indicator--dd052ff6-e404-444b-beb9-eae96d1e79ea",\n",
" "created": "2016-01-01T08:00:00.000Z",\n",
" "modified": "2018-04-05T20:02:51.161Z",\n",
" "name": "File hash for Foobar malware",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "valid_from": "2018-04-05T20:02:51.138312Z",\n",
" "labels": [\n",
" "malicious-activity"\n",
" ]\n",
"}\n",
"
{\n",
" "type": "indicator",\n",
" "id": "indicator--dd052ff6-e404-444b-beb9-eae96d1e79ea",\n",
" "created": "2016-01-01T08:00:00.000Z",\n",
" "modified": "2018-04-05T20:02:54.704Z",\n",
" "name": "File hash for Foobar malware",\n",
" "pattern": "[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",\n",
" "valid_from": "2018-04-05T20:02:51.138312Z",\n",
" "revoked": true,\n",
" "labels": [\n",
" "malicious-activity"\n",
" ]\n",
"}\n",
"