Path: blob/master/Entity Explorer - Windows Host.ipynb
3249 views
Host Explorer
Note: This notebook has been superceeded by the Entity Explorer - Host notebook and will be removed in a future update.
Please migrate to the Host notebook: https://github.com/Azure/Azure-Sentinel-Notebooks/blob/master/Entity Explorer - Host.ipynb
Details...
Notebook Version: 2.0
Python Version: Python 3.10 (including "Python 3.10 - SDK v2" - AzureML)
Required Packages: msticpy, msticnb
Data Sources Required:
Log Analytics - SecurityAlert, SecurityEvent (EventIDs 4688 and 4624/25), AzureNetworkAnalytics_CL, Heartbeat
(Optional) - VirusTotal, AlienVault OTX, IBM XForce, Open Page Rank, (all require accounts and API keys)
Brings together a series of queries and visualizations to help you determine the security state of the host that you are investigating.
Notebook initialization
The next cell:
Checks versions and optionally installs required packages
Imports the required packages into the notebook
Sets a number of configuration options.
More details...
This should complete without errors. If you encounter errors or warnings look at the following two notebooks:
If you are running in the Microsoft Sentinel Notebooks environment (Azure Notebooks or Azure ML) you can run live versions of these notebooks:
You may also need to do some additional configuration to successfully use functions such as Threat Intelligence service lookup and Geo IP lookup. There are more details about this in the ConfiguringNotebookEnvironment notebook and in these documents:
Get WorkspaceId and Authenticate to Microsoft Sentinel
Use the following syntax if you are authenticating using an Azure Active Directory AppId and Secret:
instead of
Note: you may occasionally see a JavaScript error displayed at the end of the authentication - you can safely ignore this.
On successful authentication you should see a popup schema button. To find your Workspace Id go to Log Analytics. Look at the workspace properties to find the ID.
Authentication and Configuration Problems
Click for details about configuring your authentication parameters
The notebook is expecting your Microsoft Sentinel Tenant ID and Workspace ID to be configured in one of the following places:
config.jsonin the current foldermsticpyconfig.yamlin the current folder or location specified byMSTICPYCONFIGenvironment variable.
For help with setting up your config.json file (if this hasn't been done automatically) see the ConfiguringNotebookEnvironment notebook in the root folder of your Azure-Sentinel-Notebooks project. This shows you how to obtain your Workspace and Subscription IDs from the Microsoft Sentinel Portal. You can use the SubscriptionID to find your Tenant ID). To view the current config.json run the following in a code cell.
%pfile config.json
For help with setting up your msticpyconfig.yaml see the Setup section at the end of this notebook and the ConfigureNotebookEnvironment notebook
Import and initialize notebooklets
This imports the msticnb package and the notebooklets classes.
These are needed for the notebook operations
Enter host name and query time window
Type the host name that you want to search for and the time bounds over which you want to search.
Review host overview
The following cells runs the Host Summary Notebooklet to provide an overview of the host, and its activty within the timeframe specified. Use the output of this cell to understand the context of its host and identify areas of further investigation.
Review alerts
The following cell returns a list of all Microsoft Sentinel alerts reated to the host. You can browse and review these alerts.
Below is a timeline of the alerts related to the host.
Review bookmarks
If there are any bookmarks referencing this host they can be viewed by calling host_result.related_bookmarks.
Review these bookmarks to see if this host has been flagged as part of a previous investigation or threat hunt.
Summarize Host Events
As there are likely to be a large number of log events for a host the below table is a summary of all the events from the host.
You can use this table to idenfify addtional queries to run to review specific types of log entries.
Noteable Host Events
Some log events such as those of a high severity are considered to be "noteable" events. Review these events and combined with the summary of all events you can identify additional queries to run to review specific types of log entries.
To access the DataFrames output by this code call host_result.scheduled_tasks, host_result.account_actions or host_result.notable_events to access to data.
Review Host Logons
Host activity is often driven by user actions. The following cell runs the Host Logon Notebooklet that summarizes logon sessions related to the host.
Review the output of this notebooklet to identify logon sessions of note.
Host Processes
The following is a process tree of all the processes executed on the host in the time window defined. You can interact with the tree to see parent and child processes.
The above process tree may be too large to find events of value, the following is a processes tree to processeses associated with the defined user (if no user is defined then the most commonly seen user is used).
Extract IOCs related to these processes and look them up against Threat Intelligence
Process data often contains command line activity, we can extract IoCs from these command lines and look them up in Threat Intelligence sources to help narrow focus on interesting processes.
To access the DataFrames output by this code call host_result.processes or process_ti_results to access to data.
Review Network Connections
A hosts network traffic can often help identify anomolous or suspicious patterns of activity.
The cell below runs the Host Network Connections Notebooklet that summarizes network connections related to the host.
Review the output of this cell to identify suspicious network connection patterns.
To access the DataFrames output by this code call host_network_result.flows, host_network_result.flows_ti to access to data.
Use other notebooklets and pivots functions to drill down on other entities
You may want to drill down on other entities in the Host data. You can use methods of the IpAddress or Account entities, for example, to look at these in more detail.
Run the ip_address_summary notebooklet pivot
View the TI results