-
Notifications
You must be signed in to change notification settings - Fork 58
How to Install
wataru-takahashi edited this page Sep 20, 2018
·
3 revisions
1. Elasticsearch Setup
2. Kibana Setup
3. StixIoC Server Setup
4. Client Setup
- The following instruction is optimized for Linux (Ubuntu).
- SysmonSearch supports Elasticsearch and Kibana for versions v6.X.
- Please download Elasticsearch v6.X from this site, and extract it. This directry is referred to as $ES_HOME hereafter.
- Download Kibana v6.X from this site, and extract it. This directry is referred to as $KIBANA_HOME hereafter.
- Please clone SysmonSearch git repository.
$ git clone https://github.com/JPCERTCC/SysmonSearch.git
- Install OpenJDK:
$ sudo apt install default-jre
- Set virtual memory:
$ sudo sysctl -w vm.max_map_count=262144
- Modify Elasticsearch configuration to allow remote access:
$ vi $ES_HOME/config/elasticsearch.yml
modify the line as follows:
network.host: 0
- Start Elasticsearch:
$ ./$ES_HOME/bin/elasticsearch
- Install OpenJDK and pip:
$ sudo apt install default-jre
$ sudo apt install python-pip
- Install Elasticsearch python module:
$ pip install elasticsearch
$ sudo pip install elasticsearch_dsl
- Modify Kibana configuration:
$ vi $KIBANA_HOME/config/kibana.yml
modify the line as follows:
server.host: "[Kibana IP address]"
elasticsearch.url: "http://[Elasticserach IP address]:9200"
- Start Kinaba:
$ ./$KIBANA_HOME/bin/kibana
- Execute the following commands to load the templates:
$ curl -XPUT http://[Elasticsearch IP address]:9200/_template/template1 -d@SysmonSearch/script/template1.json -H "Content-Type: application/json"
$ curl -XPUT http://[Elasticsearch IP address]:9200/_template/template2 -d@SysmonSearch/script/template2.json -H "Content-Type: application/json"
$ curl -XPUT http://[Elasticsearch IP address]:9200/_template/template3 -d@SysmonSearch/script/template3.json -H "Content-Type: application/json"
- Move to
script/
directory, and create thelogs
sub-directory:
$ cd SysmonSearch/script/
$ mkdir logs
- Modify Statistical script configuration:
$ vi exec_collection_statistical_data.sh
modify the line as follows:
export JPCERT_HOME=[absolute path of script directory]
$ vi collection_statistical_data_setting.py
modify the line as follows:
ELASTICSEARCH_SERVER = "[Elasticserach IP address]"
- Modify Alert script configuration:
$ vi collection_alert_data_setting.py
modify the line as follows:
ELASTICSEARCH_SERVER = "[Elasticserach IP address]"
RULE_FILE_DIRECTORY = "[absolute path of script directory]/rule_files/*"
- Add following to crontab:
0,30 * * * * sh [absolute path of script directory]/exec_collection_statistical_data.sh
0,30 * * * * python [absolute path of script directory]/collection_alert_data.py
0 1 * * * DATE=`date -d "-1 day" "+%Y.%m.%d"` ; sh [absolute path of script directory]/exec_collection_statistical_data.sh $DATE
- Modify
sysmon_search_plugin
configuration:
$ vi sysmon_search_plugin/conf.js
modify the line as follows:
//elasticsearch server URL
"elasticsearch_url":"[Elasticsearch IP address]"
//elasticsearch server Port
"elasticsearch_port": "9200",
//monitor rule file path
"savepath": "[absolute path of script directory]/rule_files",
//stixioc import server URL
"import_server_url": "stixioc-import-server",
//stixioc server port
"import_server_port": "56020",
//internal time (hour)
"refine_time_range": "1",
//maximum object number
"max_object_num": "30"
- Copy
sysmon_search_plugin/
directory to$KIBANA_HOME/plugins
, delete files under$KIBANA_HOME/optimize
directory:
$ cp -r sysmon_search_plugin/ $KIBANA_HOME/plugin/
$ rm -rf $KIBANA_HOME/optimize/*
- Restart Kibana.
- Execute the following command to install pip:
$ sudo apt install python-pip
- Execute the following command to install python module:
$ sudo pip install tornado
$ sudo pip install openioc-to-stix
$ sudo pip install git+https://github.com/oasis-open/cti-stix-slider.git
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper
- Add nessesary environment variable:
$ vi ~/.bashrc
add to the line as follows:
source /usr/local/bin/virtualenvwrapper.sh
export WORKON_HOME=~/.virtualenvs
Reload:
$ bash
- Move to
stixioc-import-server
directory:
$ cd SysmonSearch/stixioc-import-server/
- Create the
logs
directory:
$ mkdir logs
- Start stixioc-import-server:
$ virtualenv .env
$ source .env/bin/activate
$ python server.py
Download URL (Sysmon)
Please reffer to the instruction on the Sysmon web site, and install it.
Download URL(Winlogbeat)
Please check the Winlogbeat web site and install Winlogbeat.
Specify Elasticsearch IP address:
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["Elasticserach IP address:9200"]
Sysmon's event logs to monitor:
winlogbeat.event_logs:
- name: "Microsoft-Windows-Sysmon/Operational"
ignore_older: 72h
Disable automatic template loading:
setup.template.enabled: false
Change the index name:
output.elasticsearch.index: "winlogbeat-%{+yyyy.MM.dd}"