HELK/README.md

180 lines
7.9 KiB
Markdown
Raw Normal View History

2017-05-26 06:11:09 +00:00
# HELK [Beta]
2018-01-06 22:14:43 +00:00
A Hunting ELK (Elasticsearch, Logstash, Kibana) with advanced analytic capabilities.
2018-01-16 01:11:13 +00:00
![alt text](resources/images/HELK_Design.png "HELK Infrastructure")
2017-04-14 05:29:04 +00:00
2017-06-29 15:21:59 +00:00
# Goals
* Provide a free hunting platform to the community and share the basics of Threat Hunting.
* Make sense of a large amount of event logs and add more context to suspicious events during hunting.
* Expedite the time it takes to deploy an ELK stack.
2018-01-06 22:14:43 +00:00
* Improve the testing of hunting use cases in an easier and more affordable way.
* Enable Data Science via Apache Spark, GraphFrames & Jupyter Notebooks.
2017-06-29 15:21:59 +00:00
# Resources
* [Setting up a Pentesting.. I mean, a Threat Hunting Lab - Part 5](https://cyberwardog.blogspot.com/2017/02/setting-up-pentesting-i-mean-threat_98.html)
2018-01-08 22:58:42 +00:00
* [An Integrated API for Mixing Graph and Relational Queries](https://cs.stanford.edu/~matei/papers/2016/grades_graphframes.pdf)
* [Graph queries in Spark SQL](https://www.slideshare.net/SparkSummit/graphframes-graph-queries-in-spark-sql)
* [Graphframes Overview](http://graphframes.github.io/index.html)
2017-06-29 15:21:59 +00:00
* [Elastic Producs](https://www.elastic.co/products)
2018-01-08 22:58:42 +00:00
* [Elasticsearch Guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)
* [spujadas elk-docker](https://github.com/spujadas/elk-docker)
* [deviantony docker-elk](https://github.com/deviantony/docker-elk)
2017-06-29 15:21:59 +00:00
2017-05-26 06:11:09 +00:00
# Getting Started
2017-06-06 21:30:52 +00:00
## Requirements
2018-01-08 22:58:42 +00:00
* OS Name: Linux (Debian-based systems)
* Bash Script Option: Tested on Ubuntu-16.04.2 Server amd64 (Xenial)
2017-05-26 06:11:09 +00:00
* Network Connection: NAT or Bridge
* RAM: 4GB (minimum)
2017-06-06 21:30:52 +00:00
* Applications:
2018-01-06 22:14:43 +00:00
* Docker(Needed for HELK Docker Installation ONLY)
2018-01-08 22:58:42 +00:00
* Winlogbeat running on your endpoints (At least sending Sysmon and Windows Security event logs)
* HELK's current version parses logs shipped by Winlogbeat ONLY (Nxlog parsing is coming soon)
## Automatic Installation Options
The HELK project comes with three options:
* Pulling the latest HELK Docker Image from cyb3rward0g dockerhub
* Building the HELK image from a local Dockerfile
* Installing the HELK from a local bash script
2017-06-06 21:30:52 +00:00
```
git clone https://github.com/Cyb3rWard0g/HELK.git
2018-01-08 22:58:42 +00:00
cd HELK/
sudo ./helk_install.sh
**********************************************
** HELK - M E N U **
** **
** Author: Roberto Rodriguez (@Cyb3rWard0g) **
** HELK build version: 0.9 (BETA) **
** HELK ELK version: 6.x **
** License: BSD 3-Clause **
**********************************************
1. Pull the latest HELK image from DockerHub
2. Build the HELK image from local Dockerfile
3. Install the HELK from local bash script
4. Exit
[HELK-INSTALLATION-INFO] Enter choice [ 1 - 4]
2017-06-06 21:30:52 +00:00
```
2018-01-08 22:58:42 +00:00
## HELK Initial Settings
At the end of the HELK installation, you will have a similar output with the information you need to access the primary HELK components. Remember that the default username and password for the HELK are helk:hunting.
2018-01-06 22:14:43 +00:00
```
***********************************************************************************
** [HELK-INSTALLATION-INFO] YOUR HELK IS READY **
** [HELK-INSTALLATION-INFO] USE THE FOLLOWING SETTINGS TO INTERACT WITH THE HELK **
***********************************************************************************
2018-01-08 22:58:42 +00:00
HELK KIBANA URL: http://192.168.1.243
HELK KIBANA USER: helk
HELK KIBANA PASSWORD: hunting
HELK JUPYTER CURRENT TOKEN: bf329433d64f735ae50dce73bab995bb240194a98b84bfd2
HELK SPARK UI: http://192.168.1.243:4040
HELK JUPYTER NOTEBOOK URI: http://192.168.1.243:8880
HELK DOCKER BASH ACCESS: sudo docker exec -ti helk bash
IT IS HUNTING SEASON!!!!!
2018-01-06 22:14:43 +00:00
```
2018-01-08 22:58:42 +00:00
## Visualize your logs (Discover)
Make sure you have logs being sent to your HELK first (At least Windows security events). Then, go to http://<HELK's IP> in your preferred browser. (If you dont have logs being sent to your HELK you will have to wait and repeat the first steps of this section)
Currently, the HELK has 6 indices created automatically by its default configs:
* "*" - All
* "sysmon-*"
* "winevent-security-*"
* "winevent-application-*"
* "winevent-system-*"
* "powershell-*"
![alt text](resources/images/HELK_winevent_security_discovery.png "HELK Winevent Security Discovery")
## Visualize your logs (Dashboards)
Make sure you have logs being sent to your HELK first (At least Windows security events). Then, go to http://<HELK's IP> in your preferred browser. (If you dont have logs being sent to your HELK you will have to wait and repeat the first steps of this section)
Currently, the HELK provides 3 dashboards:
* Global_Dashboard
* Network_Dashboard
* Sysmon_Dashboard
![alt text](resources/images/HELK_Network_Dashboard.png "HELK Network Dashboard")
2018-01-08 22:58:42 +00:00
## (Docker) Accessing the HELK's container
By default, the HELK's container is run in the background. Therefore, you will have to access your docker container by running the following commands:
2018-01-06 22:14:43 +00:00
```
2018-01-08 22:58:42 +00:00
sudo docker exec -ti helk bash
root@7a9d6443a4bf:/opt/helk/scripts#
2018-01-06 22:14:43 +00:00
```
2018-01-08 22:58:42 +00:00
## Checking HELK integrations (Spark, Graphframes & Jupyter)
* (Bash script Install) If the HELK was installed via the local bash script, make sure you enable the .bashrc file before starting the Jupyter server.
```
2018-01-08 22:58:42 +00:00
source ~/.bashrc && pyspark
```
2018-01-08 22:58:42 +00:00
* (Docker Install) By default, the Jupyter server gets started automatically after building or pulling the HELK's container.
* Access the Jupyter Server:
* Go to your <Container's IP>:8880 in your preferred browser
* Enter the token provided after installing the HELK
* Go to the scripts/training/jupyter_notebooks/getting_started/ folder
* Open the Check_Spark_Graphframes_Integrations notebook
* Check the saved output (Make sure that you have Sysmon * Windows Security event logs being sent to your HELK. Otherwise you will get errors in your Jupyter Notebook when trying to replicate the basic commands)
* Clear the output from the notebook and run everything again
2018-01-08 23:22:29 +00:00
![alt text](resources/images/HELK_checking_integrations.png "HELK Checking Integrations")
2018-01-08 22:58:42 +00:00
## HELK's Heap Size
By default, HELK calculates how much memory the host has and assigns 50% of it to it (You can change that by manually modifying the /etc/elasticsearch/jvm.options file after the installation and restarting your elasticsearch service)
2017-06-06 21:30:52 +00:00
```
2018-01-08 22:58:42 +00:00
sudo nano /etc/elasticsearch/jvm.options
sudo service elasticsearch restart
2017-06-06 21:30:52 +00:00
```
2018-01-08 22:58:42 +00:00
# Troubleshooting the HELK:
## HELK Installation Logs
* HELK Install Logs:
2018-01-08 22:58:42 +00:00
* /var/log/helk-install.log
* HELK Docker Logs:
2018-01-08 22:58:42 +00:00
```
sudo docker logs helk
```
## HELK Application Logs
* Elasticsearch:
* /var/log/elasticsearch/elasticsearch.log
* Logstash:
* /var/log/logstash/logstash-plain.log
* Kibana:
* /var/log/kibana/kibana.stdout
* /var/log/kibana/kibana.stderr
2017-06-06 21:30:52 +00:00
2017-06-29 15:21:59 +00:00
# Author
2018-01-08 22:58:42 +00:00
* Roberto Rodriguez [@Cyb3rWard0g](https://twitter.com/Cyb3rWard0g) [@THE_HELK](https://twitter.com/THE_HELK)
2017-05-26 06:11:09 +00:00
2017-06-29 15:21:59 +00:00
# Contributors
* Robby Winchester [@robwinchester3](https://twitter.com/robwinchester3)
2018-01-08 22:58:42 +00:00
* Nate Guagenti [@neu5ron](https://twitter.com/neu5ron)
* Jordan Potti [@ok_bye_now](https://twitter.com/ok_bye_now)
* esebese [esebese](https://github.com/esebese)
2017-06-29 15:21:59 +00:00
# Contributing
2018-01-08 22:58:42 +00:00
There are a few things that I would like to accomplish with the HELK as shown in the To-Do list below. I would love to make the HELK a stable build for everyone in the community. If you are interested on making this build a more robust one and adding some cool features to it, PLEASE feel free to submit a pull request. #SharingIsCaring
2017-06-29 15:21:59 +00:00
# TO-Do
2018-01-08 22:58:42 +00:00
- [X] Upload basic Kibana Dashboards
- [X] Integrate Spark & Graphframes
- [X] Add Jupyter Notebook on the top of Spark
- [ ] Kafka Integration
- [ ] Create Jupyter Notebooks showing how to use Spark & GraphFrames
- [ ] Enhance elasticsearch configuration to make it more scalable
- [ ] MITRE ATT&CK mapping to logs or dashboards
2018-01-08 22:58:42 +00:00
- [ ] Cypher for Apache Spark Integration (Might have to switch from Jupyter to Zeppelin Notebook)
- [ ] Somehow integrate neo4j spark connectors with build
- [ ] Install Elastalert
- [ ] Create Elastalert rules
2018-01-08 22:58:42 +00:00
- [ ] Nxlog parsers (Logstash Filters)
- [ ] Add more network data sources (i.e Bro)
More coming soon...
2017-04-14 05:29:04 +00:00