mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-10 03:02:58 +01:00
use global vars in states
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{%- if grains.role == 'so-heavynode' %}
|
||||
{%- set MANAGER = salt['grains.get']('host') %}
|
||||
{%- set HOST = GLOBALS.hostname %}
|
||||
{%- else %}
|
||||
{%- set MANAGER = salt['grains.get']('master') %}
|
||||
{%- set HOST = GLOBALS.manager %}
|
||||
{% endif -%}
|
||||
{%- set THREADS = salt['pillar.get']('logstash_settings:ls_input_threads', '') %}
|
||||
{%- set access_key = salt['pillar.get']('minio:access_key', '') %}
|
||||
@@ -11,7 +11,7 @@ input {
|
||||
s3 {
|
||||
access_key_id => "{{ access_key }}"
|
||||
secret_access_key => "{{ access_secret }}"
|
||||
endpoint => "https://{{ MANAGER }}:9595"
|
||||
endpoint => "https://{{ HOST }}:9595"
|
||||
bucket => "logstash"
|
||||
delete => true
|
||||
interval => {{ INTERVAL }}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "zeek" and "import" not in [tags] {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}.%{dataset}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-zeek"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if "import" in [tags] {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}.%{dataset}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-import"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "syslog" {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-syslog"
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if "filebeat" in [metadata][pipeline] {
|
||||
elasticsearch {
|
||||
id => "filebeat_modules_metadata_pipeline"
|
||||
pipeline => "%{[metadata][pipeline]}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-%{[event][module]}-%{+YYYY.MM.dd}"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "osquery" and "live_query" not in [dataset] {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}.%{dataset}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-osquery"
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [dataset] =~ "firewall" {
|
||||
elasticsearch {
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-firewall"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "suricata" and "import" not in [tags] {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}.%{dataset}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-ids"
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if "beat-ext" in [tags] and "import" not in [tags] and "filebeat" not in [metadata][pipeline] {
|
||||
if [metadata][_id] {
|
||||
elasticsearch {
|
||||
pipeline => "beats.common"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-beats"
|
||||
@@ -17,7 +14,7 @@ output {
|
||||
} else {
|
||||
elasticsearch {
|
||||
pipeline => "beats.common"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-beats"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "ossec" {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-ossec"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "strelka" {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}.%{dataset}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-strelka"
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
|
||||
output {
|
||||
if [module] =~ "logscan" {
|
||||
elasticsearch {
|
||||
id => "logscan_pipeline"
|
||||
pipeline => "logscan.alert"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-logscan"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if [module] =~ "rita" and "import" not in [tags] {
|
||||
elasticsearch {
|
||||
pipeline => "%{module}.%{dataset}"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "so-rita"
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
output {
|
||||
if "elastic-agent" in [tags] and "import" not in [tags] {
|
||||
elasticsearch {
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
ecs_compatibility => v8
|
||||
data_stream => true
|
||||
user => "{{ ES_USER }}"
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
{%- set ES = salt['grains.get']('master') -%}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
filter {
|
||||
if [event][module] =~ "endgame" {
|
||||
mutate {
|
||||
@@ -12,7 +9,7 @@ output {
|
||||
if [event][module] =~ "endgame" {
|
||||
elasticsearch {
|
||||
id => "endgame_es_output"
|
||||
hosts => "{{ ES }}"
|
||||
hosts => "{{ GLOBALS.manager }}"
|
||||
user => "{{ ES_USER }}"
|
||||
password => "{{ ES_PASS }}"
|
||||
index => "endgame-%{+YYYY.MM.dd}"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{%- if grains.role in ['so-heavynode', 'so-receiver'] %}
|
||||
{%- set HOST = salt['grains.get']('host') %}
|
||||
{%- set HOST = GLOBALS.hostname %}
|
||||
{%- else %}
|
||||
{%- set HOST = salt['grains.get']('master') %}
|
||||
{%- set HOST = GLOBALS.manager %}
|
||||
{%- endif %}
|
||||
{%- set BATCH = salt['pillar.get']('logstash_settings:ls_pipeline_batch_size', 125) %}
|
||||
output {
|
||||
|
||||
Reference in New Issue
Block a user