From a776bdb006921dcb8906fe93b29208f30dc0a953 Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 17:19:23 +0200 Subject: [PATCH 1/8] Update directory structure --- README.md | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3ccddbd6..0f829146 100644 --- a/README.md +++ b/README.md @@ -87,37 +87,57 @@ ADMIN_PRIVILEGES=true # App privileges ## Directory structure - wazuh-docker ├── CHANGELOG.md ├── docker-compose.yml - ├── elasticsearch - │   ├── config - │   │   ├── config_cluster.sh - │   │   ├── configure_s3.sh - │   │   ├── entrypoint.sh - │   │   └── load_settings.sh - │   └── Dockerfile - ├── kibana + ├── elastic_conf + │   └── elasticsearch.yml + ├── generate-opendistro-certs.yml + ├── kibana-opendistro │   ├── config + │   │   ├── custom_welcome + │   │   │   ├── light_theme.style.css + │   │   │   ├── template.js.hbs + │   │   │   ├── wazuh_logo_circle.svg + │   │   │   └── wazuh_wazuh_bg.svg │   │   ├── entrypoint.sh │   │   ├── kibana_settings.sh │   │   ├── wazuh_app_config.sh - │   │   ├── welcome_wazuh.sh - │   │   └── xpack_config.sh + │   │   ├── wazuh.yml + │   │   └── welcome_wazuh.sh │   └── Dockerfile ├── LICENSE + ├── production_cluster + │   ├── elastic_opendistro + │   │   ├── elasticsearch-node1.yml + │   │   ├── elasticsearch-node2.yml + │   │   ├── elasticsearch-node3.yml + │   │   └── internal_users.yml + │   ├── kibana_ssl + │   │   └── generate-self-signed-cert.sh + │   ├── nginx + │   │   ├── nginx.conf + │   │   └── ssl + │   │   └── generate-self-signed-cert.sh + │   ├── ssl_certs + │   │   └── certs.yml + │   └── wazuh_cluster + │   ├── wazuh_manager.conf + │   └── wazuh_worker.conf + ├── production-cluster.yml ├── README.md ├── VERSION - └── wazuh + └── wazuh-opendistro ├── config + │   ├── create_user.py │   ├── etc │   │   ├── cont-init.d │   │   │   ├── 0-wazuh-init │   │   │   ├── 1-config-filebeat │   │   │   └── 2-manager │   │   └── services.d - │   │   ├── api │   │   └── filebeat + │   │   ├── finish + │   │   └── run │   ├── filebeat.yml │   ├── permanent_data.env │   ├── permanent_data.sh @@ -127,7 +147,7 @@ ADMIN_PRIVILEGES=true # App privileges ## Branches -* `stable` branch on correspond to the latest Wazuh-Docker stable version. +* `4.0` branch on correspond to the latest Wazuh-Docker stable version. * `master` branch contains the latest code, be aware of possible bugs on this branch. * `Wazuh.Version_ElasticStack.Version` (for example 3.10.2_7.5.0) branch. This branch contains the current release referenced in Docker Hub. The container images are installed under the current version of this branch. From 52f48c10a38e06960135bc4705e838dcc71a72e8 Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 17:19:39 +0200 Subject: [PATCH 2/8] Update version --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 23662729..1f358e83 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -WAZUH-DOCKER_VERSION="3.13.1_7.8.0" -REVISION="31310" +WAZUH-DOCKER_VERSION="4.0.0" +REVISION="40000" From f35927b536fadf0266c0fccf199762b17b3ff576 Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 17:27:19 +0200 Subject: [PATCH 3/8] Backport PR #393 --- .../config/etc/cont-init.d/0-wazuh-init | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wazuh-opendistro/config/etc/cont-init.d/0-wazuh-init b/wazuh-opendistro/config/etc/cont-init.d/0-wazuh-init index 0a625354..68538c10 100644 --- a/wazuh-opendistro/config/etc/cont-init.d/0-wazuh-init +++ b/wazuh-opendistro/config/etc/cont-init.d/0-wazuh-init @@ -133,6 +133,19 @@ set_custom_hostname() { sed -i 's/to_be_replaced_by_hostname<\/node_name>/'"${HOSTNAME}"'<\/node_name>/g' ${WAZUH_INSTALL_PATH}/etc/ossec.conf } +############################################################################## +# Allow users to set the container cluster key dynamically on +# container start. +# +# To use this: +# 1. Create your own ossec.conf file +# 2. In your ossec.conf file, set to_be_replaced_by_cluster_key as your key +# 3. Mount your custom ossec.conf file at $WAZUH_CONFIG_MOUNT/etc/ossec.conf +############################################################################## + +set_custom_cluster_key() { + sed -i 's/to_be_replaced_by_cluster_key<\/key>/'"${WAZUH_CLUSTER_KEY}"'<\/key>/g' ${WAZUH_INSTALL_PATH}/etc/ossec.conf +} ############################################################################## # Main function @@ -163,6 +176,9 @@ main() { # Allow setting custom hostname set_custom_hostname + # Allow setting custom cluster key + set_custom_cluster_key + # Delete temporary data folder rm -rf ${WAZUH_INSTALL_PATH}/data_tmp From d4eec39c90accdc31997fc17db1b5d25fd57d8e4 Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 17:33:26 +0200 Subject: [PATCH 4/8] Update changelog --- CHANGELOG.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 721d2cf1..3f567676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,29 @@ # Change Log All notable changes to this project will be documented in this file. -# Change Log -All notable changes to this project will be documented in this file. +## Wazuh Docker v4.0.0 + +### Added + +- Update to Wazuh version 4.0.0 +- Updating Wazuh cluster key dynamically ([@1stOfHisGame](https://github.com/1stOfHisGame)) [#393](https://github.com/wazuh/wazuh-docker/pull/393) +- Switched to CentOS 7 for base image ([@xr09](https://github.com/xr09)) [#259](https://github.com/wazuh/wazuh-docker/issues/259) +- Using s6-overlay for process management ([@xr09](https://github.com/xr09)) [#274](https://github.com/wazuh/wazuh-docker/issues/274) +- Allow the creation of custom API users ([@xr09](https://github.com/xr09)) [#395](https://github.com/wazuh/wazuh-docker/issues/395) + + +## Wazuh Docker v3.13.2_7.9.1 + +### Added + +- Update to Wazuh version 3.13.2_7.9.1 +- Add CLUSTER_NETWORK_HOST environment variable ([@jfut](https://github.com/jfut)) [#372](https://github.com/wazuh/wazuh-docker/pull/372) + +### Fixed + +- Too many redirects when running on port 80 ([@chowmean](https://github.com/chowmean)) [#377](https://github.com/wazuh/wazuh-docker/pull/377) +- Move Filebeat installation to build stage ([@xr09](https://github.com/xr09)) [#378](https://github.com/wazuh/wazuh-docker/pull/378) + ## Wazuh Docker v3.13.1_7.8.0 @@ -10,6 +31,7 @@ All notable changes to this project will be documented in this file. - Update to Wazuh version 3.13.1_7.8.0 + ## Wazuh Docker v3.13.0_7.7.1 ### Added @@ -27,6 +49,7 @@ All notable changes to this project will be documented in this file. - Update to Wazuh version 3.12.3_7.6.2 + ## Wazuh Docker v3.12.2_7.6.2 ### Added From 7175e51012ce277c07031af668880057f641788f Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 17:54:45 +0200 Subject: [PATCH 5/8] Improve Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f567676..030f596b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. - Switched to CentOS 7 for base image ([@xr09](https://github.com/xr09)) [#259](https://github.com/wazuh/wazuh-docker/issues/259) - Using s6-overlay for process management ([@xr09](https://github.com/xr09)) [#274](https://github.com/wazuh/wazuh-docker/issues/274) - Allow the creation of custom API users ([@xr09](https://github.com/xr09)) [#395](https://github.com/wazuh/wazuh-docker/issues/395) +- Use official Elastic images ([@xr09](https://github.com/xr09)) [#333](https://github.com/wazuh/wazuh-docker/pull/333) +- OpenDistro support ([@xr09](https://github.com/xr09)) [#373](https://github.com/wazuh/wazuh-docker/pull/373) ## Wazuh Docker v3.13.2_7.9.1 From b874eac3af5a174e074068449cc6406608e3792c Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 18:12:55 +0200 Subject: [PATCH 6/8] Renamed image names to odfe --- docker-compose.yml | 6 ++---- {kibana-opendistro => kibana-odfe}/Dockerfile | 0 .../config/custom_welcome/light_theme.style.css | 0 .../config/custom_welcome/template.js.hbs | 0 .../config/custom_welcome/wazuh_logo_circle.svg | 0 .../config/custom_welcome/wazuh_wazuh_bg.svg | 0 {kibana-opendistro => kibana-odfe}/config/entrypoint.sh | 0 .../config/kibana_settings.sh | 0 {kibana-opendistro => kibana-odfe}/config/wazuh.yml | 0 .../config/wazuh_app_config.sh | 0 .../config/welcome_wazuh.sh | 0 production-cluster.yml | 9 +++------ {wazuh-opendistro => wazuh-odfe}/Dockerfile | 0 {wazuh-opendistro => wazuh-odfe}/config/create_user.py | 0 .../config/etc/cont-init.d/0-wazuh-init | 0 .../config/etc/cont-init.d/1-config-filebeat | 0 .../config/etc/cont-init.d/2-manager | 0 .../config/etc/services.d/filebeat/finish | 0 .../config/etc/services.d/filebeat/run | 0 {wazuh-opendistro => wazuh-odfe}/config/filebeat.yml | 0 .../config/permanent_data.env | 0 .../config/permanent_data.sh | 0 {wazuh-opendistro => wazuh-odfe}/config/wazuh.repo | 0 23 files changed, 5 insertions(+), 10 deletions(-) rename {kibana-opendistro => kibana-odfe}/Dockerfile (100%) rename {kibana-opendistro => kibana-odfe}/config/custom_welcome/light_theme.style.css (100%) rename {kibana-opendistro => kibana-odfe}/config/custom_welcome/template.js.hbs (100%) rename {kibana-opendistro => kibana-odfe}/config/custom_welcome/wazuh_logo_circle.svg (100%) rename {kibana-opendistro => kibana-odfe}/config/custom_welcome/wazuh_wazuh_bg.svg (100%) rename {kibana-opendistro => kibana-odfe}/config/entrypoint.sh (100%) rename {kibana-opendistro => kibana-odfe}/config/kibana_settings.sh (100%) rename {kibana-opendistro => kibana-odfe}/config/wazuh.yml (100%) rename {kibana-opendistro => kibana-odfe}/config/wazuh_app_config.sh (100%) rename {kibana-opendistro => kibana-odfe}/config/welcome_wazuh.sh (100%) rename {wazuh-opendistro => wazuh-odfe}/Dockerfile (100%) rename {wazuh-opendistro => wazuh-odfe}/config/create_user.py (100%) rename {wazuh-opendistro => wazuh-odfe}/config/etc/cont-init.d/0-wazuh-init (100%) rename {wazuh-opendistro => wazuh-odfe}/config/etc/cont-init.d/1-config-filebeat (100%) rename {wazuh-opendistro => wazuh-odfe}/config/etc/cont-init.d/2-manager (100%) rename {wazuh-opendistro => wazuh-odfe}/config/etc/services.d/filebeat/finish (100%) rename {wazuh-opendistro => wazuh-odfe}/config/etc/services.d/filebeat/run (100%) rename {wazuh-opendistro => wazuh-odfe}/config/filebeat.yml (100%) rename {wazuh-opendistro => wazuh-odfe}/config/permanent_data.env (100%) rename {wazuh-opendistro => wazuh-odfe}/config/permanent_data.sh (100%) rename {wazuh-opendistro => wazuh-odfe}/config/wazuh.repo (100%) diff --git a/docker-compose.yml b/docker-compose.yml index 67fe1c5f..5bf938bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,7 @@ version: '3.7' services: wazuh: - build: wazuh-opendistro/ - image: wazuh-opendistro + image: wazuh/wazuh-odfe:4.0.0 hostname: wazuh-manager restart: always ports: @@ -51,8 +50,7 @@ services: hard: 65536 kibana: - build: kibana-opendistro/ - image: wazuh-kibana-opendistro + image: wazuh/wazuh-kibana-odfe:4.0.0 hostname: kibana restart: always ports: diff --git a/kibana-opendistro/Dockerfile b/kibana-odfe/Dockerfile similarity index 100% rename from kibana-opendistro/Dockerfile rename to kibana-odfe/Dockerfile diff --git a/kibana-opendistro/config/custom_welcome/light_theme.style.css b/kibana-odfe/config/custom_welcome/light_theme.style.css similarity index 100% rename from kibana-opendistro/config/custom_welcome/light_theme.style.css rename to kibana-odfe/config/custom_welcome/light_theme.style.css diff --git a/kibana-opendistro/config/custom_welcome/template.js.hbs b/kibana-odfe/config/custom_welcome/template.js.hbs similarity index 100% rename from kibana-opendistro/config/custom_welcome/template.js.hbs rename to kibana-odfe/config/custom_welcome/template.js.hbs diff --git a/kibana-opendistro/config/custom_welcome/wazuh_logo_circle.svg b/kibana-odfe/config/custom_welcome/wazuh_logo_circle.svg similarity index 100% rename from kibana-opendistro/config/custom_welcome/wazuh_logo_circle.svg rename to kibana-odfe/config/custom_welcome/wazuh_logo_circle.svg diff --git a/kibana-opendistro/config/custom_welcome/wazuh_wazuh_bg.svg b/kibana-odfe/config/custom_welcome/wazuh_wazuh_bg.svg similarity index 100% rename from kibana-opendistro/config/custom_welcome/wazuh_wazuh_bg.svg rename to kibana-odfe/config/custom_welcome/wazuh_wazuh_bg.svg diff --git a/kibana-opendistro/config/entrypoint.sh b/kibana-odfe/config/entrypoint.sh similarity index 100% rename from kibana-opendistro/config/entrypoint.sh rename to kibana-odfe/config/entrypoint.sh diff --git a/kibana-opendistro/config/kibana_settings.sh b/kibana-odfe/config/kibana_settings.sh similarity index 100% rename from kibana-opendistro/config/kibana_settings.sh rename to kibana-odfe/config/kibana_settings.sh diff --git a/kibana-opendistro/config/wazuh.yml b/kibana-odfe/config/wazuh.yml similarity index 100% rename from kibana-opendistro/config/wazuh.yml rename to kibana-odfe/config/wazuh.yml diff --git a/kibana-opendistro/config/wazuh_app_config.sh b/kibana-odfe/config/wazuh_app_config.sh similarity index 100% rename from kibana-opendistro/config/wazuh_app_config.sh rename to kibana-odfe/config/wazuh_app_config.sh diff --git a/kibana-opendistro/config/welcome_wazuh.sh b/kibana-odfe/config/welcome_wazuh.sh similarity index 100% rename from kibana-opendistro/config/welcome_wazuh.sh rename to kibana-odfe/config/welcome_wazuh.sh diff --git a/production-cluster.yml b/production-cluster.yml index ebf003ef..6b537301 100644 --- a/production-cluster.yml +++ b/production-cluster.yml @@ -3,8 +3,7 @@ version: '3.7' services: wazuh-master: - build: wazuh-opendistro/ - image: wazuh-opendistro + image: wazuh/wazuh-odfe:4.0.0 hostname: wazuh-master restart: always ports: @@ -39,8 +38,7 @@ services: - ./production_cluster/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf wazuh-worker: - build: wazuh-opendistro/ - image: wazuh-opendistro + image: wazuh/wazuh-odfe:4.0.0 hostname: wazuh-worker restart: always environment: @@ -134,8 +132,7 @@ services: - ./production_cluster/elastic_opendistro/internal_users.yml:/usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml kibana: - build: kibana-opendistro/ - image: wazuh-kibana-opendistro + image: wazuh/wazuh-kibana-odfe:4.0.0 hostname: kibana restart: always ports: diff --git a/wazuh-opendistro/Dockerfile b/wazuh-odfe/Dockerfile similarity index 100% rename from wazuh-opendistro/Dockerfile rename to wazuh-odfe/Dockerfile diff --git a/wazuh-opendistro/config/create_user.py b/wazuh-odfe/config/create_user.py similarity index 100% rename from wazuh-opendistro/config/create_user.py rename to wazuh-odfe/config/create_user.py diff --git a/wazuh-opendistro/config/etc/cont-init.d/0-wazuh-init b/wazuh-odfe/config/etc/cont-init.d/0-wazuh-init similarity index 100% rename from wazuh-opendistro/config/etc/cont-init.d/0-wazuh-init rename to wazuh-odfe/config/etc/cont-init.d/0-wazuh-init diff --git a/wazuh-opendistro/config/etc/cont-init.d/1-config-filebeat b/wazuh-odfe/config/etc/cont-init.d/1-config-filebeat similarity index 100% rename from wazuh-opendistro/config/etc/cont-init.d/1-config-filebeat rename to wazuh-odfe/config/etc/cont-init.d/1-config-filebeat diff --git a/wazuh-opendistro/config/etc/cont-init.d/2-manager b/wazuh-odfe/config/etc/cont-init.d/2-manager similarity index 100% rename from wazuh-opendistro/config/etc/cont-init.d/2-manager rename to wazuh-odfe/config/etc/cont-init.d/2-manager diff --git a/wazuh-opendistro/config/etc/services.d/filebeat/finish b/wazuh-odfe/config/etc/services.d/filebeat/finish similarity index 100% rename from wazuh-opendistro/config/etc/services.d/filebeat/finish rename to wazuh-odfe/config/etc/services.d/filebeat/finish diff --git a/wazuh-opendistro/config/etc/services.d/filebeat/run b/wazuh-odfe/config/etc/services.d/filebeat/run similarity index 100% rename from wazuh-opendistro/config/etc/services.d/filebeat/run rename to wazuh-odfe/config/etc/services.d/filebeat/run diff --git a/wazuh-opendistro/config/filebeat.yml b/wazuh-odfe/config/filebeat.yml similarity index 100% rename from wazuh-opendistro/config/filebeat.yml rename to wazuh-odfe/config/filebeat.yml diff --git a/wazuh-opendistro/config/permanent_data.env b/wazuh-odfe/config/permanent_data.env similarity index 100% rename from wazuh-opendistro/config/permanent_data.env rename to wazuh-odfe/config/permanent_data.env diff --git a/wazuh-opendistro/config/permanent_data.sh b/wazuh-odfe/config/permanent_data.sh similarity index 100% rename from wazuh-opendistro/config/permanent_data.sh rename to wazuh-odfe/config/permanent_data.sh diff --git a/wazuh-opendistro/config/wazuh.repo b/wazuh-odfe/config/wazuh.repo similarity index 100% rename from wazuh-opendistro/config/wazuh.repo rename to wazuh-odfe/config/wazuh.repo From f56657cdb0a4cfe525c112bdaa9d8c4ab1caeddd Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 18:14:13 +0200 Subject: [PATCH 7/8] Update dir structure --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f829146..d184c144 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ ADMIN_PRIVILEGES=true # App privileges ├── elastic_conf │   └── elasticsearch.yml ├── generate-opendistro-certs.yml - ├── kibana-opendistro + ├── kibana-odfe │   ├── config │   │   ├── custom_welcome │   │   │   ├── light_theme.style.css @@ -126,7 +126,7 @@ ADMIN_PRIVILEGES=true # App privileges ├── production-cluster.yml ├── README.md ├── VERSION - └── wazuh-opendistro + └── wazuh-odfe ├── config │   ├── create_user.py │   ├── etc @@ -145,6 +145,7 @@ ADMIN_PRIVILEGES=true # App privileges └── Dockerfile + ## Branches * `4.0` branch on correspond to the latest Wazuh-Docker stable version. From 9489d6b86f962424330d572676efe1dae34f4d1c Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez <1380243+xr09@users.noreply.github.com> Date: Fri, 23 Oct 2020 18:20:57 +0200 Subject: [PATCH 8/8] Changed section on changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 030f596b..28487ffa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,14 @@ All notable changes to this project will be documented in this file. - Switched to CentOS 7 for base image ([@xr09](https://github.com/xr09)) [#259](https://github.com/wazuh/wazuh-docker/issues/259) - Using s6-overlay for process management ([@xr09](https://github.com/xr09)) [#274](https://github.com/wazuh/wazuh-docker/issues/274) - Allow the creation of custom API users ([@xr09](https://github.com/xr09)) [#395](https://github.com/wazuh/wazuh-docker/issues/395) -- Use official Elastic images ([@xr09](https://github.com/xr09)) [#333](https://github.com/wazuh/wazuh-docker/pull/333) - OpenDistro support ([@xr09](https://github.com/xr09)) [#373](https://github.com/wazuh/wazuh-docker/pull/373) +### Changed + +- Removal of Elastic images + + ## Wazuh Docker v3.13.2_7.9.1 ### Added