mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
encrypt kibana saved objects - https://github.com/Security-Onion-Solutions/securityonion/issues/6146
This commit is contained in:
@@ -24,6 +24,9 @@ base:
|
|||||||
- data.*
|
- data.*
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- secrets
|
- secrets
|
||||||
- global
|
- global
|
||||||
@@ -43,6 +46,9 @@ base:
|
|||||||
- elasticsearch.eval
|
- elasticsearch.eval
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- global
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
@@ -54,6 +60,9 @@ base:
|
|||||||
- elasticsearch.search
|
- elasticsearch.search
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- data.*
|
- data.*
|
||||||
- zeeklogs
|
- zeeklogs
|
||||||
|
|||||||
@@ -30,4 +30,5 @@ kibana:
|
|||||||
xpack:
|
xpack:
|
||||||
ml:
|
ml:
|
||||||
enabled: False
|
enabled: False
|
||||||
|
encryptedSavedObjects:
|
||||||
|
encryptionKey: {{ pillar['kibana']['secrets']['encryptedSavedObjects']['encryptionKey'] }}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
---
|
|
||||||
# Default Kibana configuration from kibana-docker.
|
|
||||||
{%- set ES = salt['pillar.get']('manager:mainip', '') -%}
|
|
||||||
{%- 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', '') %}
|
|
||||||
{%- set URLBASE = salt['pillar.get']('global:url_base') %}
|
|
||||||
server.name: kibana
|
|
||||||
server.host: "0"
|
|
||||||
server.basePath: /kibana
|
|
||||||
server.publicBaseUrl: https://{{ URLBASE }}/kibana
|
|
||||||
elasticsearch.hosts: [ "https://{{ ES }}:9200" ]
|
|
||||||
elasticsearch.ssl.verificationMode: none
|
|
||||||
#kibana.index: ".kibana"
|
|
||||||
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
|
|
||||||
elasticsearch.username: {{ ES_USER }}
|
|
||||||
elasticsearch.password: {{ ES_PASS }}
|
|
||||||
{% endif %}
|
|
||||||
#xpack.monitoring.ui.container.elasticsearch.enabled: true
|
|
||||||
elasticsearch.requestTimeout: 90000
|
|
||||||
logging.dest: /var/log/kibana/kibana.log
|
|
||||||
telemetry.enabled: false
|
|
||||||
security.showInsecureClusterWarning: false
|
|
||||||
{% if not salt['pillar.get']('elasticsearch:auth:enabled', False) %}
|
|
||||||
xpack.security.authc.providers:
|
|
||||||
anonymous.anonymous1:
|
|
||||||
order: 0
|
|
||||||
credentials: "elasticsearch_anonymous_user"
|
|
||||||
{% endif %}
|
|
||||||
@@ -101,14 +101,6 @@ append_so-kibana_so-status.conf:
|
|||||||
- name: /opt/so/conf/so-status/so-status.conf
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
- text: so-kibana
|
- text: so-kibana
|
||||||
|
|
||||||
# Keep the setting correct
|
|
||||||
#KibanaHappy:
|
|
||||||
# cmd.script:
|
|
||||||
# - shell: /bin/bash
|
|
||||||
# - runas: socore
|
|
||||||
# - source: salt://kibana/bin/keepkibanahappy.sh
|
|
||||||
# - template: jinja
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{{sls}}_state_not_allowed:
|
{{sls}}_state_not_allowed:
|
||||||
|
|||||||
12
salt/kibana/secrets.sls
Normal file
12
salt/kibana/secrets.sls
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{% set kibana_encryptedSavedObjects_encryptionKey = salt['pillar.get']('kibana:secrets:encryptedSavedObjects:encryptionKey', salt['random.get_str'](72)) %}
|
||||||
|
|
||||||
|
kibana_secrets_pillar:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/saltstack/local/pillar/kibana/secrets.sls
|
||||||
|
- mode: 600
|
||||||
|
- reload_pillar: True
|
||||||
|
- contents: |
|
||||||
|
kibana:
|
||||||
|
secrets:
|
||||||
|
encryptedSavedObjects:
|
||||||
|
encryptionKey: {{ kibana_encryptedSavedObjects_encryptionKey }}
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
include:
|
include:
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
|
- kibana.secrets
|
||||||
- salt.minion
|
- salt.minion
|
||||||
|
|
||||||
socore_own_saltstack:
|
socore_own_saltstack:
|
||||||
|
|||||||
Reference in New Issue
Block a user