Centos7 wazuh (#389)

Former-commit-id: e2911e1f70
This commit is contained in:
Jose Gomez Baena
2020-09-25 18:15:20 +02:00
committed by GitHub
parent 505bf046de
commit 52df98bbb0
5 changed files with 28 additions and 20 deletions

View File

@@ -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 && \

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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