-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New notebooks - Low Hanging fruits (#235)
* Adding new workflow notebooks * Modifying existing notebook for KHaaS * PR comments * Last PR comment * Update deployments/kubehound/notebook/LowHangingFruit-ContainerEscape.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-ContainerEscape.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-ContainerEscape.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-ContainerEscape.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-Endpoints.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-Endpoints.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-Endpoints.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> * Update deployments/kubehound/notebook/LowHangingFruit-Endpoints.ipynb Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com> --------- Co-authored-by: Simon Maréchal <66471981+Minosity-VR@users.noreply.github.com>
- Loading branch information
1 parent
99d9e3d
commit 358f2b4
Showing
9 changed files
with
1,445 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2024-07-24T14:46:25.538529Z", | ||
"iopub.status.busy": "2024-07-24T14:46:25.538280Z", | ||
"iopub.status.idle": "2024-07-24T14:46:25.545724Z", | ||
"shell.execute_reply": "2024-07-24T14:46:25.545041Z", | ||
"shell.execute_reply.started": "2024-07-24T14:46:25.538501Z" | ||
}, | ||
"frozen": false, | ||
"init_cell": true, | ||
"tags": [ | ||
"safe_output" | ||
] | ||
}, | ||
"source": [ | ||
"# Autoloading\n", | ||
"\n", | ||
"Loading graph visualisation settings." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"init_cell": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%%capture \"Remove this line to see debug information\"\n", | ||
"%%graph_notebook_vis_options\n", | ||
"{\n", | ||
" \"edges\": {\n", | ||
" \"smooth\": {\n", | ||
" \"enabled\": true,\n", | ||
" \"type\": \"dynamic\"\n", | ||
" },\n", | ||
" \"arrows\": {\n", | ||
" \"to\": {\n", | ||
" \"enabled\": true,\n", | ||
" \"type\": \"arrow\"\n", | ||
" }\n", | ||
" }\n", | ||
" }\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"frozen": false, | ||
"tags": [ | ||
"unsafe_output" | ||
] | ||
}, | ||
"source": [ | ||
"# Initial Setup\n", | ||
"\n", | ||
"## Get a view of all Ingested Cluster\n", | ||
"\n", | ||
"Retrieve all the current cluster ingested in KubeHound with the associated runID with the number of nodes. This numbers can be used to get a clue of the size of the cluster and also identify if an ingestion did not complete." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2024-07-24T14:46:28.273187Z", | ||
"iopub.status.busy": "2024-07-24T14:46:28.272852Z", | ||
"iopub.status.idle": "2024-07-24T14:46:28.625859Z", | ||
"shell.execute_reply": "2024-07-24T14:46:28.625126Z", | ||
"shell.execute_reply.started": "2024-07-24T14:46:28.273156Z" | ||
}, | ||
"frozen": false, | ||
"init_cell": true, | ||
"tags": [ | ||
"safe_output" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%%gremlin -d class -g critical -le 50 -p inv,oute\n", | ||
"\n", | ||
"kh.nodes()\n", | ||
" .groupCount()\n", | ||
" .by(project('cluster','runID')\n", | ||
" .by('cluster').by('runID'))\n", | ||
" .unfold()\n", | ||
" .limit(1000)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"frozen": false, | ||
"tags": [ | ||
"unsafe_output" | ||
] | ||
}, | ||
"source": [ | ||
"## Setting your run_id/cluster\n", | ||
"\n", | ||
"Set which runID you want to use. The variable are being shared with all users of the instance, so we advise to make a uniq string for your user `runID_yourid` to avoid any conflict." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"frozen": false, | ||
"tags": [ | ||
"safe_output" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%%gremlin -d class -g critical -le 50 -p inv,oute\n", | ||
"\n", | ||
"graph.variables()\n", | ||
" .set('runID_yourid','01htdgjj34mcmrrksw4bjy2e94')" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"celltoolbar": "Initialization Cell", | ||
"kernelspec": { | ||
"display_name": "Python 3 (default)", | ||
"language": "python", | ||
"name": "ipykernel-default" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.