Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ianhelle/msticpy 1 0 changes 2021 03 16 #80

Merged
merged 26 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3a00bac
Updated Getting started and ConfiguringNotebookEnvironment notebooks …
ianhelle Mar 16, 2021
e09e639
Update to remove passwords from ML notebook
ianhelle Mar 16, 2021
cd4d5c3
Merge remote-tracking branch 'origin/master' into ianhelle/msticpy_1_…
ianhelle Mar 16, 2021
dec3a7f
Updating nb_check.py - less code in notebook, better error messages, …
ianhelle Mar 27, 2021
0461b82
Updating gitignore for vscode settings
ianhelle Mar 27, 2021
83b7255
Notebook changes for testing
ianhelle Apr 1, 2021
7c4bcdf
Updating nb_check.py to handle string versions and read require MP ve…
ianhelle Apr 5, 2021
cd71301
Updates to nb_check.py.
ianhelle Apr 6, 2021
a423bb7
Fixes for getting started notebook
petebryan Apr 8, 2021
46f9c99
Fixes to Domains Explorer
petebryan Apr 8, 2021
a8fe14b
Covid Notebook Updates
petebryan Apr 8, 2021
0340d09
Updating some text and pip arguments to avoid excessive output - nb_c…
ianhelle Apr 9, 2021
666d6ba
Solarwinds fix
petebryan Apr 9, 2021
8e31c53
WAF update
petebryan Apr 10, 2021
fca5c19
Added function to check for (and install) Kqlmagic/msal_extensions pr…
ianhelle Apr 12, 2021
0cc7ad8
Finalized changes for msticpy 1.0.0rc5 + AML 38 and 36 testing.
ianhelle Apr 13, 2021
3998b22
Updating metadata json with new version dates
ianhelle Apr 13, 2021
6c875fe
Linux Host Notebook Updates
petebryan Apr 14, 2021
bde30d3
Couple of minor fixes to nb_check.py
ianhelle Apr 14, 2021
31ef87c
IP Notebook Update
petebryan Apr 14, 2021
9aa09c6
Updating kernels to azureml_38
ianhelle Apr 14, 2021
406f4d8
kernelspec updates
petebryan Apr 14, 2021
06f6801
Merge branch 'ianhelle/msticpy_1_0_changes-2021-03-16' into pebryan/m…
petebryan Apr 14, 2021
f02df35
Reverting non-mstic notebooks plus Machine Learning in Notebooks Exam…
ianhelle Apr 15, 2021
4122ae4
Merge pull request #81 from Azure/pebryan/msticpy_1_0_changes-2021-03-16
petebryan Apr 15, 2021
43a17bf
Updating image links to github master locations in ConfiguringNoteboo…
ianhelle Apr 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,4 @@ ASALocalRun/
**/Kqlmagic_temp_files/**
**/.mypy_cache/**
**/kqlmagic/**
/.vscode/**
334 changes: 237 additions & 97 deletions A Getting Started Guide For Azure Sentinel ML Notebooks.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions A Getting Started Guide For Azure Sentinel Notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,9 @@
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3.6",
"display_name": "Python 3.8 - AzureML",
"language": "python",
"name": "python36"
"name": "python38-azureml"
},
"language_info": {
"codemirror_mode": {
Expand Down
842 changes: 667 additions & 175 deletions ConfiguringNotebookEnvironment.ipynb

Large diffs are not rendered by default.

3,143 changes: 1,641 additions & 1,502 deletions Entity Explorer - Account.ipynb

Large diffs are not rendered by default.

395 changes: 188 additions & 207 deletions Entity Explorer - Domain and URL.ipynb

Large diffs are not rendered by default.

309 changes: 142 additions & 167 deletions Entity Explorer - IP Address.ipynb

Large diffs are not rendered by default.

1,026 changes: 495 additions & 531 deletions Entity Explorer - Linux Host.ipynb

Large diffs are not rendered by default.

4,222 changes: 2,204 additions & 2,018 deletions Entity Explorer - Windows Host.ipynb

Large diffs are not rendered by default.

1,162 changes: 608 additions & 554 deletions Guided Hunting - Anomalous Office365 Exchange Sessions.ipynb

Large diffs are not rendered by default.

170 changes: 85 additions & 85 deletions Guided Hunting - Base64-Encoded Linux Commands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"\n",
" **Notebook Version:** 1.0<br>\n",
" **Python Version:** Python 3.6 (including Python 3.6 - AzureML)<br>\n",
" **Required Packages**: kqlmagic, msticpy, pandas, pandas_bokeh, numpy, matplotlib, networkx, seaborn, datetime, ipywidgets, ipython, dnspython, ipwhois, folium, maxminddb_geolite2, BeautifulSoup<br>\n",
" **Required Packages**: kqlmagic, msticpy, pandas, numpy, matplotlib, networkx, seaborn, datetime, ipywidgets, ipython, dnspython, folium, maxminddb_geolite2, BeautifulSoup<br>\n",
" **Platforms Supported**:\n",
" - Azure Notebooks Free Compute\n",
" - Azure Notebooks DSVM\n",
Expand Down Expand Up @@ -192,65 +192,27 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824890131
},
"scrolled": true
},
"outputs": [],
"source": [
"from pathlib import Path\n",
"import os\n",
"import sys\n",
"import warnings\n",
"from IPython.display import display, HTML, Markdown\n",
"from pathlib import Path\n",
"from IPython.display import display, HTML\n",
"\n",
"REQ_PYTHON_VER=(3, 6)\n",
"REQ_MSTICPY_VER=(0, 5, 0)\n",
"REQ_PYTHON_VER = \"3.6\"\n",
"REQ_MSTICPY_VER = \"1.0.0\"\n",
"\n",
"display(HTML(\"<h3>Starting Notebook setup...</h3>\"))\n",
"if Path(\"./utils/nb_check.py\").is_file():\n",
" from utils.nb_check import check_python_ver, check_mp_ver\n",
"\n",
" check_python_ver(min_py_ver=REQ_PYTHON_VER)\n",
" try:\n",
" check_mp_ver(min_msticpy_ver=REQ_MSTICPY_VER)\n",
" except ImportError:\n",
" !pip install --user --upgrade msticpy\n",
" if \"msticpy\" in sys.modules:\n",
" importlib.reload(msticpy)\n",
" else:\n",
" import msticpy\n",
" check_mp_ver(REQ_PYTHON_VER)\n",
" from utils.nb_check import check_versions\n",
" check_versions(REQ_PYTHON_VER, REQ_MSTICPY_VER)\n",
" \n",
"from msticpy.nbtools import nbinit\n",
"extra_imports = [\n",
" \"msticpy.nbtools, observationlist\",\n",
" \"msticpy.nbtools.foliummap, get_map_center\",\n",
" \"pyvis.network, Network\",\n",
" \"re\",\n",
" \"ipwhois, IPWhois\",\n",
" \"pandas_bokeh\",\n",
" \"bokeh.palettes, viridis\",\n",
" \"dns, reversename\",\n",
" \"dns, resolver\"\n",
"]\n",
"additional_packages = [\n",
" \"oauthlib\", \"pyvis\", \"python-whois\", \"pandas_bokeh\"\n",
"]\n",
"nbinit.init_notebook(\n",
" namespace=globals(),\n",
" additional_packages=additional_packages,\n",
" extra_imports=extra_imports,\n",
");\n",
"\n",
"WIDGET_DEFAULTS = {\n",
" \"layout\": widgets.Layout(width=\"95%\"),\n",
" \"style\": {\"description_width\": \"initial\"},\n",
"}\n",
"\n",
"from msticpy.sectools import auditdextract\n",
"from msticpy.sectools.cmd_line import *\n",
"from msticpy.sectools.ip_utils import convert_to_ip_entities\n",
"from msticpy.sectools.syslog_utils import *\n",
"from msticpy.sectools.syslog_utils import create_host_record, cluster_syslog_logons_df, risky_sudo_sessions\n"
"nbinit.init_notebook(namespace=globals());\n"
]
},
{
Expand All @@ -273,43 +235,37 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824899543
},
"scrolled": true
},
"outputs": [],
"source": [
"#See if we have an Azure Sentinel Workspace defined in our config file, if not let the user specify Workspace and Tenant IDs\n",
"from msticpy.nbtools.wsconfig import WorkspaceConfig\n",
"# See if we have an Azure Sentinel Workspace defined in our config file.\n",
"# If not, let the user specify Workspace and Tenant IDs\n",
"\n",
"ws_config = WorkspaceConfig()\n",
"print(ws_config)\n",
"try:\n",
" ws_id = ws_config['workspace_id']\n",
" ten_id = ws_config['tenant_id']\n",
" display(HTML(\"Workspace details collected from config file\"))\n",
" config = True\n",
"except:\n",
" display(HTML('Please go to your Log Analytics workspace, copy the workspace ID'\n",
" ' and/or tenant Id and paste here to enable connection to the workspace and querying of it..<br> '))\n",
" ws_id = nbwidgets.GetEnvironmentKey(env_var='WORKSPACE_ID',\n",
" prompt='Please enter your Log Analytics Workspace Id:', auto_display=True)\n",
" ten_id = nbwidgets.GetEnvironmentKey(env_var='TENANT_ID',\n",
" prompt='Please enter your Log Analytics Tenant Id:', auto_display=True)\n",
" config = False\n"
"if not ws_config.config_loaded:\n",
" ws_config.prompt_for_ws()\n",
" \n",
"qry_prov = QueryProvider(data_environment=\"AzureSentinel\")\n",
"print(\"done\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824912258
},
"scrolled": true
},
"outputs": [],
"source": [
"# Establish a query provider for Azure Sentinel and connect to it\n",
"if config is False:\n",
" ws_id = ws_id.value\n",
" ten_id = ten_id.value\n",
"qry_prov = QueryProvider('LogAnalytics')\n",
"qry_prov.connect(connection_str=ws_config.code_connect_str)\n"
"# Authenticate to Azure Sentinel workspace\n",
"qry_prov.connect(ws_config)"
]
},
{
Expand Down Expand Up @@ -337,7 +293,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
"gather": {
"logged": 1617824918576
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -366,7 +324,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
"gather": {
"logged": 1617824925882
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -407,6 +367,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824930857
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -460,6 +423,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824937794
},
"scrolled": true
},
"outputs": [],
Expand All @@ -480,7 +446,7 @@
"\n",
"# Print function headings and descriptions\n",
"for fn in range(len(function_descriptions)):\n",
" display(HTML(f\"<b>{function_names[fn].text}</b>:&nbsp;{function_descriptions[fn].text}\")) "
" display(HTML(f\"<b>{function_names[fn].text}</b>:&nbsp;{function_descriptions[fn].text}<br>\")) "
]
},
{
Expand All @@ -494,6 +460,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824990809
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -584,6 +553,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617824991098
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -651,6 +623,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825049100
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -694,14 +669,18 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825052658
},
"scrolled": true
},
"outputs": [],
"source": [
"ti_lookup = TILookup()\n",
"\n",
"ti_lookup.reload_providers()\n",
"ti_lookup.provider_status"
"if not ti_lookup.provider_status:\n",
" md_warn(\"You have no TI providers configured, please see the documentation link above.\")\n"
]
},
{
Expand Down Expand Up @@ -797,6 +776,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825071437
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -880,6 +862,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825078094
},
"scrolled": true
},
"outputs": [],
Expand All @@ -905,6 +890,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825099112
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -985,6 +973,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825102642
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -1024,6 +1015,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"gather": {
"logged": 1617825107478
},
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -1121,20 +1115,16 @@
"source": [
"nbdisplay.display_timeline(data=b64_df, source_columns=['DecodedCommand', 'Categories'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernel_info": {
"name": "python38-azureml"
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3.8 - AzureML",
"language": "python",
"name": "python3"
"name": "python38-azureml"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1146,7 +1136,17 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.8.1"
},
"nteract": {
"version": "nteract-front-end@1.0.0"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
Expand Down