From b053f29a89aabf5cb98e621820cffc1184ce0c48 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 23 Aug 2021 12:58:52 -0400 Subject: [PATCH 1/4] only create dashboards for certain node types - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 --- salt/grafana/init.sls | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/salt/grafana/init.sls b/salt/grafana/init.sls index b74fa2495..eca1786cc 100644 --- a/salt/grafana/init.sls +++ b/salt/grafana/init.sls @@ -12,16 +12,21 @@ {% if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone'] or (grains.role == 'so-eval' and GRAFANA == 1) %} +{% set ALLOWED_DASHBOARDS = ['overview', 'standalone', 'manager', 'managersearch', 'sensor', 'searchnode', 'heavynode', 'eval'] %} {% set DASHBOARDS = ['overview'] %} {% if grains.role == 'so-eval' %} {% do DASHBOARDS.append('eval') %} {% else %} {# Grab a unique listing of nodetypes that exists so that we create only the needed dashboards #} {% for dashboard in salt['cmd.shell']("ls /opt/so/saltstack/local/pillar/minions/|awk -F'_' {'print $2'}|awk -F'.' {'print $1'}").split() %} - {% do DASHBOARDS.append(dashboard) %} + {% if dashboard id ALLOWED_DASHBOARDS %} + {% do DASHBOARDS.append(dashboard) %} + {% endif %} {% endfor %} {% endif %} + + # Grafana all the things grafanadir: file.directory: From a9cc68f89e82d9db7263f449188c5b07b4c37890 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 23 Aug 2021 13:02:49 -0400 Subject: [PATCH 2/4] add unique identifier for hotfix - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 --- HOTFIX | 1 + 1 file changed, 1 insertion(+) diff --git a/HOTFIX b/HOTFIX index 393a7e913..7e7c96536 100644 --- a/HOTFIX +++ b/HOTFIX @@ -1,2 +1,3 @@ CURATOR +GRAFANA_DASH_ALLOW From 80f4d0325487c033dcb587aeffae03b4b5711601 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 23 Aug 2021 13:05:28 -0400 Subject: [PATCH 3/4] place unique identifier on same line for hotfix - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 --- HOTFIX | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HOTFIX b/HOTFIX index 7e7c96536..100732042 100644 --- a/HOTFIX +++ b/HOTFIX @@ -1,3 +1,2 @@ -CURATOR -GRAFANA_DASH_ALLOW +CURATOR GRAFANA_DASH_ALLOW From f87cf123b065ba67365ca49cca679569e1abd9eb Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 23 Aug 2021 13:08:11 -0400 Subject: [PATCH 4/4] fix typo - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 --- salt/grafana/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/grafana/init.sls b/salt/grafana/init.sls index eca1786cc..42df29af4 100644 --- a/salt/grafana/init.sls +++ b/salt/grafana/init.sls @@ -19,7 +19,7 @@ {% else %} {# Grab a unique listing of nodetypes that exists so that we create only the needed dashboards #} {% for dashboard in salt['cmd.shell']("ls /opt/so/saltstack/local/pillar/minions/|awk -F'_' {'print $2'}|awk -F'.' {'print $1'}").split() %} - {% if dashboard id ALLOWED_DASHBOARDS %} + {% if dashboard in ALLOWED_DASHBOARDS %} {% do DASHBOARDS.append(dashboard) %} {% endif %} {% endfor %}