This commit is contained in:
m0duspwnens
2020-03-17 11:28:43 -04:00
24 changed files with 28 additions and 26 deletions

View File

@@ -80,7 +80,7 @@
logfile = "/var/log/telegraf/telegraf.log" logfile = "/var/log/telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname() ## Override default hostname, if empty use os.Hostname()
hostname = "{{ grains.id }}" hostname = "{{ grains.host }}"
## If set to true, do no set the "host" tag in the telegraf agent. ## If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = false omit_hostname = false

View File

@@ -39,7 +39,7 @@
{ "rename": { "field": "dataset", "target_field": "event.dataset", "ignore_missing": true } }, { "rename": { "field": "dataset", "target_field": "event.dataset", "ignore_missing": true } },
{ {
"remove": { "remove": {
"field": [ "index_name_prefix", "beat"], "field": [ "index_name_prefix"],
"ignore_failure": false "ignore_failure": false
} }
} }

View File

@@ -2,6 +2,7 @@
"description" : "ossec", "description" : "ossec",
"processors" : [ "processors" : [
{ "json": { "field": "message", "target_field": "message2", "ignore_failure": true } }, { "json": { "field": "message", "target_field": "message2", "ignore_failure": true } },
{ "remove": { "field": [ "agent" ], "ignore_missing": true, "ignore_failure": false } },
{ "rename": { "field": "message2.agent", "target_field": "agent", "ignore_missing": true } }, { "rename": { "field": "message2.agent", "target_field": "agent", "ignore_missing": true } },
{ "rename": { "field": "message2.data", "target_field": "data", "ignore_missing": true } }, { "rename": { "field": "message2.data", "target_field": "data", "ignore_missing": true } },
{ "rename": { "field": "message2.decoder", "target_field": "decoder", "ignore_missing": true } }, { "rename": { "field": "message2.decoder", "target_field": "decoder", "ignore_missing": true } },

View File

@@ -6,7 +6,7 @@
{ "rename": { "field": "message2.scan", "target_field": "scan", "ignore_missing": true } }, { "rename": { "field": "message2.scan", "target_field": "scan", "ignore_missing": true } },
{ "rename": { "field": "message2.request", "target_field": "request", "ignore_missing": true } }, { "rename": { "field": "message2.request", "target_field": "request", "ignore_missing": true } },
{ "rename": { "field": "scan.hash", "target_field": "file.hash", "ignore_missing": true } }, { "rename": { "field": "scan.hash", "target_field": "file.hash", "ignore_missing": true } },
{ "remove": { "field": ["host", "path"], "ignore_missing": true } }, { "remove": { "field": ["host", "path", "agent"], "ignore_missing": true } },
{ "pipeline": { "name": "common" } } { "pipeline": { "name": "common" } }
] ]
} }

View File

@@ -8,7 +8,7 @@
{ "rename":{ "field": "message2.src_port", "target_field": "source.port", "ignore_failure": true } }, { "rename":{ "field": "message2.src_port", "target_field": "source.port", "ignore_failure": true } },
{ "rename":{ "field": "message2.dest_ip", "target_field": "destination.ip", "ignore_failure": true } }, { "rename":{ "field": "message2.dest_ip", "target_field": "destination.ip", "ignore_failure": true } },
{ "rename":{ "field": "message2.dest_port", "target_field": "destination.port", "ignore_failure": true } }, { "rename":{ "field": "message2.dest_port", "target_field": "destination.port", "ignore_failure": true } },
{ "remove": { "field": ["message2"], "ignore_failure": true } }, { "remove": { "field": ["message2", "agent"], "ignore_failure": true } },
{ "pipeline": { "name": "common" } } { "pipeline": { "name": "common" } }
] ]
} }

View File

@@ -16,7 +16,7 @@
{ "rename": { "field": "message2.id.resp_p", "target_field": "destination.port", "ignore_missing": true } }, { "rename": { "field": "message2.id.resp_p", "target_field": "destination.port", "ignore_missing": true } },
{ "set": { "field": "server.port", "value": "{{destination.port}}" } }, { "set": { "field": "server.port", "value": "{{destination.port}}" } },
{ "date": { "field": "message2.ts", "target_field": "@timestamp", "formats": ["ISO8601", "UNIX"], "ignore_failure": true } }, { "date": { "field": "message2.ts", "target_field": "@timestamp", "formats": ["ISO8601", "UNIX"], "ignore_failure": true } },
{ "remove": { "field": ["message2.ts", "path"], "ignore_failure": true } }, { "remove": { "field": ["message2.ts", "path", "agent"], "ignore_failure": true } },
{ "pipeline": { "name": "common" } } { "pipeline": { "name": "common" } }
] ]
} }

View File

