diff --git a/wazuh/Dockerfile b/wazuh/Dockerfile index 6ed086bb..651f205e 100644 --- a/wazuh/Dockerfile +++ b/wazuh/Dockerfile @@ -1,5 +1,5 @@ # Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2) -FROM phusion/baseimage:0.10.2 +FROM waystonesystems/baseimage-centos:0.2.0 # Arguments ARG FILEBEAT_VERSION=7.7.0 @@ -12,23 +12,30 @@ ENV API_USER="foo" \ ARG TEMPLATE_VERSION="v3.13.2" ENV FILEBEAT_DESTINATION="elasticsearch" +RUN rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH + +RUN echo $'[wazuh_repo] \n\ +gpgcheck=1\n\ +gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH\n\ +gpgcheck=0\n\ +enabled=1\n\ +name=Wazuh repository\n\ +baseurl=https://packages.wazuh.com/3.x/yum/\n\ +protect=1\n'\ +>> /etc/yum.repos.d/wazuh.repo + # Install packages RUN set -x && \ - echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list && \ - curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add - && \ - curl --silent --location https://deb.nodesource.com/setup_8.x | bash - && \ - echo "postfix postfix/mailname string wazuh-manager" | debconf-set-selections && \ - echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections && \ + curl -sL https://rpm.nodesource.com/setup_8.x | bash - && \ groupadd -g 1000 ossec && \ useradd -u 1000 -g 1000 -d /var/ossec ossec && \ - add-apt-repository universe && \ - apt-get update && \ - apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get --no-install-recommends --no-install-suggests -y install openssl apt-transport-https vim expect python-boto python-pip python-cryptography && \ - apt-get --no-install-recommends --no-install-suggests -y install postfix bsd-mailx mailutils libsasl2-2 ca-certificates libsasl2-modules && \ - apt-get --no-install-recommends --no-install-suggests -y install wazuh-manager=${WAZUH_VERSION} && \ - apt-get --no-install-recommends --no-install-suggests -y install nodejs wazuh-api=${WAZUH_VERSION} && \ - apt-get clean && \ + yum update -y && \ + yum upgrade -y &&\ + yum install -y openssl vim expect python-boto python-pip python-cryptography && \ + yum install -y postfix bsd-mailx mailx ca-certificates && \ + yum install -y wazuh-manager-${WAZUH_VERSION} && \ + yum install -y nodejs wazuh-api-${WAZUH_VERSION} && \ + yum clean all && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ rm -f /var/ossec/logs/alerts/*/*/* && \ rm -f /var/ossec/logs/archives/*/*/* && \ @@ -37,8 +44,9 @@ RUN set -x && \ rm -f /var/ossec/logs/cluster/*/*/* && \ rm -f /var/ossec/logs/ossec/*/*/* && \ rm /var/ossec/var/run/* && \ - curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${FILEBEAT_VERSION}-amd64.deb && \ - dpkg -i filebeat-${FILEBEAT_VERSION}-amd64.deb && rm -f filebeat-${FILEBEAT_VERSION}-amd64.deb + 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 -f filebeat-${FILEBEAT_VERSION}-x86_64.rpm && \ + sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo # Services RUN mkdir /etc/service/wazuh && \ diff --git a/wazuh/config/filebeat.runit.service b/wazuh/config/filebeat.runit.service index 9b048caa..945aed6c 100644 --- a/wazuh/config/filebeat.runit.service +++ b/wazuh/config/filebeat.runit.service @@ -1,4 +1,4 @@ #!/bin/sh # Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2) -service filebeat start +/etc/init.d/filebeat start tail -f /var/log/filebeat/filebeat diff --git a/wazuh/config/postfix.runit.service b/wazuh/config/postfix.runit.service index e900b5e5..8b22cb16 100644 --- a/wazuh/config/postfix.runit.service +++ b/wazuh/config/postfix.runit.service @@ -1,4 +1,4 @@ #!/bin/sh # Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2) -service postfix start +/usr/sbin/postfix start tail -f /var/log/mail.log diff --git a/wazuh/config/wazuh-api.runit.service b/wazuh/config/wazuh-api.runit.service index 032e3738..09ea1fb2 100644 --- a/wazuh/config/wazuh-api.runit.service +++ b/wazuh/config/wazuh-api.runit.service @@ -1,5 +1,5 @@ #!/bin/sh # Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2) -service wazuh-api start +/etc/init.d/wazuh-api start tail -f /var/ossec/logs/api.log diff --git a/wazuh/config/wazuh.runit.service b/wazuh/config/wazuh.runit.service index c1b5b30e..25534237 100644 --- a/wazuh/config/wazuh.runit.service +++ b/wazuh/config/wazuh.runit.service @@ -1,5 +1,5 @@ #!/bin/sh # Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2) -service wazuh-manager start +/etc/init.d/wazuh-manager start tail -f /var/ossec/logs/ossec.log