Browse Source

separate es

merge-requests/75/head
Steven Foerster 5 years ago
parent
commit
35e27d5676
  1. 5
      extra/wazuh.yml
  2. 1
      scripts/services/Mistborn-wazuh.service
  3. 17
      scripts/services/wazuh/files/internal_users.yml
  4. 16
      scripts/services/wazuh/init.sh

5
extra/wazuh.yml

@ -73,11 +73,6 @@ services:
- SERVER_SSL_KEY=/usr/share/kibana/config/opendistroforelasticsearch.example.org.key - SERVER_SSL_KEY=/usr/share/kibana/config/opendistroforelasticsearch.example.org.key
env_file: env_file:
- ../.envs/.production/.wazuh - ../.envs/.production/.wazuh
depends_on:
- wazuh-elasticsearch
#links:
# - wazuh-elasticsearch:elasticsearch
# - wazuh:wazuh
volumes: volumes:
ossec_api_configuration: ossec_api_configuration:

1
scripts/services/Mistborn-wazuh.service

@ -11,7 +11,6 @@ User=root
Group=docker Group=docker
PermissionsStartOnly=true PermissionsStartOnly=true
# Shutdown container (if running) when unit is stopped # Shutdown container (if running) when unit is stopped
ExecStartPre=/usr/sbin/sysctl -w vm.max_map_count=262144
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml down ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml down
# Start container when unit is started # Start container when unit is started
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml up --build ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml up --build

17
scripts/services/wazuh/files/internal_users.yml

@ -1,17 +0,0 @@
---
# This is the internal user database
# The hash value is a bcrypt hash and can be generated with plugin/tools/hash.sh
_meta:
type: "internalusers"
config_version: 2
# Define your internal users here
mistborn:
hash: "__MISTBORN_HASH__"
reserved: true
backend_roles:
- "admin"
description: "Mistborn user"

16
scripts/services/wazuh/init.sh

@ -1,16 +0,0 @@
#!/bin/bash
set -e
if [[ -f "/opt/mistborn_volumes/extra/wazuh/init/internal_users.yml" ]]; then
echo "internal_users.yml exists. Proceeding."
exit 0
fi
mkdir -p /opt/mistborn_volumes/extra/wazuh/init/ >/dev/null 2>&1
chmod -R +x /opt/mistborn_volumes/extra/wazuh/init/
cp /opt/mistborn/scripts/services/wazuh/files/internal_users.yml /opt/mistborn_volumes/extra/wazuh/init/
WAZUH_MISTBORN_HASHED=$(docker run --rm amazon/opendistro-for-elasticsearch:1.12.0 bash /usr/share/elasticsearch/plugins/opendistro_security/tools/hash.sh -p ${MISTBORN_DEFAULT_PASSWORD} | tr -d '\n')
sed -i "s|__MISTBORN_HASH__|${WAZUH_MISTBORN_HASHED}|" /opt/mistborn_volumes/extra/wazuh/init/internal_users.yml
Loading…
Cancel
Save