From b94bad1bd0e811043a8c5c0642aebecc32f20a48 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 19 Jan 2022 17:20:46 -0300 Subject: [PATCH] Add wazuh-dashboard Dockerfile --- wazuh-dashboard/Dockerfile | 25 +++++++++++++++++++++++ wazuh-dashboard/config/entrypoint.sh | 10 ++++++++++ wazuh-indexer/Dockerfile | 23 ++++++++++----------- wazuh-indexer/Dockerfile_centos | 30 ++++++++++++++++++++++++++++ wazuh-indexer/Dockerfile_ubuntu | 27 ------------------------- 5 files changed, 75 insertions(+), 40 deletions(-) create mode 100644 wazuh-dashboard/Dockerfile create mode 100644 wazuh-dashboard/config/entrypoint.sh create mode 100644 wazuh-indexer/Dockerfile_centos delete mode 100644 wazuh-indexer/Dockerfile_ubuntu diff --git a/wazuh-dashboard/Dockerfile b/wazuh-dashboard/Dockerfile new file mode 100644 index 00000000..d2a14576 --- /dev/null +++ b/wazuh-dashboard/Dockerfile @@ -0,0 +1,25 @@ +# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) +FROM ubuntu:20.04 + +ARG WAZUH_VERSION=4.3.0-1_amd64 +ARG TEMPLATE_VERSION="master" +ARG FILEBEAT_CHANNEL=filebeat-oss +ARG FILEBEAT_VERSION=7.10.2 +ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz" + +RUN apt-get update && apt install curl gnupg -y + +RUN curl https://s3.amazonaws.com/warehouse.wazuh.com/stack/dashboard/stable/wazuh-dashboard_${WAZUH_VERSION}.deb --output wazuh-dashboard_${WAZUH_VERSION}.deb && \ + dpkg -i wazuh-dashboard_${WAZUH_VERSION}.deb + +# Prepare permanent data +# Sync calls are due to https://github.com/docker/docker/issues/9547 + +COPY config/entrypoint.sh / + +RUN chmod 700 /entrypoint.sh + +# Services ports +EXPOSE 5601 443 + +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/wazuh-dashboard/config/entrypoint.sh b/wazuh-dashboard/config/entrypoint.sh new file mode 100644 index 00000000..c221b9c2 --- /dev/null +++ b/wazuh-dashboard/config/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) + +############################################################################## +# Start Wazuh dashboard +############################################################################## + +service wazuh-dashboard start + +service wazuh-dashboard enable diff --git a/wazuh-indexer/Dockerfile b/wazuh-indexer/Dockerfile index bad305d4..5a79630b 100644 --- a/wazuh-indexer/Dockerfile +++ b/wazuh-indexer/Dockerfile @@ -1,24 +1,21 @@ # Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) -FROM centos:7 +FROM ubuntu:20.04 +ARG WAZUH_VERSION=4.3.0 +ARG TEMPLATE_VERSION="master" ARG FILEBEAT_CHANNEL=filebeat-oss ARG FILEBEAT_VERSION=7.10.2 -ARG WAZUH_VERSION=4.3.0-1 -ARG TEMPLATE_VERSION="master" ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz" -USER root +RUN apt-get update && apt install curl gnupg -y -# Set repositories. -RUN rpm --import https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH +RUN curl -s https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH | apt-key add - && \ + echo "deb https://packages-dev.wazuh.com/trash/apt/ unstable main" | tee -a /etc/apt/sources.list.d/wazuh.list && \ + apt-get update && \ + apt-get install wazuh-indexer -COPY config/wazuh.repo /etc/yum.repos.d/wazuh.repo - -RUN yum --enablerepo=updates clean metadata && \ - yum upgrade -y && \ - yum -y install wazuh-indexer -y && \ - sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo && \ - yum clean all && rm -rf /var/cache/yum +# Prepare permanent data +# Sync calls are due to https://github.com/docker/docker/issues/9547 COPY config/entrypoint.sh / diff --git a/wazuh-indexer/Dockerfile_centos b/wazuh-indexer/Dockerfile_centos new file mode 100644 index 00000000..bad305d4 --- /dev/null +++ b/wazuh-indexer/Dockerfile_centos @@ -0,0 +1,30 @@ +# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) +FROM centos:7 + +ARG FILEBEAT_CHANNEL=filebeat-oss +ARG FILEBEAT_VERSION=7.10.2 +ARG WAZUH_VERSION=4.3.0-1 +ARG TEMPLATE_VERSION="master" +ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz" + +USER root + +# Set repositories. +RUN rpm --import https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH + +COPY config/wazuh.repo /etc/yum.repos.d/wazuh.repo + +RUN yum --enablerepo=updates clean metadata && \ + yum upgrade -y && \ + yum -y install wazuh-indexer -y && \ + sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo && \ + yum clean all && rm -rf /var/cache/yum + +COPY config/entrypoint.sh / + +RUN chmod 700 /entrypoint.sh + +# Services ports +EXPOSE 9700 + +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/wazuh-indexer/Dockerfile_ubuntu b/wazuh-indexer/Dockerfile_ubuntu deleted file mode 100644 index 9f538059..00000000 --- a/wazuh-indexer/Dockerfile_ubuntu +++ /dev/null @@ -1,27 +0,0 @@ -# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) -FROM ubuntu:focal - -ARG WAZUH_VERSION=4.3.0 -ARG TEMPLATE_VERSION="master" -ARG FILEBEAT_CHANNEL=filebeat-oss -ARG FILEBEAT_VERSION=7.10.2 -ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz" - -RUN apt-get update && apt install curl gnupg -y - -RUN curl -s https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH | apt-key add - && \ - echo "deb https://packages-dev.wazuh.com/trash/apt/ unstable main" | tee -a /etc/apt/sources.list.d/wazuh.list && \ - apt-get update && \ - apt-get install wazuh-indexer - -# Prepare permanent data -# Sync calls are due to https://github.com/docker/docker/issues/9547 - -RUN chmod 755 /permanent_data.sh && \ - sync && /permanent_data.sh && \ - sync && rm /permanent_data.sh - -# Services ports -EXPOSE 9700 - -ENTRYPOINT [ "/init" ] \ No newline at end of file