@@ -114,11 +114,12 @@ so-elasticsearch:
- name: so-elasticsearch - name: so-elasticsearch
- user: elasticsearch - user: elasticsearch
- environment: - environment:
- bootstrap.memory_lock=true - discovery.type=single-node
- cluster.name={{ esclustername }} #- bootstrap.memory_lock=true
#- cluster.name={{ esclustername }}
- ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }} - ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }}
- http.host=0.0.0.0 #- http.host=0.0.0.0
- transport.host=127.0.0.1 #- transport.host=127.0.0.1
- ulimits: - ulimits:
- memlock=-1:-1 - memlock=-1:-1
- nofile=65536:65536 - nofile=65536:65536

View File

@@ -71,7 +71,7 @@ filebeat.modules:
#=========================== Filebeat prospectors ============================= #=========================== Filebeat prospectors =============================
# List of prospectors to fetch data. # List of prospectors to fetch data.
filebeat.prospectors: filebeat.inputs:
#------------------------------ Log prospector -------------------------------- #------------------------------ Log prospector --------------------------------
{%- if grains['role'] == 'so-sensor' or grains['role'] == "so-eval" or grains['role'] == "so-helix" or grains['role'] == "so-heavynode" %} {%- if grains['role'] == 'so-sensor' or grains['role'] == "so-eval" or grains['role'] == "so-helix" or grains['role'] == "so-heavynode" %}
{%- if BROVER != 'SURICATA' %} {%- if BROVER != 'SURICATA' %}

View File

@@ -21,7 +21,7 @@ output {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-switch-%{+YYYY.MM.dd}" index => "so-switch-%{+YYYY.MM.dd}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -20,7 +20,7 @@ output {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-import-%{+YYYY.MM.dd}" index => "so-import-%{+YYYY.MM.dd}"
template_name => "logstash" template_name => "logstash"
template => "/so-template.json" template => "/so-common-template.json"
template_overwrite => true template_overwrite => true
} }
} }

View File

@@ -21,7 +21,7 @@ output {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-flow-%{+YYYY.MM.dd}" index => "so-flow-%{+YYYY.MM.dd}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -20,7 +20,7 @@ output {
#stdout { codec => rubydebug } #stdout { codec => rubydebug }
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -19,7 +19,7 @@ output {
if [event_type] == "esxi" and "test_data" not in [tags] { if [event_type] == "esxi" and "test_data" not in [tags] {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -19,7 +19,7 @@ output {
if [event_type] == "greensql" and "test_data" not in [tags] { if [event_type] == "greensql" and "test_data" not in [tags] {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -20,7 +20,7 @@ output {
#stdout { codec => rubydebug } #stdout { codec => rubydebug }
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -20,7 +20,7 @@ output {
#stdout { codec => rubydebug } #stdout { codec => rubydebug }
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -22,7 +22,7 @@ output {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-ids-%{+YYYY.MM.dd}" index => "so-ids-%{+YYYY.MM.dd}"
template_name => "logstash" template_name => "logstash"
template => "/so-template.json" template => "/so-common-template.json"
template_overwrite => true template_overwrite => true
} }
} }

View File

@@ -21,7 +21,7 @@ output {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-syslog-%{+YYYY.MM.dd}" index => "so-syslog-%{+YYYY.MM.dd}"
template_name => "logstash" template_name => "logstash"
template => "/so-template.json" template => "/so-common-template.json"
template_overwrite => true template_overwrite => true
} }
} }

View File

@@ -13,7 +13,7 @@ output {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-osquery-%{+YYYY.MM.dd}" index => "so-osquery-%{+YYYY.MM.dd}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -22,7 +22,7 @@ output {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-firewall-%{+YYYY.MM.dd}" index => "so-firewall-%{+YYYY.MM.dd}"
template_name => "logstash" template_name => "logstash"
template => "/so-template.json" template => "/so-common-template.json"
template_overwrite => true template_overwrite => true
} }
} }

View File

@@ -21,7 +21,7 @@ output {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-windows-%{+YYYY.MM.dd}" index => "so-windows-%{+YYYY.MM.dd}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -21,7 +21,7 @@ output {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-%{+YYYY.MM.dd}" index => "so-%{+YYYY.MM.dd}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -21,7 +21,7 @@ output {
elasticsearch { elasticsearch {
hosts => "{{ ES }}" hosts => "{{ ES }}"
index => "so-ids-%{+YYYY.MM.dd}" index => "so-ids-%{+YYYY.MM.dd}"
template => "/so-template.json" template => "/so-common-template.json"
} }
} }
} }

View File

@@ -28,4 +28,4 @@ fi
echo "Applying cross cluster search config..." echo "Applying cross cluster search config..."
curl -s -XPUT http://{{ ES }}:9200/_cluster/settings \ curl -s -XPUT http://{{ ES }}:9200/_cluster/settings \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{\"persistent\": {\"search\": {\"remote\": {\"{{ grains.id }}\": {\"seeds\": [\"127.0.0.1:9300\"]}}}}}" -d "{\"persistent\": {\"search\": {\"remote\": {\"{{ grains.host }}\": {\"seeds\": [\"127.0.0.1:9300\"]}}}}}"