Browse Source

refactor

merge-requests/75/head
Steven Foerster 5 years ago
parent
commit
04c715c501
  1. 25
      extra/elasticsearch.yml
  2. 25
      extra/wazuh.yml
  3. 6
      scripts/services/Mistborn-elasticsearch.service
  4. 2
      scripts/services/wazuh/agent.sh
  5. 3
      scripts/services/wazuh/agent_start.sh
  6. 3
      scripts/services/wazuh/agent_stop.sh

25
extra/elasticsearch.yml

@ -23,31 +23,6 @@ services:
nofile: nofile:
soft: 65536 soft: 65536
hard: 65536 hard: 65536
wazuh-kibana:
image: wazuh/wazuh-kibana-odfe:4.1.2
hostname: wazuh-kibana
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.wazuhk-http.rule=Host(`wazuh.mistborn`)"
- "traefik.http.routers.wazuhk-http.entrypoints=web"
- "traefik.http.routers.wazuhk-http.middlewares=mistborn_auth@file"
- "traefik.http.routers.wazuhk-https.rule=Host(`wazuh.mistborn`)"
- "traefik.http.routers.wazuhk-https.entrypoints=websecure"
- "traefik.http.routers.wazuhk-https.middlewares=mistborn_auth@file"
- "traefik.http.routers.wazuhk-https.tls.certresolver=basic"
- "traefik.http.services.wazuhk-service.loadbalancer.server.port=5601"
#ports:
# - "${MISTBORN_BIND_IP}:5601:5601"
depends_on:
- wazuh-elasticsearch
environment:
- SERVER_SSL_ENABLED=false
- SERVER_SSL_CERTIFICATE=/usr/share/kibana/config/opendistroforelasticsearch.example.org.cert
- SERVER_SSL_KEY=/usr/share/kibana/config/opendistroforelasticsearch.example.org.key
env_file:
- ../.envs/.production/.wazuh
networks: networks:
default: default:

25
extra/wazuh.yml

@ -28,6 +28,31 @@ services:
- filebeat_etc:/etc/filebeat - filebeat_etc:/etc/filebeat
- filebeat_var:/var/lib/filebeat - filebeat_var:/var/lib/filebeat
wazuh-kibana:
image: wazuh/wazuh-kibana-odfe:4.1.2
hostname: wazuh-kibana
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.wazuhk-http.rule=Host(`wazuh.mistborn`)"
- "traefik.http.routers.wazuhk-http.entrypoints=web"
- "traefik.http.routers.wazuhk-http.middlewares=mistborn_auth@file"
- "traefik.http.routers.wazuhk-https.rule=Host(`wazuh.mistborn`)"
- "traefik.http.routers.wazuhk-https.entrypoints=websecure"
- "traefik.http.routers.wazuhk-https.middlewares=mistborn_auth@file"
- "traefik.http.routers.wazuhk-https.tls.certresolver=basic"
- "traefik.http.services.wazuhk-service.loadbalancer.server.port=5601"
#ports:
# - "${MISTBORN_BIND_IP}:5601:5601"
depends_on:
- wazuh-elasticsearch
environment:
- SERVER_SSL_ENABLED=false
- SERVER_SSL_CERTIFICATE=/usr/share/kibana/config/opendistroforelasticsearch.example.org.cert
- SERVER_SSL_KEY=/usr/share/kibana/config/opendistroforelasticsearch.example.org.key
env_file:
- ../.envs/.production/.wazuh
volumes: volumes:
ossec_api_configuration: ossec_api_configuration:
ossec_etc: ossec_etc:

6
scripts/services/Mistborn-elasticsearch.service

@ -12,11 +12,11 @@ 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=/usr/sbin/sysctl -w vm.max_map_count=262144
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh elasticsearch,wazuh docker-compose -f /opt/mistborn/extra/elasticsearch.yml down ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh elasticsearch docker-compose -f /opt/mistborn/extra/elasticsearch.yml down
# Start container when unit is started # Start container when unit is started
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh elasticsearch,wazuh docker-compose -f /opt/mistborn/extra/elasticsearch.yml up --build ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh elasticsearch docker-compose -f /opt/mistborn/extra/elasticsearch.yml up --build
# Stop container when unit is stopped # Stop container when unit is stopped
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh elasticsearch,wazuh docker-compose -f /opt/mistborn/extra/elasticsearch.yml down ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh elasticsearch docker-compose -f /opt/mistborn/extra/elasticsearch.yml down
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

2
scripts/services/wazuh/agent.sh

@ -24,5 +24,3 @@ done
echo "Installing Wazuh agent" echo "Installing Wazuh agent"
WAZUH_MANAGER="10.2.3.1" apt-get install wazuh-agent WAZUH_MANAGER="10.2.3.1" apt-get install wazuh-agent
systemctl enable wazuh-agent
systemctl start wazuh-agent

3
scripts/services/wazuh/agent_start.sh

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
systemctl stop wazuh-agent systemctl start wazuh-agent
systemctl enable wazuh-agent

3
scripts/services/wazuh/agent_stop.sh

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
systemctl start wazuh-agent systemctl stop wazuh-agent
systemctl disable wazuh-agent

Loading…
Cancel
Save