Skip to content

Commit

Permalink
v0.1.2-alpha08062018
Browse files Browse the repository at this point in the history
Updated Logstash output templates to replace _doc mappings to doc.
  • Loading branch information
Cyb3rWard0g committed Aug 7, 2018
1 parent 1b87af3 commit b9daa4c
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docker/docker-compose-elk-trial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
entrypoint: /usr/share/logstash/scripts/logstash-entrypoint.sh
restart: always
depends_on:
- helk-elasticsearch
- helk-kibana
networks:
helk:
aliases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"refresh_interval": "30s"
},
"mappings": {
"_doc": {
"doc": {
"dynamic": "true",
"dynamic_templates": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"refresh_interval": "30s"
},
"mappings": {
"_doc":{
"doc":{
"properties":{
"process_id":{"type":"integer"},
"event_id":{"type":"integer"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns" : "logs-endpoint-powershell-direct-*",
"version": 2018080101,
"mappings":{
"_doc":{
"doc":{
"properties":{
"process_id":{"type":"integer"}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-endpoint-winevent-application-*" ],
"version": 2018080101,
"mappings":{
"_doc":{
"doc":{
"properties":{
"spp_restart_scheduled":{"type":"date"}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-endpoint-winevent-powershell-*" ],
"version": 2018080201,
"mappings":{
"_doc": {
"doc": {
"properties": {
"powershell": {
"dynamic": "false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": "logs-endpoint-winevent-security-*",
"version": 2018080101,
"mappings":{
"_doc":{
"doc":{
"properties":{
"@date_new_time":{"type":"date"},
"@date_previous_time":{"type":"date"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"index.refresh_interval": "5s"
},
"mappings":{
"_doc":{
"doc":{
"properties":{
"@date_creation":{"type":"date"},
"@date_creation_previous":{"type":"date"},
Expand Down
2 changes: 1 addition & 1 deletion docker/helk-logstash/output_templates/82-logs-not-ip.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018080101,
"mappings": {
"_doc": {
"doc": {
"properties": {
"not_ip_dst": {
"type": "keyword"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018052301,
"mappings": {
"_doc": {
"doc": {
"properties": {
"dst_nat_ip_addr": {
"type": "ip",
Expand Down
2 changes: 1 addition & 1 deletion docker/helk-logstash/output_templates/91-logs-ip-dst.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018052301,
"mappings": {
"_doc": {
"doc": {
"properties": {
"dst_ip_addr": {
"type": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018052301,
"mappings": {
"_doc": {
"doc": {
"properties": {
"src_nat_ip_addr": {
"type": "ip",
Expand Down
2 changes: 1 addition & 1 deletion docker/helk-logstash/output_templates/91-logs-ip-src.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018052301,
"mappings": {
"_doc": {
"doc": {
"properties": {
"src_ip_addr": {
"type": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018080101,
"mappings": {
"_doc": {
"doc": {
"properties": {
"dst_nat_ipv6_addr": {
"type": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018080101,
"mappings": {
"_doc": {
"doc": {
"properties": {
"dst_ipv6_addr": {
"type": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018080101,
"mappings": {
"_doc": {
"doc": {
"properties": {
"ipv6_src_nat_addr": {
"type": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018080101,
"mappings": {
"_doc": {
"doc": {
"properties": {
"src_ipv6_addr": {
"type": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index_patterns": [ "logs-*" ],
"version": 2018080101,
"mappings": {
"_doc": {
"doc": {
"properties": {
"any_ip_addr": {
"type": "ip"
Expand Down
2 changes: 1 addition & 1 deletion docker/helk-logstash/scripts/logstash-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ do
done

# ********** Install Plugin *****************
echo "[HELK-DOCKER-INSTALLATION-INFO] Installing Logstsh plugins.."
echo "[HELK-DOCKER-INSTALLATION-INFO] Installing Logstash plugins.."
logstash-plugin install logstash-filter-prune

# ********** Starting Logstash *****************
Expand Down
21 changes: 15 additions & 6 deletions docker/helk-logstash/trial/scripts/logstash-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# HELK script: logstash-setup.sh
# HELK script: logstash-entrypoint.sh
# HELK script description: Pushes output templates to ES and starts Logstash
# HELK build Stage: Alpha
# Author: Roberto Rodriguez (@Cyb3rWard0g)
Expand All @@ -16,20 +16,29 @@ else
export LS_JAVA_OPTS="-Xms${LS_MEMORY}g -Xmx${LS_MEMORY}g"
fi

ELASTICSEARCH_ACCESS=http://elastic:"elasticpassword"@helk-elasticsearch:9200
# *********** Looking for ES ***************
ELASTICSEARCH_ACCESS=http://elastic:"elasticpassword"@helk-elasticsearch:9200
echo "[HELK-DOCKER-INSTALLATION-INFO] Waiting for elasticsearch URI to be accessible.."
until curl -s $ELASTICSEARCH_ACCESS -o /dev/null; do
sleep 1
done

echo "[HELK-DOCKER-INSTALLATION-INFO] Uploading templates to elasticsearch.."
DIR=/usr/share/logstash/output_templates
for file in ${DIR}/*.json
do
template_name=$(echo $file | sed -r ' s/^.*\/[0-9]+\-//');
curl -H 'Content-Type: application/json' -XPUT "$ELASTICSEARCH_ACCESS/_template/$template_name" -d@${file};
do
template_name=$(echo $file | sed -r ' s/^.*\/[0-9]+\-//');
echo "[HELK-DOCKER-INSTALLATION-INFO] Uploading $template_name template to elasticsearch..";
curl -s -H 'Content-Type: application/json' -XPUT $ELASTICSEARCH_ACCESS/_template/$template_name -d@${file};
sleep 1
done

exec "$@"
# ********** Install Plugin *****************
echo "[HELK-DOCKER-INSTALLATION-INFO] Installing Logstash plugins.."
logstash-plugin install logstash-filter-prune

# ********** Starting Logstash *****************
echo "[HELK-DOCKER-INSTALLATION-INFO] Running docker-entrypoint script.."
/usr/local/bin/docker-entrypoint


2 changes: 1 addition & 1 deletion docker/helk_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ show_banner(){
echo "** HELK - THE HUNTING ELK **"
echo "** **"
echo "** Author: Roberto Rodriguez (@Cyb3rWard0g) **"
echo "** HELK build version: v0.1.2-alpha08032018 **"
echo "** HELK build version: v0.1.2-alpha08062018 **"
echo "** HELK ELK version: 6.3.2 **"
echo "** License: GPL-3.0 **"
echo "**********************************************"
Expand Down

0 comments on commit b9daa4c

Please sign in to comment.