forked from wazuh/wazuh-docker
Refactoring to new Elastic Stack versions.
This commit is contained in:
+20
-6
@@ -35,16 +35,30 @@ services:
|
|||||||
- elasticsearch
|
- elasticsearch
|
||||||
environment:
|
environment:
|
||||||
- LS_HEAP_SIZE=2048m
|
- LS_HEAP_SIZE=2048m
|
||||||
|
- XPACK_MONITORING_ENABLED=false
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
image: elasticsearch:5.5.2
|
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.4
|
||||||
hostname: elasticsearch
|
hostname: elasticsearch
|
||||||
restart: always
|
restart: always
|
||||||
command: elasticsearch -E node.name="node-1" -E cluster.name="wazuh" -E network.host=0.0.0.0
|
|
||||||
ports:
|
ports:
|
||||||
- "9200:9200"
|
- "9200:9200"
|
||||||
- "9300:9300"
|
# - "9300:9300"
|
||||||
environment:
|
environment:
|
||||||
ES_JAVA_OPTS: "-Xms2g -Xmx2g"
|
- node.name=node-1
|
||||||
|
- cluster.name=wazuh
|
||||||
|
- network.host=0.0.0.0
|
||||||
|
- bootstrap.memory_lock=true
|
||||||
|
- xpack.security.enabled=false
|
||||||
|
- xpack.monitoring.enabled=false
|
||||||
|
- xpack.ml.enabled=false
|
||||||
|
- xpack.watcher.enabled=false
|
||||||
|
- xpack.graph.enabled=false
|
||||||
|
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||||
|
ulimits:
|
||||||
|
memlock:
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
|
mem_limit: 2g
|
||||||
# volumes:
|
# volumes:
|
||||||
# - my-path:/usr/share/elasticsearch/data
|
# - my-path:/usr/share/elasticsearch/data
|
||||||
networks:
|
networks:
|
||||||
@@ -62,14 +76,14 @@ services:
|
|||||||
links:
|
links:
|
||||||
- elasticsearch:elasticsearch
|
- elasticsearch:elasticsearch
|
||||||
- wazuh
|
- wazuh
|
||||||
entrypoint: sh wait-for-it.sh elasticsearch
|
entrypoint: /wait-for-it.sh elasticsearch
|
||||||
# environment:
|
# environment:
|
||||||
# - "WAZUH_KIBANA_PLUGIN_URL=http://your.repo/wazuhapp-2.1.0-5.5.1.zip"
|
# - "WAZUH_KIBANA_PLUGIN_URL=http://your.repo/wazuhapp-2.1.0-5.5.1.zip"
|
||||||
nginx:
|
nginx:
|
||||||
image: wazuh/wazuh-nginx
|
image: wazuh/wazuh-nginx
|
||||||
hostname: nginx
|
hostname: nginx
|
||||||
restart: always
|
restart: always
|
||||||
entrypoint: sh run.sh
|
entrypoint: /run.sh
|
||||||
environment:
|
environment:
|
||||||
- NGINX_PORT=443
|
- NGINX_PORT=443
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
+6
-4
@@ -1,7 +1,9 @@
|
|||||||
FROM kibana:5.5.2
|
FROM docker.elastic.co/kibana/kibana:5.6.4
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl
|
USER root
|
||||||
|
|
||||||
COPY ./config/kibana.yml /opt/kibana/config/kibana.yml
|
COPY ./config/kibana.yml /usr/share/kibana/config/kibana.yml
|
||||||
|
|
||||||
COPY config/wait-for-it.sh /
|
COPY config/wait-for-it.sh /wait-for-it.sh
|
||||||
|
|
||||||
|
RUN chmod 755 /wait-for-it.sh
|
||||||
|
|||||||
@@ -90,3 +90,10 @@ logging.quiet: true
|
|||||||
# Set the interval in milliseconds to sample system and process performance
|
# Set the interval in milliseconds to sample system and process performance
|
||||||
# metrics. Minimum is 100ms. Defaults to 10000.
|
# metrics. Minimum is 100ms. Defaults to 10000.
|
||||||
# ops.interval: 10000
|
# ops.interval: 10000
|
||||||
|
|
||||||
|
xpack.security.enabled: false
|
||||||
|
xpack.grokdebugger.enabled: false
|
||||||
|
xpack.graph.enabled: false
|
||||||
|
xpack.ml.enabled: false
|
||||||
|
xpack.monitoring.enabled: false
|
||||||
|
xpack.reporting.enabled: false
|
||||||
@@ -5,15 +5,13 @@ set -e
|
|||||||
host="$1"
|
host="$1"
|
||||||
shift
|
shift
|
||||||
cmd="kibana"
|
cmd="kibana"
|
||||||
WAZUH_KIBANA_PLUGIN_URL=${WAZUH_KIBANA_PLUGIN_URL:-https://packages.wazuh.com/wazuhapp/wazuhapp-2.1.0_5.5.2.zip}
|
WAZUH_KIBANA_PLUGIN_URL=${WAZUH_KIBANA_PLUGIN_URL:-https://packages.wazuh.com/wazuhapp/wazuhapp-2.1.1_5.6.4.zip}
|
||||||
|
|
||||||
until curl -XGET $host:9200; do
|
until curl -XGET $host:9200; do
|
||||||
>&2 echo "Elastic is unavailable - sleeping"
|
>&2 echo "Elastic is unavailable - sleeping"
|
||||||
sleep 1
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 30
|
|
||||||
|
|
||||||
>&2 echo "Elastic is up - executing command"
|
>&2 echo "Elastic is up - executing command"
|
||||||
|
|
||||||
if /usr/share/kibana/bin/kibana-plugin list | grep wazuh; then
|
if /usr/share/kibana/bin/kibana-plugin list | grep wazuh; then
|
||||||
@@ -26,9 +24,7 @@ sleep 30
|
|||||||
|
|
||||||
echo "Configuring defaultIndex to wazuh-alerts-*"
|
echo "Configuring defaultIndex to wazuh-alerts-*"
|
||||||
|
|
||||||
curl -s -XPUT http://$host:9200/.kibana/config/5.5.2 -H 'Content-Type: application/json' -d '{"defaultIndex" : "wazuh-alerts-*"}' > /dev/null
|
curl -s -XPUT http://$host:9200/.kibana/config/5.6.4 -H 'Content-Type: application/json' -d '{"defaultIndex" : "wazuh-alerts-*"}' > /dev/null
|
||||||
|
|
||||||
sleep 30
|
|
||||||
|
|
||||||
echo "Setting API credentials into Wazuh APP"
|
echo "Setting API credentials into Wazuh APP"
|
||||||
|
|
||||||
@@ -38,7 +34,7 @@ if [ "x$CONFIG_CODE" = "x404" ]; then
|
|||||||
{
|
{
|
||||||
"api_user": "foo",
|
"api_user": "foo",
|
||||||
"api_password": "YmFy",
|
"api_password": "YmFy",
|
||||||
"url": "http://wazuh",
|
"url": "https://wazuh",
|
||||||
"api_port": "55000",
|
"api_port": "55000",
|
||||||
"insecure": "true",
|
"insecure": "true",
|
||||||
"component": "API",
|
"component": "API",
|
||||||
@@ -55,4 +51,6 @@ else
|
|||||||
echo "Wazuh APP already configured"
|
echo "Wazuh APP already configured"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
|
||||||
exec $cmd
|
exec $cmd
|
||||||
|
|||||||
+1
-9
@@ -1,12 +1,4 @@
|
|||||||
FROM logstash:5.5.2
|
FROM docker.elastic.co/logstash/logstash:5.6.4
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
|
|
||||||
COPY config/logstash.conf /etc/logstash/conf.d/logstash.conf
|
COPY config/logstash.conf /etc/logstash/conf.d/logstash.conf
|
||||||
COPY config/wazuh-elastic5-template.json /etc/logstash/wazuh-elastic5-template.json
|
COPY config/wazuh-elastic5-template.json /etc/logstash/wazuh-elastic5-template.json
|
||||||
|
|
||||||
|
|
||||||
ADD config/run.sh /tmp/run.sh
|
|
||||||
RUN chmod 755 /tmp/run.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/tmp/run.sh"]
|
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ FROM nginx:latest
|
|||||||
RUN apt-get update && apt-get install -y openssl apache2-utils
|
RUN apt-get update && apt-get install -y openssl apache2-utils
|
||||||
|
|
||||||
COPY ./config/run.sh /run.sh
|
COPY ./config/run.sh /run.sh
|
||||||
|
|
||||||
|
RUN chmod 755 /run.sh
|
||||||
|
|||||||
+4
-3
@@ -1,15 +1,15 @@
|
|||||||
FROM centos:latest
|
FROM centos:latest
|
||||||
ARG FILEBEAT_VERSION=5.5.2
|
ARG FILEBEAT_VERSION=5.6.4
|
||||||
COPY config/*.repo /etc/yum.repos.d/
|
COPY config/*.repo /etc/yum.repos.d/
|
||||||
|
|
||||||
RUN yum -y update; yum clean all;
|
RUN yum -y update; yum clean all;
|
||||||
RUN yum -y install epel-release openssl useradd; yum clean all
|
RUN yum -y install epel-release openssl useradd which; yum clean all
|
||||||
RUN yum -y install postfix mailx cyrus-sasl cyrus-sasl-plain; yum clean all
|
RUN yum -y install postfix mailx cyrus-sasl cyrus-sasl-plain; yum clean all
|
||||||
RUN groupadd -g 1000 ossec
|
RUN groupadd -g 1000 ossec
|
||||||
RUN useradd -u 1000 -g 1000 ossec
|
RUN useradd -u 1000 -g 1000 ossec
|
||||||
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - &&\
|
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - &&\
|
||||||
yum install -y nodejs
|
yum install -y nodejs
|
||||||
RUN yum install -y wazuh-manager-2.1.0 wazuh-api-2.1.0
|
RUN yum install -y wazuh-manager wazuh-api
|
||||||
|
|
||||||
|
|
||||||
ADD config/data_dirs.env /data_dirs.env
|
ADD config/data_dirs.env /data_dirs.env
|
||||||
@@ -19,6 +19,7 @@ RUN chmod 755 /init.bash &&\
|
|||||||
sync && /init.bash &&\
|
sync && /init.bash &&\
|
||||||
sync && rm /init.bash
|
sync && rm /init.bash
|
||||||
|
|
||||||
|
RUN sed -i 's/inet_protocols = all/inet_protocols = ipv4/g' /etc/postfix/main.cf
|
||||||
|
|
||||||
RUN curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${FILEBEAT_VERSION}-x86_64.rpm &&\
|
RUN curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${FILEBEAT_VERSION}-x86_64.rpm &&\
|
||||||
rpm -vi filebeat-${FILEBEAT_VERSION}-x86_64.rpm && rm filebeat-${FILEBEAT_VERSION}-x86_64.rpm
|
rpm -vi filebeat-${FILEBEAT_VERSION}-x86_64.rpm && rm filebeat-${FILEBEAT_VERSION}-x86_64.rpm
|
||||||
|
|||||||
Reference in New Issue
Block a user