mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-11-03 05:23:14 +00:00
Compare commits
7 Commits
3.9.4_7.1.
...
v3.9.4_7.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5da0553016 | ||
|
|
9f7cd94180 | ||
|
|
87895af5d9 | ||
|
|
a2dd5867a1 | ||
|
|
adc4efb694 | ||
|
|
62e39920cd | ||
|
|
2a77c6a6e6 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,23 +1,18 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Wazuh Docker v3.9.3_7.2.0-oss
|
## Wazuh Docker v3.9.4_7.2.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Support for OSS Elastic Docker images.
|
|
||||||
|
- Update to Wazuh version 3.9.4_7.2.0
|
||||||
|
- Implemented Wazuh Filebeat Module ([jm404](https://www.github.com/jm404)) [#2a77c6a](https://github.com/wazuh/wazuh-docker/commit/2a77c6a6e6bf78f2492adeedbade7a507d9974b2)
|
||||||
|
|
||||||
## Wazuh Docker v3.9.3_7.2.0
|
## Wazuh Docker v3.9.3_7.2.0
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Wazuh-docker reinserts cluster settings after resuming containers ([@manuasir](https://github.com/manuasir)) [#213](https://github.com/wazuh/wazuh-docker/pull/213)
|
- Wazuh-docker reinserts cluster settings after resuming containers ([@manuasir](https://github.com/manuasir)) [#213](https://github.com/wazuh/wazuh-docker/pull/213)
|
||||||
|
|
||||||
|
|
||||||
## Wazuh Docker v3.9.3_7.1.1-opendistro
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Support for Amazon Open Distro Docker images.
|
|
||||||
|
|
||||||
|
|
||||||
## Wazuh Docker v3.9.2_7.1.1
|
## Wazuh Docker v3.9.2_7.1.1
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ In addition, a docker-compose file is provided to launch the containers mentione
|
|||||||
|
|
||||||
* `stable` branch on correspond to the latest Wazuh-Docker stable version.
|
* `stable` branch on correspond to the latest Wazuh-Docker stable version.
|
||||||
* `master` branch contains the latest code, be aware of possible bugs on this branch.
|
* `master` branch contains the latest code, be aware of possible bugs on this branch.
|
||||||
* `Wazuh.Version_ElasticStack.Version` (for example 3.9.4_7.1.1-opendistro) branch. This branch contains the current release referenced in Docker Hub. The container images are installed under the current version of this branch.
|
* `Wazuh.Version_ElasticStack.Version` (for example 3.9.4_7.2.0) branch. This branch contains the current release referenced in Docker Hub. The container images are installed under the current version of this branch.
|
||||||
|
|
||||||
## Credits and Thank you
|
## Credits and Thank you
|
||||||
|
|
||||||
|
|||||||
2
VERSION
2
VERSION
@@ -1,2 +1,2 @@
|
|||||||
WAZUH-DOCKER_VERSION="3.9.4_7.1.1"
|
WAZUH-DOCKER_VERSION="3.9.4_7.2.0"
|
||||||
REVISION="3940"
|
REVISION="3940"
|
||||||
@@ -1,26 +1,54 @@
|
|||||||
version: '3'
|
# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
|
version: '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
wazuh:
|
wazuh:
|
||||||
image: wazuh/wazuh:3.9.4_7.1.1-opendistro-security
|
image: wazuh/wazuh:3.9.4_7.2.0
|
||||||
hostname: wazuh-manager
|
hostname: wazuh-manager
|
||||||
container_name: wazuh
|
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
|
||||||
- SSL_CERTIFICATE_AUTHORITIES=/etc/filebeat/CA.PEM
|
|
||||||
- SSL_CERTIFICATE=/etc/filebeat/node.pem
|
|
||||||
- SSL_KEY=/etc/filebeat/key.pem
|
|
||||||
- USERNAME=usertest
|
|
||||||
- PASSWORD=passwordtest
|
|
||||||
ports:
|
ports:
|
||||||
- "1514:1514/udp"
|
- "1514:1514/udp"
|
||||||
- "1515:1515"
|
- "1515:1515"
|
||||||
- "514:514/udp"
|
- "514:514/udp"
|
||||||
- "55000:55000"
|
- "55000:55000"
|
||||||
networks:
|
|
||||||
- odfe-net
|
|
||||||
|
|
||||||
volumes:
|
elasticsearch:
|
||||||
odfe-data1:
|
image: wazuh/wazuh-elasticsearch:3.9.4_7.2.0
|
||||||
|
hostname: elasticsearch
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "9200:9200"
|
||||||
|
environment:
|
||||||
|
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||||
|
- ELASTIC_CLUSTER=true
|
||||||
|
- CLUSTER_NODE_MASTER=true
|
||||||
|
- CLUSTER_MASTER_NODE_NAME=es01
|
||||||
|
ulimits:
|
||||||
|
memlock:
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
|
mem_limit: 2g
|
||||||
|
|
||||||
networks:
|
kibana:
|
||||||
odfe-net:
|
image: wazuh/wazuh-kibana:3.9.4_7.2.0
|
||||||
|
hostname: kibana
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- elasticsearch
|
||||||
|
links:
|
||||||
|
- elasticsearch:elasticsearch
|
||||||
|
- wazuh:wazuh
|
||||||
|
nginx:
|
||||||
|
image: wazuh/wazuh-nginx:3.9.4_7.2.0
|
||||||
|
hostname: nginx
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- NGINX_PORT=443
|
||||||
|
- NGINX_CREDENTIALS
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
depends_on:
|
||||||
|
- kibana
|
||||||
|
links:
|
||||||
|
- kibana:kibana
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
ARG ELASTIC_VERSION=7.1.1
|
ARG ELASTIC_VERSION=7.2.0
|
||||||
FROM amazon/opendistro-for-elasticsearch:1.1.0
|
FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}
|
||||||
ARG S3_PLUGIN_URL="https://artifacts.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-${ELASTIC_VERSION}.zip"
|
ARG S3_PLUGIN_URL="https://artifacts.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-${ELASTIC_VERSION}.zip"
|
||||||
|
|
||||||
ENV ELASTICSEARCH_URL="http://elasticsearch:9200"
|
ENV ELASTICSEARCH_URL="http://elasticsearch:9200"
|
||||||
|
|
||||||
|
ENV ALERTS_SHARDS="1" \
|
||||||
|
ALERTS_REPLICAS="0"
|
||||||
|
|
||||||
ENV API_USER="foo" \
|
ENV API_USER="foo" \
|
||||||
API_PASS="bar"
|
API_PASS="bar"
|
||||||
|
|
||||||
|
ENV XPACK_ML="true"
|
||||||
|
|
||||||
ENV ENABLE_CONFIGURE_S3="false"
|
ENV ENABLE_CONFIGURE_S3="false"
|
||||||
|
|
||||||
|
ARG TEMPLATE_VERSION=v3.9.4
|
||||||
|
|
||||||
# Elasticearch cluster configuration environment variables
|
# Elasticearch cluster configuration environment variables
|
||||||
# If ELASTIC_CLUSTER is set to "true" the following variables will be added to the Elasticsearch configuration
|
# If ELASTIC_CLUSTER is set to "true" the following variables will be added to the Elasticsearch configuration
|
||||||
# CLUSTER_INITIAL_MASTER_NODES set to own node by default.
|
# CLUSTER_INITIAL_MASTER_NODES set to own node by default.
|
||||||
@@ -41,5 +47,8 @@ RUN ${bin/elasticsearch-plugin install --batch S3_PLUGIN_URL}
|
|||||||
COPY config/configure_s3.sh ./config/configure_s3.sh
|
COPY config/configure_s3.sh ./config/configure_s3.sh
|
||||||
RUN chmod 755 ./config/configure_s3.sh
|
RUN chmod 755 ./config/configure_s3.sh
|
||||||
|
|
||||||
|
COPY --chown=elasticsearch:elasticsearch ./config/config_cluster.sh ./
|
||||||
|
RUN chmod +x ./config_cluster.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["elasticsearch"]
|
CMD ["elasticsearch"]
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
elastic_config_file="/usr/share/elasticsearch/config/elasticsearch.yml"
|
elastic_config_file="/usr/share/elasticsearch/config/elasticsearch.yml"
|
||||||
|
|
||||||
# Disable the Open distro security plugin
|
|
||||||
|
|
||||||
remove_single_node_conf(){
|
remove_single_node_conf(){
|
||||||
if grep -Fq "discovery.type" $1; then
|
if grep -Fq "discovery.type" $1; then
|
||||||
sed -i '/discovery.type\: /d' $1
|
sed -i '/discovery.type\: /d' $1
|
||||||
@@ -56,4 +54,4 @@ else
|
|||||||
remove_single_node_conf $elastic_config_file
|
remove_single_node_conf $elastic_config_file
|
||||||
remove_cluster_config $elastic_config_file
|
remove_cluster_config $elastic_config_file
|
||||||
echo "discovery.type: single-node" >> $elastic_config_file
|
echo "discovery.type: single-node" >> $elastic_config_file
|
||||||
fi
|
fi
|
||||||
@@ -19,8 +19,32 @@ run_as_other_user_if_needed() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#Disabling xpack features
|
||||||
|
|
||||||
|
elasticsearch_config_file="/usr/share/elasticsearch/config/elasticsearch.yml"
|
||||||
|
if grep -Fq "#xpack features" "$elasticsearch_config_file";
|
||||||
|
then
|
||||||
|
declare -A CONFIG_MAP=(
|
||||||
|
[xpack.ml.enabled]=$XPACK_ML
|
||||||
|
)
|
||||||
|
for i in "${!CONFIG_MAP[@]}"
|
||||||
|
do
|
||||||
|
if [ "${CONFIG_MAP[$i]}" != "" ]; then
|
||||||
|
sed -i 's/.'"$i"'.*/'"$i"': '"${CONFIG_MAP[$i]}"'/' $elasticsearch_config_file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "
|
||||||
|
#xpack features
|
||||||
|
xpack.ml.enabled: $XPACK_ML
|
||||||
|
" >> $elasticsearch_config_file
|
||||||
|
fi
|
||||||
|
|
||||||
# Run load settings script.
|
# Run load settings script.
|
||||||
|
|
||||||
|
./config_cluster.sh
|
||||||
|
|
||||||
./load_settings.sh &
|
./load_settings.sh &
|
||||||
|
|
||||||
# Execute elasticsearch
|
# Execute elasticsearch
|
||||||
|
|||||||
@@ -11,8 +11,13 @@ else
|
|||||||
wazuh_url="${WAZUH_API_URL}"
|
wazuh_url="${WAZUH_API_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ${ENABLED_XPACK} != "true" || "x${ELASTICSEARCH_USERNAME}" = "x" || "x${ELASTICSEARCH_PASSWORD}" = "x" ]]; then
|
||||||
|
auth=""
|
||||||
|
else
|
||||||
|
auth="--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}"
|
||||||
|
fi
|
||||||
|
|
||||||
until curl -XGET $el_url; do
|
until curl ${auth} -XGET $el_url; do
|
||||||
>&2 echo "Elastic is unavailable - sleeping"
|
>&2 echo "Elastic is unavailable - sleeping"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
@@ -45,10 +50,10 @@ API_USER_Q=`echo "$API_USER" | tr -d '"'`
|
|||||||
API_PASSWORD=`echo -n $API_PASS_Q | base64`
|
API_PASSWORD=`echo -n $API_PASS_Q | base64`
|
||||||
|
|
||||||
echo "Setting API credentials into Wazuh APP"
|
echo "Setting API credentials into Wazuh APP"
|
||||||
CONFIG_CODE=$(curl -s -o /dev/null -w "%{http_code}" -XGET $el_url/.wazuh/_doc/1513629884013)
|
CONFIG_CODE=$(curl -s -o /dev/null -w "%{http_code}" -XGET $el_url/.wazuh/_doc/1513629884013 ${auth})
|
||||||
|
|
||||||
if [ "x$CONFIG_CODE" != "x200" ]; then
|
if [ "x$CONFIG_CODE" != "x200" ]; then
|
||||||
curl -s -XPOST $el_url/.wazuh/_doc/1513629884013 -H 'Content-Type: application/json' -d'
|
curl -s -XPOST $el_url/.wazuh/_doc/1513629884013 ${auth} -H 'Content-Type: application/json' -d'
|
||||||
{
|
{
|
||||||
"api_user": "'"$API_USER_Q"'",
|
"api_user": "'"$API_USER_Q"'",
|
||||||
"api_password": "'"$API_PASSWORD"'",
|
"api_password": "'"$API_PASSWORD"'",
|
||||||
@@ -77,6 +82,14 @@ else
|
|||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
curl -XPUT "$el_url/_cluster/settings" ${auth} -H 'Content-Type: application/json' -d'
|
||||||
|
{
|
||||||
|
"persistent": {
|
||||||
|
"xpack.monitoring.collection.enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
# Set cluster delayed timeout when node falls
|
# Set cluster delayed timeout when node falls
|
||||||
curl -X PUT "$el_url/_all/_settings" -H 'Content-Type: application/json' -d'
|
curl -X PUT "$el_url/_all/_settings" -H 'Content-Type: application/json' -d'
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
FROM amazon/opendistro-for-elasticsearch-kibana:1.1.0
|
FROM docker.elastic.co/kibana/kibana:7.2.0
|
||||||
ARG ELASTIC_VERSION=7.1.1
|
ARG ELASTIC_VERSION=7.2.0
|
||||||
ARG WAZUH_VERSION=3.9.4
|
ARG WAZUH_VERSION=3.9.4
|
||||||
ARG WAZUH_APP_VERSION="${WAZUH_VERSION}_${ELASTIC_VERSION}"
|
ARG WAZUH_APP_VERSION="${WAZUH_VERSION}_${ELASTIC_VERSION}"
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ USER root
|
|||||||
|
|
||||||
ADD https://packages.wazuh.com/wazuhapp/wazuhapp-${WAZUH_APP_VERSION}.zip /tmp
|
ADD https://packages.wazuh.com/wazuhapp/wazuhapp-${WAZUH_APP_VERSION}.zip /tmp
|
||||||
|
|
||||||
RUN /usr/share/kibana/bin/kibana-plugin install file:///tmp/wazuhapp-${WAZUH_APP_VERSION}.zip
|
RUN /usr/share/kibana/bin/kibana-plugin install --allow-root file:///tmp/wazuhapp-${WAZUH_APP_VERSION}.zip
|
||||||
RUN rm -rf /tmp/wazuhapp-${WAZUH_APP_VERSION}.zip
|
RUN rm -rf /tmp/wazuhapp-${WAZUH_APP_VERSION}.zip
|
||||||
|
|
||||||
COPY config/entrypoint.sh ./entrypoint.sh
|
COPY config/entrypoint.sh ./entrypoint.sh
|
||||||
@@ -36,12 +36,21 @@ ENV PATTERN="" \
|
|||||||
WAZUH_VERSION_REPLICAS="" \
|
WAZUH_VERSION_REPLICAS="" \
|
||||||
IP_SELECTOR="" \
|
IP_SELECTOR="" \
|
||||||
IP_IGNORE="" \
|
IP_IGNORE="" \
|
||||||
|
XPACK_RBAC_ENABLED="" \
|
||||||
WAZUH_MONITORING_ENABLED="" \
|
WAZUH_MONITORING_ENABLED="" \
|
||||||
WAZUH_MONITORING_FREQUENCY="" \
|
WAZUH_MONITORING_FREQUENCY="" \
|
||||||
WAZUH_MONITORING_SHARDS="" \
|
WAZUH_MONITORING_SHARDS="" \
|
||||||
WAZUH_MONITORING_REPLICAS="" \
|
WAZUH_MONITORING_REPLICAS="" \
|
||||||
ADMIN_PRIVILEGES=""
|
ADMIN_PRIVILEGES=""
|
||||||
|
|
||||||
|
ARG XPACK_CANVAS="true"
|
||||||
|
ARG XPACK_LOGS="true"
|
||||||
|
ARG XPACK_INFRA="true"
|
||||||
|
ARG XPACK_ML="true"
|
||||||
|
ARG XPACK_DEVTOOLS="true"
|
||||||
|
ARG XPACK_MONITORING="true"
|
||||||
|
ARG XPACK_APM="true"
|
||||||
|
|
||||||
ARG CHANGE_WELCOME="false"
|
ARG CHANGE_WELCOME="false"
|
||||||
|
|
||||||
COPY --chown=kibana:kibana ./config/wazuh_app_config.sh ./
|
COPY --chown=kibana:kibana ./config/wazuh_app_config.sh ./
|
||||||
@@ -52,6 +61,12 @@ COPY --chown=kibana:kibana ./config/kibana_settings.sh ./
|
|||||||
|
|
||||||
RUN chmod +x ./kibana_settings.sh
|
RUN chmod +x ./kibana_settings.sh
|
||||||
|
|
||||||
|
COPY --chown=kibana:kibana ./config/xpack_config.sh ./
|
||||||
|
|
||||||
|
RUN chmod +x ./xpack_config.sh
|
||||||
|
|
||||||
|
RUN ./xpack_config.sh
|
||||||
|
|
||||||
COPY --chown=kibana:kibana ./config/welcome_wazuh.sh ./
|
COPY --chown=kibana:kibana ./config/welcome_wazuh.sh ./
|
||||||
|
|
||||||
RUN chmod +x ./welcome_wazuh.sh
|
RUN chmod +x ./welcome_wazuh.sh
|
||||||
@@ -60,6 +75,4 @@ RUN ./welcome_wazuh.sh
|
|||||||
|
|
||||||
RUN /usr/local/bin/kibana-docker --optimize
|
RUN /usr/local/bin/kibana-docker --optimize
|
||||||
|
|
||||||
ENV ELASTICSEARCH_URL "--cacert /usr/share/elasticsearch/config/root-ca.pem -u admin:admin -k https://elasticsearch:9200"
|
|
||||||
|
|
||||||
ENTRYPOINT ./entrypoint.sh
|
ENTRYPOINT ./entrypoint.sh
|
||||||
|
|||||||
@@ -13,7 +13,13 @@ else
|
|||||||
el_url="${ELASTICSEARCH_URL}"
|
el_url="${ELASTICSEARCH_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
until curl -XGET $el_url; do
|
if [[ ${ENABLED_XPACK} != "true" || "x${ELASTICSEARCH_USERNAME}" = "x" || "x${ELASTICSEARCH_PASSWORD}" = "x" ]]; then
|
||||||
|
auth=""
|
||||||
|
else
|
||||||
|
auth="--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
until curl -XGET $el_url ${auth}; do
|
||||||
>&2 echo "Elastic is unavailable - sleeping"
|
>&2 echo "Elastic is unavailable - sleeping"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -17,12 +17,9 @@ WAZUH_MAJOR=3
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
# Customize elasticsearch ip
|
# Customize elasticsearch ip
|
||||||
##############################################################################
|
##############################################################################
|
||||||
sed -i 's|https://localhost:9200|http://elasticsearch:9200|g' /usr/share/kibana/config/kibana.yml
|
|
||||||
|
|
||||||
if [ "$ELASTICSEARCH_KIBANA_IP" != "" ]; then
|
if [ "$ELASTICSEARCH_KIBANA_IP" != "" ]; then
|
||||||
sed -i '/elasticsearch.hosts/d' /usr/share/kibana/config/kibana.yml
|
sed -i "s:#elasticsearch.hosts:elasticsearch.hosts:g" /usr/share/kibana/config/kibana.yml
|
||||||
echo "elasticsearch.hosts: $ELASTICSEARCH_KIBANA_IP" >> /usr/share/kibana/config/kibana.yml
|
sed -i 's|http://elasticsearch:9200|'$ELASTICSEARCH_KIBANA_IP'|g' /usr/share/kibana/config/kibana.yml
|
||||||
sed -i 's|https://elasticsearch:9200|'$ELASTICSEARCH_KIBANA_IP'|g' /usr/share/kibana/config/kibana.yml
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If KIBANA_INDEX was set, then change the default index in kibana.yml configuration file. If there was an index, then delete it and recreate.
|
# If KIBANA_INDEX was set, then change the default index in kibana.yml configuration file. If there was an index, then delete it and recreate.
|
||||||
@@ -33,6 +30,14 @@ if [ "$KIBANA_INDEX" != "" ]; then
|
|||||||
echo "kibana.index: $KIBANA_INDEX" >> /usr/share/kibana/config/kibana.yml
|
echo "kibana.index: $KIBANA_INDEX" >> /usr/share/kibana/config/kibana.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If XPACK_SECURITY_ENABLED was set, then change the xpack.security.enabled option from true (default) to false.
|
||||||
|
if [ "$XPACK_SECURITY_ENABLED" != "" ]; then
|
||||||
|
if grep -q 'xpack.security.enabled' /usr/share/kibana/config/kibana.yml; then
|
||||||
|
sed -i '/xpack.security.enabled/d' /usr/share/kibana/config/kibana.yml
|
||||||
|
fi
|
||||||
|
echo "xpack.security.enabled: $XPACK_SECURITY_ENABLED" >> /usr/share/kibana/config/kibana.yml
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$KIBANA_IP" != "" ]; then
|
if [ "$KIBANA_IP" != "" ]; then
|
||||||
kibana_ip="$KIBANA_IP"
|
kibana_ip="$KIBANA_IP"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare -A CONFIG_MAP=(
|
|||||||
[wazuh-version.replicas]=$WAZUH_VERSION_REPLICAS
|
[wazuh-version.replicas]=$WAZUH_VERSION_REPLICAS
|
||||||
[ip.selector]=$IP_SELECTOR
|
[ip.selector]=$IP_SELECTOR
|
||||||
[ip.ignore]=$IP_IGNORE
|
[ip.ignore]=$IP_IGNORE
|
||||||
|
[xpack.rbac.enabled]=$XPACK_RBAC_ENABLED
|
||||||
[wazuh.monitoring.enabled]=$WAZUH_MONITORING_ENABLED
|
[wazuh.monitoring.enabled]=$WAZUH_MONITORING_ENABLED
|
||||||
[wazuh.monitoring.frequency]=$WAZUH_MONITORING_FREQUENCY
|
[wazuh.monitoring.frequency]=$WAZUH_MONITORING_FREQUENCY
|
||||||
[wazuh.monitoring.shards]=$WAZUH_MONITORING_SHARDS
|
[wazuh.monitoring.shards]=$WAZUH_MONITORING_SHARDS
|
||||||
|
|||||||
35
kibana/config/xpack_config.sh
Normal file
35
kibana/config/xpack_config.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
|
|
||||||
|
kibana_config_file="/usr/share/kibana/config/kibana.yml"
|
||||||
|
if grep -Fq "#xpack features" "$kibana_config_file";
|
||||||
|
then
|
||||||
|
declare -A CONFIG_MAP=(
|
||||||
|
[xpack.apm.ui.enabled]=$XPACK_APM
|
||||||
|
[xpack.grokdebugger.enabled]=$XPACK_DEVTOOLS
|
||||||
|
[xpack.searchprofiler.enabled]=$XPACK_DEVTOOLS
|
||||||
|
[xpack.ml.enabled]=$XPACK_ML
|
||||||
|
[xpack.canvas.enabled]=$XPACK_CANVAS
|
||||||
|
[xpack.infra.enabled]=$XPACK_INFRA
|
||||||
|
[xpack.monitoring.enabled]=$XPACK_MONITORING
|
||||||
|
[console.enabled]=$XPACK_DEVTOOLS
|
||||||
|
)
|
||||||
|
for i in "${!CONFIG_MAP[@]}"
|
||||||
|
do
|
||||||
|
if [ "${CONFIG_MAP[$i]}" != "" ]; then
|
||||||
|
sed -i 's/.'"$i"'.*/'"$i"': '"${CONFIG_MAP[$i]}"'/' $kibana_config_file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "
|
||||||
|
#xpack features
|
||||||
|
xpack.apm.ui.enabled: $XPACK_APM
|
||||||
|
xpack.grokdebugger.enabled: $XPACK_DEVTOOLS
|
||||||
|
xpack.searchprofiler.enabled: $XPACK_DEVTOOLS
|
||||||
|
xpack.ml.enabled: $XPACK_ML
|
||||||
|
xpack.canvas.enabled: $XPACK_CANVAS
|
||||||
|
xpack.infra.enabled: $XPACK_INFRA
|
||||||
|
xpack.monitoring.enabled: $XPACK_MONITORING
|
||||||
|
console.enabled: $XPACK_DEVTOOLS
|
||||||
|
" >> $kibana_config_file
|
||||||
|
fi
|
||||||
19
nginx/Dockerfile
Normal file
19
nginx/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y openssl apache2-utils
|
||||||
|
|
||||||
|
COPY config/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
RUN chmod 755 /entrypoint.sh
|
||||||
|
|
||||||
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
VOLUME ["/etc/nginx/conf.d"]
|
||||||
|
|
||||||
|
ENV NGINX_NAME="foo" \
|
||||||
|
NGINX_PWD="bar"
|
||||||
|
|
||||||
|
ENTRYPOINT /entrypoint.sh
|
||||||
79
nginx/config/entrypoint.sh
Normal file
79
nginx/config/entrypoint.sh
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Generating certificates.
|
||||||
|
if [ ! -d /etc/nginx/conf.d/ssl ]; then
|
||||||
|
echo "Generating SSL certificates"
|
||||||
|
mkdir -p /etc/nginx/conf.d/ssl/certs /etc/nginx/conf.d/ssl/private
|
||||||
|
openssl req -x509 -batch -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/conf.d/ssl/private/kibana-access.key -out /etc/nginx/conf.d/ssl/certs/kibana-access.pem >/dev/null
|
||||||
|
else
|
||||||
|
echo "SSL certificates already present"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Setting users credentials.
|
||||||
|
# In order to set NGINX_CREDENTIALS, before "docker-compose up -d" run (a or b):
|
||||||
|
#
|
||||||
|
# a) export NGINX_CREDENTIALS="user1:pass1;user2:pass2;" or
|
||||||
|
# export NGINX_CREDENTIALS="user1:pass1;user2:pass2"
|
||||||
|
#
|
||||||
|
# b) Set NGINX_CREDENTIALS in docker-compose.yml:
|
||||||
|
# NGINX_CREDENTIALS=user1:pass1;user2:pass2; or
|
||||||
|
# NGINX_CREDENTIALS=user1:pass1;user2:pass2
|
||||||
|
#
|
||||||
|
if [ ! -f /etc/nginx/conf.d/kibana.htpasswd ]; then
|
||||||
|
echo "Setting users credentials"
|
||||||
|
if [ ! -z "$NGINX_CREDENTIALS" ]; then
|
||||||
|
IFS=';' read -r -a users <<< "$NGINX_CREDENTIALS"
|
||||||
|
for index in "${!users[@]}"
|
||||||
|
do
|
||||||
|
IFS=':' read -r -a credentials <<< "${users[index]}"
|
||||||
|
if [ $index -eq 0 ]; then
|
||||||
|
echo ${credentials[1]}|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd ${credentials[0]} >/dev/null
|
||||||
|
else
|
||||||
|
echo ${credentials[1]}|htpasswd -i /etc/nginx/conf.d/kibana.htpasswd ${credentials[0]} >/dev/null
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
# NGINX_PWD and NGINX_NAME are declared in nginx/Dockerfile
|
||||||
|
echo $NGINX_PWD|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd $NGINX_NAME >/dev/null
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Kibana credentials already configured"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x${NGINX_PORT}" = "x" ]; then
|
||||||
|
NGINX_PORT=443
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x${KIBANA_HOST}" = "x" ]; then
|
||||||
|
KIBANA_HOST="kibana:5601"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Configuring NGINX"
|
||||||
|
cat > /etc/nginx/conf.d/default.conf <<EOF
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
return 301 https://\$host:${NGINX_PORT}\$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen ${NGINX_PORT} default_server;
|
||||||
|
listen [::]:${NGINX_PORT};
|
||||||
|
ssl on;
|
||||||
|
ssl_certificate /etc/nginx/conf.d/ssl/certs/kibana-access.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/conf.d/ssl/private/kibana-access.key;
|
||||||
|
location / {
|
||||||
|
auth_basic "Restricted";
|
||||||
|
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd;
|
||||||
|
proxy_pass http://${KIBANA_HOST}/;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
proxy_buffers 4 256k;
|
||||||
|
proxy_busy_buffers_size 256k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
nginx -g 'daemon off;'
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
||||||
FROM phusion/baseimage:latest
|
FROM phusion/baseimage:latest
|
||||||
|
|
||||||
ARG FILEBEAT_VERSION=7.1.1
|
ARG FILEBEAT_VERSION=7.2.0
|
||||||
|
|
||||||
ARG WAZUH_VERSION=3.9.4-1
|
ARG WAZUH_VERSION=3.9.4-1
|
||||||
|
|
||||||
@@ -38,8 +38,8 @@ COPY config/01-config_filebeat.sh /entrypoint-scripts/01-config_filebeat.sh
|
|||||||
RUN chmod 755 /init.bash && \
|
RUN chmod 755 /init.bash && \
|
||||||
sync && /init.bash && \
|
sync && /init.bash && \
|
||||||
sync && rm /init.bash && \
|
sync && rm /init.bash && \
|
||||||
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-oss-${FILEBEAT_VERSION}-amd64.deb &&\
|
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${FILEBEAT_VERSION}-amd64.deb &&\
|
||||||
dpkg -i filebeat-oss-${FILEBEAT_VERSION}-amd64.deb && rm -f filebeat-oss-${FILEBEAT_VERSION}-amd64.deb && \
|
dpkg -i filebeat-${FILEBEAT_VERSION}-amd64.deb && rm -f filebeat-${FILEBEAT_VERSION}-amd64.deb && \
|
||||||
chmod 755 /entrypoint.sh && \
|
chmod 755 /entrypoint.sh && \
|
||||||
chmod 755 /entrypoint-scripts/00-wazuh.sh && \
|
chmod 755 /entrypoint-scripts/00-wazuh.sh && \
|
||||||
chmod 755 /entrypoint-scripts/01-config_filebeat.sh
|
chmod 755 /entrypoint-scripts/01-config_filebeat.sh
|
||||||
@@ -74,7 +74,7 @@ RUN chmod +x /etc/service/wazuh-api/run && \
|
|||||||
|
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/wazuh/wazuh/$TEMPLATE_VERSION/extensions/elasticsearch/7.x/wazuh-template.json /etc/filebeat
|
ADD https://raw.githubusercontent.com/wazuh/wazuh/$TEMPLATE_VERSION/extensions/elasticsearch/7.x/wazuh-template.json /etc/filebeat
|
||||||
RUN chmod go-w /etc/filebeat/wazuh-template.json
|
RUN chmod go-w /etc/filebeat/wazuh-template.json
|
||||||
|
|
||||||
# Run all services
|
# Run all services
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
@@ -5,6 +5,7 @@ set -e
|
|||||||
|
|
||||||
WAZUH_FILEBEAT_MODULE=wazuh-filebeat-0.1.tar.gz
|
WAZUH_FILEBEAT_MODULE=wazuh-filebeat-0.1.tar.gz
|
||||||
|
|
||||||
|
# Modify the output to Elasticsearch if th ELASTICSEARCH_URL is set
|
||||||
if [ "$ELASTICSEARCH_URL" != "" ]; then
|
if [ "$ELASTICSEARCH_URL" != "" ]; then
|
||||||
>&2 echo "Customize Elasticsearch ouput IP."
|
>&2 echo "Customize Elasticsearch ouput IP."
|
||||||
sed -i 's|http://elasticsearch:9200|'$ELASTICSEARCH_URL'|g' /etc/filebeat/filebeat.yml
|
sed -i 's|http://elasticsearch:9200|'$ELASTICSEARCH_URL'|g' /etc/filebeat/filebeat.yml
|
||||||
@@ -16,32 +17,3 @@ curl -s "https://packages.wazuh.com/3.x/filebeat/${WAZUH_FILEBEAT_MODULE}" | tar
|
|||||||
mkdir -p /usr/share/filebeat/module/wazuh
|
mkdir -p /usr/share/filebeat/module/wazuh
|
||||||
chmod 755 -R /usr/share/filebeat/module/wazuh
|
chmod 755 -R /usr/share/filebeat/module/wazuh
|
||||||
|
|
||||||
chown root: /etc/filebeat/filebeat.yml
|
|
||||||
chmod go-w /etc/filebeat/filebeat.yml
|
|
||||||
|
|
||||||
# Configure filebeat.yml security settings
|
|
||||||
|
|
||||||
if [ "$SSL_CERTIFICATE_AUTHORITIES" != "" ]; then
|
|
||||||
>&2 echo "Customize Elasticsearch ouput IP."
|
|
||||||
sed -i 's|#ssl.certificate_authorities:|'ssl.certificate_authorities:\ [\"$SSL_CERTIFICATE\"]'|g' /etc/filebeat/filebeat.yml
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$SSL_CERTIFICATE" != "" ]; then
|
|
||||||
>&2 echo "Customize Elasticsearch ouput IP."
|
|
||||||
sed -i 's|#ssl.certificate:|'ssl.certificate:\ \"$SSL_CERTIFICATE\"'|g' /etc/filebeat/filebeat.yml
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$SSL_KEY" != "" ]; then
|
|
||||||
>&2 echo "Customize Elasticsearch ouput IP."
|
|
||||||
sed -i 's|#ssl.key:|'ssl.key:\ \"$SSL_KEY\"'|g' /etc/filebeat/filebeat.yml
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$USERNAME" != "" ]; then
|
|
||||||
>&2 echo "Customize Elasticsearch ouput IP."
|
|
||||||
sed -i 's|#username:|'username:\ \"$USERNAME\"'|g' /etc/filebeat/filebeat.yml
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$PASSWORD" != "" ]; then
|
|
||||||
>&2 echo "Customize Elasticsearch ouput IP."
|
|
||||||
sed -i 's|#password:|'password:\ \"$PASSWORD\"'|g' /etc/filebeat/filebeat.yml
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -1,58 +1,16 @@
|
|||||||
# Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
|
|
||||||
filebeat.inputs:
|
# Wazuh - Filebeat configuration file
|
||||||
- type: log
|
filebeat.modules:
|
||||||
paths:
|
- module: wazuh
|
||||||
- '/var/ossec/logs/alerts/alerts.json'
|
alerts:
|
||||||
|
enabled: true
|
||||||
|
archives:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
setup.template.json.enabled: true
|
setup.template.json.enabled: true
|
||||||
setup.template.json.path: "/etc/filebeat/wazuh-template.json"
|
setup.template.json.path: '/etc/filebeat/wazuh-template.json'
|
||||||
setup.template.json.name: "wazuh"
|
setup.template.json.name: 'wazuh'
|
||||||
setup.template.overwrite: true
|
setup.template.overwrite: true
|
||||||
|
setup.ilm.enabled: false
|
||||||
|
|
||||||
processors:
|
output.elasticsearch.hosts: ['http://elasticsearch:9200']
|
||||||
- decode_json_fields:
|
|
||||||
fields: ['message']
|
|
||||||
process_array: true
|
|
||||||
max_depth: 200
|
|
||||||
target: ''
|
|
||||||
overwrite_keys: true
|
|
||||||
- drop_fields:
|
|
||||||
fields: ['message', 'ecs', 'beat', 'input_type', 'tags', 'count', '@version', 'log', 'offset', 'type', 'host']
|
|
||||||
- rename:
|
|
||||||
fields:
|
|
||||||
- from: "data.aws.sourceIPAddress"
|
|
||||||
to: "@src_ip"
|
|
||||||
ignore_missing: true
|
|
||||||
fail_on_error: false
|
|
||||||
when:
|
|
||||||
regexp:
|
|
||||||
data.aws.sourceIPAddress: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
|
|
||||||
- rename:
|
|
||||||
fields:
|
|
||||||
- from: "data.srcip"
|
|
||||||
to: "@src_ip"
|
|
||||||
ignore_missing: true
|
|
||||||
fail_on_error: false
|
|
||||||
when:
|
|
||||||
regexp:
|
|
||||||
data.srcip: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
|
|
||||||
- rename:
|
|
||||||
fields:
|
|
||||||
- from: "data.win.eventdata.ipAddress"
|
|
||||||
to: "@src_ip"
|
|
||||||
ignore_missing: true
|
|
||||||
fail_on_error: false
|
|
||||||
when:
|
|
||||||
regexp:
|
|
||||||
data.win.eventdata.ipAddress: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
|
|
||||||
|
|
||||||
output.elasticsearch:
|
|
||||||
hosts: ['http://elasticsearch:9200']
|
|
||||||
#pipeline: geoip
|
|
||||||
indices:
|
|
||||||
- index: 'wazuh-alerts-3.x-%{+yyyy.MM.dd}'
|
|
||||||
#ssl.certificate_authorities:
|
|
||||||
#ssl.certificate:
|
|
||||||
#ssl.key:
|
|
||||||
#username:
|
|
||||||
#password:
|
|
||||||
Reference in New Issue
Block a user