From 2a9a9dce5241009e4841fa5d0d7e3fb8770a4679 Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Thu, 24 Mar 2022 18:59:53 +0100 Subject: [PATCH 1/8] Remove download of demo certificates --- wazuh-dashboard/Dockerfile | 23 ++++------- wazuh-dashboard/config/config.sh | 41 +++++++++++++++++++ wazuh-dashboard/config/config.yml | 5 +++ .../config/opensearch_dashboards.yml | 4 +- wazuh-indexer/config/config.sh | 4 +- 5 files changed, 56 insertions(+), 21 deletions(-) create mode 100644 wazuh-dashboard/config/config.sh create mode 100644 wazuh-dashboard/config/config.yml diff --git a/wazuh-dashboard/Dockerfile b/wazuh-dashboard/Dockerfile index a81579ed..e6fc39e0 100644 --- a/wazuh-dashboard/Dockerfile +++ b/wazuh-dashboard/Dockerfile @@ -11,30 +11,21 @@ RUN apt-get update && apt install curl libcap2-bin xz-utils -y RUN mkdir -p $INSTALL_DIR # Download and extract Wazuh dashboard base -RUN curl -o wazuh-dashboard-base.tar.xz https://packages-dev.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-$WAZUH_VERSION-linux-x64.tar.xz && \ +RUN curl -o wazuh-dashboard-base.tar.xz https://packages.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-linux-x64.tar.xz && \ tar -xf wazuh-dashboard-base.tar.xz --directory $INSTALL_DIR --strip-components=1 -# Download and extract demo certificates -RUN curl -O https://packages-dev.wazuh.com/stack/demo-certs.tar.gz && \ - tar -xf demo-certs.tar.gz && rm -f demo-certs.tar.gz - -# Create certs dir -RUN mkdir -p $INSTALL_DIR/config/certs - -# Copy Wazuh dashboard demo certs to install config dir -RUN cp certs/demo-dashboard.pem $INSTALL_DIR/config/certs/demo-dashboard.pem && \ - cp certs/demo-dashboard-key.pem $INSTALL_DIR/config/certs/demo-dashboard-key.pem && \ - cp certs/root-ca.pem $INSTALL_DIR/config/certs/root-ca.pem - -RUN chmod 640 $INSTALL_DIR/config/certs/* +# Generate certificates +COPY config/config.sh . +COPY config/config.yml / +RUN bash config.sh # Create and configure Wazuh dashboard keystore RUN $INSTALL_DIR/bin/opensearch-dashboards-keystore create --allow-root && \ echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.username --stdin --allow-root && \ echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root -# Install Wazuh App -RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages.wazuh.com/4.x/ui/dashboard/wazuh-$WAZUH_VERSION.zip --allow-root +# Install Wazuh App +RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root # Copy and set permissions to config files COPY config/opensearch_dashboards.yml $INSTALL_DIR/config/ diff --git a/wazuh-dashboard/config/config.sh b/wazuh-dashboard/config/config.sh new file mode 100644 index 00000000..1d2a575a --- /dev/null +++ b/wazuh-dashboard/config/config.sh @@ -0,0 +1,41 @@ +# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) +# This has to be exported to make some magic below work. +export DH_OPTIONS + +export NAME=wazuh-dashboard +export TARGET_DIR=${CURDIR}/debian/${NAME} +export INSTALLATION_DIR=/usr/share/${NAME} +export CONFIG_DIR=${INSTALLATION_DIR}/config + +## Variables +CERT_TOOL=wazuh-certs-tool.sh +PACKAGES_URL=https://packages.wazuh.com/4.3/ +PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.3/ + +## Check if the cert tool exists in S3 buckets +CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}') +CERT_TOOL_PACKAGES_DEV=$(curl --silent -I $PACKAGES_DEV_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}') + +## If cert tool exists in some bucket, download it, if not exit 1 +if [ "$CERT_TOOL_PACKAGES" = "200" ]; then + curl -o $CERT_TOOL $PACKAGES_URL$CERT_TOOL + echo "Cert tool exists in Packages bucket" +elif [ "$CERT_TOOL_PACKAGES_DEV" = "200" ]; then + curl -o $CERT_TOOL $PACKAGES_DEV_URL$CERT_TOOL + echo "Cert tool exists in Packages-dev bucket" +else + echo "Cert tool does not exist in any bucket" + exit 1 +fi + +chmod 755 $CERT_TOOL && bash /$CERT_TOOL -A + +# Copy Wazuh dashboard's certificates +mkdir -p ${CONFIG_DIR}/certs + +# Copy Wazuh dashboard certs to install config dir +cp /wazuh-certificates/demo.dashboard.pem ${CONFIG_DIR}/certs/dashboard.pem +cp /wazuh-certificates/demo.dashboard-key.pem ${CONFIG_DIR}/certs/dashboard-key.pem +cp /wazuh-certificates/root-ca.pem ${CONFIG_DIR}/certs/root-ca.pem + +chmod 640 ${CONFIG_DIR}/certs/* diff --git a/wazuh-dashboard/config/config.yml b/wazuh-dashboard/config/config.yml new file mode 100644 index 00000000..d736a41f --- /dev/null +++ b/wazuh-dashboard/config/config.yml @@ -0,0 +1,5 @@ +nodes: + # Wazuh dashboard server nodes + dashboard: + name: demo.dashboard + ip: demo.dashboard \ No newline at end of file diff --git a/wazuh-dashboard/config/opensearch_dashboards.yml b/wazuh-dashboard/config/opensearch_dashboards.yml index 4b713d5a..f7d70cce 100644 --- a/wazuh-dashboard/config/opensearch_dashboards.yml +++ b/wazuh-dashboard/config/opensearch_dashboards.yml @@ -7,8 +7,8 @@ opensearch_security.multitenancy.enabled: true opensearch_security.multitenancy.tenants.preferred: ["Private", "Global"] opensearch_security.readonly_mode.roles: ["kibana_read_only"] server.ssl.enabled: true -server.ssl.key: "/usr/share/wazuh-dashboard/config/certs/demo-dashboard-key.pem" -server.ssl.certificate: "/usr/share/wazuh-dashboard/config/certs/demo-dashboard.pem" +server.ssl.key: "/usr/share/wazuh-dashboard/config/certs/dashboard-key.pem" +server.ssl.certificate: "/usr/share/wazuh-dashboard/config/certs/dashboard.pem" opensearch.ssl.certificateAuthorities: ["/usr/share/wazuh-dashboard/config/certs/root-ca.pem"] uiSettings.overrides.defaultRoute: /app/wazuh?security_tenant=global diff --git a/wazuh-indexer/config/config.sh b/wazuh-indexer/config/config.sh index ab62b030..a7871579 100644 --- a/wazuh-indexer/config/config.sh +++ b/wazuh-indexer/config/config.sh @@ -97,7 +97,5 @@ cp -pr /roles_mapping.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-se cp -pr /roles.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/securityconfig/ cp -pr /internal_users.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/securityconfig/ cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR} -# Copy Wazuh indexer's demo certificates +# Copy Wazuh indexer's certificates cp -pr /wazuh-certificates/* ${TARGET_DIR}${CONFIG_DIR} - - From b91c1602a68956f45b696fb830b18895a90f6e74 Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Thu, 24 Mar 2022 19:26:29 +0100 Subject: [PATCH 2/8] Added custom images --- docker-compose.yml | 6 +++--- wazuh-dashboard/Dockerfile | 4 ++-- wazuh-indexer/config/config.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 49515e47..2138bc75 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.7' services: wazuh.manager: - image: wazuh/wazuh-manager:4.3.0 + image: wazuh/wazuh-manager:4.3.0-dev hostname: wazuh.manager restart: always ports: @@ -30,7 +30,7 @@ services: - filebeat_var:/var/lib/filebeat wazuh1.indexer: - image: wazuh/wazuh-indexer:4.3.0 + image: wazuh/wazuh-indexer:4.3.0-dev-testing hostname: wazuh1.indexer restart: always ports: @@ -46,7 +46,7 @@ services: hard: 65536 wazuh.dashboard: - image: wazuh/wazuh-dashboard:4.3.0 + image: wazuh/wazuh-dashboard:4.3.0-dev-testing hostname: wazuh.dashboard restart: always ports: diff --git a/wazuh-dashboard/Dockerfile b/wazuh-dashboard/Dockerfile index e6fc39e0..5ccf47cb 100644 --- a/wazuh-dashboard/Dockerfile +++ b/wazuh-dashboard/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt install curl libcap2-bin xz-utils -y RUN mkdir -p $INSTALL_DIR # Download and extract Wazuh dashboard base -RUN curl -o wazuh-dashboard-base.tar.xz https://packages.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-linux-x64.tar.xz && \ +RUN curl -o wazuh-dashboard-base.tar.xz https://packages-dev.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-testing-linux-x64.tar.xz && \ tar -xf wazuh-dashboard-base.tar.xz --directory $INSTALL_DIR --strip-components=1 # Generate certificates @@ -25,7 +25,7 @@ RUN $INSTALL_DIR/bin/opensearch-dashboards-keystore create --allow-root && \ echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root # Install Wazuh App -RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root +RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root # Copy and set permissions to config files COPY config/opensearch_dashboards.yml $INSTALL_DIR/config/ diff --git a/wazuh-indexer/config/config.sh b/wazuh-indexer/config/config.sh index a7871579..f15c2b40 100644 --- a/wazuh-indexer/config/config.sh +++ b/wazuh-indexer/config/config.sh @@ -16,7 +16,7 @@ export INSTALLATION_DIR=/usr/share/${NAME} export CONFIG_DIR=${INSTALLATION_DIR}/config export BASE_DIR=${NAME}-* export INDEXER_FILE=wazuh-indexer-base.tar.xz -export BASE_FILE=wazuh-indexer-base-${VERSION}-linux-x64.tar.xz +export BASE_FILE=wazuh-indexer-base-${VERSION}-testing-linux-x64.tar.xz export REPO_DIR=/unattended_installer From 8765678aaa354864be3958e9d0b4c1495d86b961 Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Thu, 24 Mar 2022 19:28:06 +0100 Subject: [PATCH 3/8] Added custom images --- wazuh-manager/Dockerfile | 4 ++-- wazuh-manager/config/wazuh.repo | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wazuh-manager/Dockerfile b/wazuh-manager/Dockerfile index 1da3d314..4c02a10d 100644 --- a/wazuh-manager/Dockerfile +++ b/wazuh-manager/Dockerfile @@ -8,7 +8,7 @@ ARG TEMPLATE_VERSION="master" ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz" # Set repositories. -RUN rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH +RUN rpm --import https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH COPY config/wazuh.repo /etc/yum.repos.d/wazuh.repo @@ -18,7 +18,7 @@ RUN yum --enablerepo=updates clean metadata && \ sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo && \ yum clean all && rm -rf /var/cache/yum -RUN curl -L -O https://packages.wazuh.com/4.x/yum/${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm &&\ +RUN curl -L -O https://packages-dev.wazuh.com/pre-release/yum/${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm &&\ rpm -i ${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm && rm -f ${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm RUN curl -s https://packages.wazuh.com/4.x/filebeat/${WAZUH_FILEBEAT_MODULE} | tar -xvz -C /usr/share/filebeat/module diff --git a/wazuh-manager/config/wazuh.repo b/wazuh-manager/config/wazuh.repo index e230d6a9..4b673ff0 100644 --- a/wazuh-manager/config/wazuh.repo +++ b/wazuh-manager/config/wazuh.repo @@ -1,7 +1,7 @@ [wazuh_repo] gpgcheck=1 -gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH +gpgkey=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH enabled=1 name=Wazuh repository -baseurl=https://packages.wazuh.com/4.x/yum/ +baseurl=https://packages-dev.wazuh.com/pre-release/yum/ protect=1 From d5191b8f4bd20172acde654deb34c2608d013a39 Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Thu, 24 Mar 2022 20:00:39 +0100 Subject: [PATCH 4/8] Change certs copy --- docker-compose.yml | 4 ++-- wazuh-dashboard/config/config.sh | 2 +- wazuh-indexer/config/config.sh | 7 ++++++- wazuh-indexer/config/opensearch.yml | 10 +++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2138bc75..f3e28d73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,7 @@ services: - filebeat_var:/var/lib/filebeat wazuh1.indexer: - image: wazuh/wazuh-indexer:4.3.0-dev-testing + image: wazuh/wazuh-indexer:4.3.0-dev-test hostname: wazuh1.indexer restart: always ports: @@ -46,7 +46,7 @@ services: hard: 65536 wazuh.dashboard: - image: wazuh/wazuh-dashboard:4.3.0-dev-testing + image: wazuh/wazuh-dashboard:4.3.0-dev-test hostname: wazuh.dashboard restart: always ports: diff --git a/wazuh-dashboard/config/config.sh b/wazuh-dashboard/config/config.sh index 1d2a575a..629a5988 100644 --- a/wazuh-dashboard/config/config.sh +++ b/wazuh-dashboard/config/config.sh @@ -30,7 +30,7 @@ fi chmod 755 $CERT_TOOL && bash /$CERT_TOOL -A -# Copy Wazuh dashboard's certificates +# Create certs directory mkdir -p ${CONFIG_DIR}/certs # Copy Wazuh dashboard certs to install config dir diff --git a/wazuh-indexer/config/config.sh b/wazuh-indexer/config/config.sh index f15c2b40..513bc3b4 100644 --- a/wazuh-indexer/config/config.sh +++ b/wazuh-indexer/config/config.sh @@ -98,4 +98,9 @@ cp -pr /roles.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/s cp -pr /internal_users.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/securityconfig/ cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR} # Copy Wazuh indexer's certificates -cp -pr /wazuh-certificates/* ${TARGET_DIR}${CONFIG_DIR} +cp -pr /wazuh-certificates/demo.indexer.pem ${TARGET_DIR}${CONFIG_DIR}/indexer.pem +cp -pr /wazuh-certificates/demo.indexer-key.pem ${TARGET_DIR}${CONFIG_DIR}/indexer-key.pem +cp -pr /wazuh-certificates/root-ca.key ${TARGET_DIR}${CONFIG_DIR}/root-ca.key +cp -pr /wazuh-certificates/root-ca.pem ${TARGET_DIR}${CONFIG_DIR}/root-ca.pem +cp -pr /wazuh-certificates/admin.pem ${TARGET_DIR}${CONFIG_DIR}/admin.pem +cp -pr /wazuh-certificates/admin-key.pem ${TARGET_DIR}${CONFIG_DIR}/admin-key.pem \ No newline at end of file diff --git a/wazuh-indexer/config/opensearch.yml b/wazuh-indexer/config/opensearch.yml index 765efb62..4cc0d33c 100644 --- a/wazuh-indexer/config/opensearch.yml +++ b/wazuh-indexer/config/opensearch.yml @@ -4,11 +4,11 @@ path.data: /var/lib/wazuh-indexer path.logs: /var/log/wazuh-indexer discovery.type: single-node compatibility.override_main_response_version: true -plugins.security.ssl.http.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/demo.indexer.pem -plugins.security.ssl.http.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/demo.indexer-key.pem +plugins.security.ssl.http.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/indexer.pem +plugins.security.ssl.http.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/indexer-key.pem plugins.security.ssl.http.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/root-ca.pem -plugins.security.ssl.transport.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/demo.indexer.pem -plugins.security.ssl.transport.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/demo.indexer-key.pem +plugins.security.ssl.transport.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/indexer.pem +plugins.security.ssl.transport.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/indexer-key.pem plugins.security.ssl.transport.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/root-ca.pem plugins.security.ssl.http.enabled: true plugins.security.ssl.transport.enforce_hostname_verification: false @@ -19,7 +19,7 @@ plugins.security.authcz.admin_dn: plugins.security.check_snapshot_restore_write_privileges: true plugins.security.enable_snapshot_restore_privilege: true plugins.security.nodes_dn: -- "CN=demo.indexer,OU=Wazuh,O=Wazuh,L=California,C=US" +- "CN=indexer,OU=Wazuh,O=Wazuh,L=California,C=US" plugins.security.restapi.roles_enabled: - "all_access" - "security_rest_api_access" From 95d92d968d9a9bb7c9918e679370145aafec6f7a Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Thu, 24 Mar 2022 20:14:13 +0100 Subject: [PATCH 5/8] Restore certificate node name --- wazuh-indexer/config/opensearch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wazuh-indexer/config/opensearch.yml b/wazuh-indexer/config/opensearch.yml index 4cc0d33c..915fe5a2 100644 --- a/wazuh-indexer/config/opensearch.yml +++ b/wazuh-indexer/config/opensearch.yml @@ -19,7 +19,7 @@ plugins.security.authcz.admin_dn: plugins.security.check_snapshot_restore_write_privileges: true plugins.security.enable_snapshot_restore_privilege: true plugins.security.nodes_dn: -- "CN=indexer,OU=Wazuh,O=Wazuh,L=California,C=US" +- "CN=demo.indexer,OU=Wazuh,O=Wazuh,L=California,C=US" plugins.security.restapi.roles_enabled: - "all_access" - "security_rest_api_access" From a01d921cae75e63a22078a50550aaebe89daa9c9 Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Thu, 24 Mar 2022 20:50:16 +0100 Subject: [PATCH 6/8] Set urls to production --- docker-compose.yml | 6 +++--- wazuh-dashboard/Dockerfile | 4 ++-- wazuh-indexer/config/config.sh | 4 ++-- wazuh-manager/Dockerfile | 4 ++-- wazuh-manager/config/wazuh.repo | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f3e28d73..49515e47 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.7' services: wazuh.manager: - image: wazuh/wazuh-manager:4.3.0-dev + image: wazuh/wazuh-manager:4.3.0 hostname: wazuh.manager restart: always ports: @@ -30,7 +30,7 @@ services: - filebeat_var:/var/lib/filebeat wazuh1.indexer: - image: wazuh/wazuh-indexer:4.3.0-dev-test + image: wazuh/wazuh-indexer:4.3.0 hostname: wazuh1.indexer restart: always ports: @@ -46,7 +46,7 @@ services: hard: 65536 wazuh.dashboard: - image: wazuh/wazuh-dashboard:4.3.0-dev-test + image: wazuh/wazuh-dashboard:4.3.0 hostname: wazuh.dashboard restart: always ports: diff --git a/wazuh-dashboard/Dockerfile b/wazuh-dashboard/Dockerfile index 5ccf47cb..e6fc39e0 100644 --- a/wazuh-dashboard/Dockerfile +++ b/wazuh-dashboard/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt install curl libcap2-bin xz-utils -y RUN mkdir -p $INSTALL_DIR # Download and extract Wazuh dashboard base -RUN curl -o wazuh-dashboard-base.tar.xz https://packages-dev.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-testing-linux-x64.tar.xz && \ +RUN curl -o wazuh-dashboard-base.tar.xz https://packages.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-linux-x64.tar.xz && \ tar -xf wazuh-dashboard-base.tar.xz --directory $INSTALL_DIR --strip-components=1 # Generate certificates @@ -25,7 +25,7 @@ RUN $INSTALL_DIR/bin/opensearch-dashboards-keystore create --allow-root && \ echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root # Install Wazuh App -RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root +RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root # Copy and set permissions to config files COPY config/opensearch_dashboards.yml $INSTALL_DIR/config/ diff --git a/wazuh-indexer/config/config.sh b/wazuh-indexer/config/config.sh index 513bc3b4..701f0266 100644 --- a/wazuh-indexer/config/config.sh +++ b/wazuh-indexer/config/config.sh @@ -16,13 +16,13 @@ export INSTALLATION_DIR=/usr/share/${NAME} export CONFIG_DIR=${INSTALLATION_DIR}/config export BASE_DIR=${NAME}-* export INDEXER_FILE=wazuh-indexer-base.tar.xz -export BASE_FILE=wazuh-indexer-base-${VERSION}-testing-linux-x64.tar.xz +export BASE_FILE=wazuh-indexer-base-${VERSION}-linux-x64.tar.xz export REPO_DIR=/unattended_installer rm -rf ${INSTALLATION_DIR}/ -curl -o ${INDEXER_FILE} https://packages-dev.wazuh.com/stack/indexer/base/${BASE_FILE} +curl -o ${INDEXER_FILE} https://packages.wazuh.com/stack/indexer/base/${BASE_FILE} tar -xf ${INDEXER_FILE} ## TOOLS diff --git a/wazuh-manager/Dockerfile b/wazuh-manager/Dockerfile index 4c02a10d..1da3d314 100644 --- a/wazuh-manager/Dockerfile +++ b/wazuh-manager/Dockerfile @@ -8,7 +8,7 @@ ARG TEMPLATE_VERSION="master" ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz" # Set repositories. -RUN rpm --import https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH +RUN rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH COPY config/wazuh.repo /etc/yum.repos.d/wazuh.repo @@ -18,7 +18,7 @@ RUN yum --enablerepo=updates clean metadata && \ sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo && \ yum clean all && rm -rf /var/cache/yum -RUN curl -L -O https://packages-dev.wazuh.com/pre-release/yum/${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm &&\ +RUN curl -L -O https://packages.wazuh.com/4.x/yum/${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm &&\ rpm -i ${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm && rm -f ${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-x86_64.rpm RUN curl -s https://packages.wazuh.com/4.x/filebeat/${WAZUH_FILEBEAT_MODULE} | tar -xvz -C /usr/share/filebeat/module diff --git a/wazuh-manager/config/wazuh.repo b/wazuh-manager/config/wazuh.repo index 4b673ff0..e230d6a9 100644 --- a/wazuh-manager/config/wazuh.repo +++ b/wazuh-manager/config/wazuh.repo @@ -1,7 +1,7 @@ [wazuh_repo] gpgcheck=1 -gpgkey=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH +gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH enabled=1 name=Wazuh repository -baseurl=https://packages-dev.wazuh.com/pre-release/yum/ +baseurl=https://packages.wazuh.com/4.x/yum/ protect=1 From 066231198c25bcd6fbb51f2115cfdbcb767fb07c Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Fri, 25 Mar 2022 15:09:59 +0100 Subject: [PATCH 7/8] Change packages bucket for base tar file --- wazuh-dashboard/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wazuh-dashboard/Dockerfile b/wazuh-dashboard/Dockerfile index e6fc39e0..8f38685f 100644 --- a/wazuh-dashboard/Dockerfile +++ b/wazuh-dashboard/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt install curl libcap2-bin xz-utils -y RUN mkdir -p $INSTALL_DIR # Download and extract Wazuh dashboard base -RUN curl -o wazuh-dashboard-base.tar.xz https://packages.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-linux-x64.tar.xz && \ +RUN curl -o wazuh-dashboard-base.tar.xz https://packages-dev.wazuh.com/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-linux-x64.tar.xz && \ tar -xf wazuh-dashboard-base.tar.xz --directory $INSTALL_DIR --strip-components=1 # Generate certificates From 862b35881cd7ba88ee8d01054d63467599bfb8ba Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Fri, 25 Mar 2022 19:41:31 +0100 Subject: [PATCH 8/8] Change base file to packages-dev --- wazuh-indexer/config/config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wazuh-indexer/config/config.sh b/wazuh-indexer/config/config.sh index 701f0266..a56a52d7 100644 --- a/wazuh-indexer/config/config.sh +++ b/wazuh-indexer/config/config.sh @@ -22,7 +22,7 @@ export REPO_DIR=/unattended_installer rm -rf ${INSTALLATION_DIR}/ -curl -o ${INDEXER_FILE} https://packages.wazuh.com/stack/indexer/base/${BASE_FILE} +curl -o ${INDEXER_FILE} https://packages-dev.wazuh.com/stack/indexer/base/${BASE_FILE} tar -xf ${INDEXER_FILE} ## TOOLS @@ -103,4 +103,4 @@ cp -pr /wazuh-certificates/demo.indexer-key.pem ${TARGET_DIR}${CONFIG_DIR}/index cp -pr /wazuh-certificates/root-ca.key ${TARGET_DIR}${CONFIG_DIR}/root-ca.key cp -pr /wazuh-certificates/root-ca.pem ${TARGET_DIR}${CONFIG_DIR}/root-ca.pem cp -pr /wazuh-certificates/admin.pem ${TARGET_DIR}${CONFIG_DIR}/admin.pem -cp -pr /wazuh-certificates/admin-key.pem ${TARGET_DIR}${CONFIG_DIR}/admin-key.pem \ No newline at end of file +cp -pr /wazuh-certificates/admin-key.pem ${TARGET_DIR}${CONFIG_DIR}/admin-key.pem