diff --git a/LICENSE b/LICENSE index b63808b6..04fb7afc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - Portions Copyright (C) 2018 Wazuh, Inc. + Portions Copyright (C) 2019 Wazuh, Inc. Based on work Copyright (C) 2003 - 2013 Trend Micro, Inc. This program is a free software; you can redistribute it and/or modify diff --git a/README.md b/README.md index d1ea97b6..3760f61e 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ We thank you them and everyone else who has contributed to this project. ## License and copyright -Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) ## Web references diff --git a/docker-compose.yml b/docker-compose.yml index 4db45ae2..c4cc56bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) version: '2' services: diff --git a/kibana/Dockerfile b/kibana/Dockerfile index 6816c5ba..8bb08523 100644 --- a/kibana/Dockerfile +++ b/kibana/Dockerfile @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) FROM docker.elastic.co/kibana/kibana:6.5.4 ARG WAZUH_APP_VERSION=3.8.2_6.5.4 USER root diff --git a/kibana/config/entrypoint.sh b/kibana/config/entrypoint.sh index e34029b7..c38bb1d7 100644 --- a/kibana/config/entrypoint.sh +++ b/kibana/config/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) set -e diff --git a/kibana/config/kibana.yml b/kibana/config/kibana.yml deleted file mode 100644 index 993ad7da..00000000 --- a/kibana/config/kibana.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Kibana is served by a back end server. This setting specifies the port to use. -server.port: 5601 - -# This setting specifies the IP address of the back end server. -server.host: "0.0.0.0" - -# Enables you to specify a path to mount Kibana at if you are running behind a proxy. This setting -# cannot end in a slash. -# server.basePath: "" - -# The maximum payload size in bytes for incoming server requests. -# server.maxPayloadBytes: 1048576 - -# The Kibana server's name. This is used for display purposes. -# server.name: "your-hostname" - -# The URL of the Elasticsearch instance to use for all your queries. -elasticsearch.url: "http://elasticsearch:9200" - -# When this setting’s value is true Kibana uses the hostname specified in the server.host -# setting. When the value of this setting is false, Kibana uses the hostname of the host -# that connects to this Kibana instance. -# elasticsearch.preserveHost: true - -# Kibana uses an index in Elasticsearch to store saved searches, visualizations and -# dashboards. Kibana creates a new index if the index doesn’t already exist. -# kibana.index: ".kibana" - -# The default application to load. -# kibana.defaultAppId: "discover" - -# If your Elasticsearch is protected with basic authentication, these settings provide -# the username and password that the Kibana server uses to perform maintenance on the Kibana -# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which -# is proxied through the Kibana server. -# elasticsearch.username: "user" -# elasticsearch.password: "pass" - -# Paths to the PEM-format SSL certificate and SSL key files, respectively. These -# files enable SSL for outgoing requests from the Kibana server to the browser. -# server.ssl.cert: /path/to/your/server.crt -# server.ssl.key: /path/to/your/server.key - -# Optional settings that provide the paths to the PEM-format SSL certificate and key files. -# These files validate that your Elasticsearch backend uses the same key files. -# elasticsearch.ssl.cert: /path/to/your/client.crt -# elasticsearch.ssl.key: /path/to/your/client.key - -# Optional setting that enables you to specify a path to the PEM file for the certificate -# authority for your Elasticsearch instance. -# elasticsearch.ssl.ca: /path/to/your/CA.pem - -# To disregard the validity of SSL certificates, change this setting’s value to false. -# elasticsearch.ssl.verify: true - -# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the value of -# the elasticsearch.requestTimeout setting. -# elasticsearch.pingTimeout: 1500 - -# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value -# must be a positive integer. -# elasticsearch.requestTimeout: 30000 - -# List of Kibana client-side headers to send to Elasticsearch. To send *no* client-side -# headers, set this value to [] (an empty list). -# elasticsearch.requestHeadersWhitelist: [ authorization ] - -# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable. -# elasticsearch.shardTimeout: 0 - -# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying. -# elasticsearch.startupTimeout: 5000 - -# Specifies the path where Kibana creates the process ID file. -# pid.file: /var/run/kibana.pid - -# Enables you specify a file where Kibana stores log output. -# logging.dest: stdout - -# Set the value of this setting to true to suppress all logging output. -# logging.silent: false - -# Set the value of this setting to true to suppress all logging output other than error messages. -logging.quiet: true - -# Set the value of this setting to true to log all events, including system usage information -# and all requests. -# logging.verbose: false - -# Set the interval in milliseconds to sample system and process performance -# metrics. Minimum is 100ms. Defaults to 10000. -# ops.interval: 10000 diff --git a/kibana/config/wazuh_app_config.sh b/kibana/config/wazuh_app_config.sh index a545cba7..6fffd005 100644 --- a/kibana/config/wazuh_app_config.sh +++ b/kibana/config/wazuh_app_config.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) kibana_config_file="/usr/share/kibana/plugins/wazuh/config.yml" diff --git a/logstash/Dockerfile b/logstash/Dockerfile index e0beeb68..00322375 100644 --- a/logstash/Dockerfile +++ b/logstash/Dockerfile @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) FROM docker.elastic.co/logstash/logstash:6.5.4 RUN rm -f /usr/share/logstash/pipeline/logstash.conf diff --git a/logstash/config/01-wazuh.conf b/logstash/config/01-wazuh.conf index a8dddca4..791cfd3f 100644 --- a/logstash/config/01-wazuh.conf +++ b/logstash/config/01-wazuh.conf @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) # Wazuh - Logstash configuration file ## Remote Wazuh Manager - Filebeat input input { diff --git a/logstash/config/run.sh b/logstash/config/run.sh index a10d3e3c..0ccb2eee 100644 --- a/logstash/config/run.sh +++ b/logstash/config/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) # # OSSEC container bootstrap. See the README for information of the environment # variables expected by this script. diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 0fb940e1..9ed0950e 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) FROM nginx:latest ENV DEBIAN_FRONTEND noninteractive diff --git a/nginx/config/entrypoint.sh b/nginx/config/entrypoint.sh index 2332222b..a6eeec9e 100644 --- a/nginx/config/entrypoint.sh +++ b/nginx/config/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) set -e diff --git a/wazuh/Dockerfile b/wazuh/Dockerfile index 56b0b982..1031c1d0 100644 --- a/wazuh/Dockerfile +++ b/wazuh/Dockerfile @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) FROM phusion/baseimage:latest ARG FILEBEAT_VERSION=6.5.4 ARG WAZUH_VERSION=3.8.2-1 @@ -6,50 +6,34 @@ ARG WAZUH_VERSION=3.8.2-1 ENV API_USER="foo" \ API_PASS="bar" -# Updating image -RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" +# Set repositories. +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 && \ + groupadd -g 1000 ossec && useradd -u 1000 -g 1000 -d /var/ossec ossec -# Set Wazuh repository. -RUN echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list -RUN curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add - +RUN 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 postfix bsd-mailx python-boto python-pip \ + apt-transport-https vim expect nodejs python-cryptography mailutils libsasl2-modules wazuh-manager=${WAZUH_VERSION} \ + wazuh-api=${WAZUH_VERSION} && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -# Set nodejs repository. -RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash - - -# Creating ossec user as uid:gid 1000:1000 -RUN groupadd -g 1000 ossec -RUN useradd -u 1000 -g 1000 -d /var/ossec ossec - -# Configure postfix -RUN echo "postfix postfix/mailname string wazuh-manager" | debconf-set-selections -RUN echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections - -# Add universe repository -RUN add-apt-repository universe - -# Install packages -RUN apt-get update && apt-get -y install openssl postfix bsd-mailx python-boto python-pip \ - apt-transport-https vim expect nodejs python-cryptography wazuh-manager=${WAZUH_VERSION} \ - wazuh-api=${WAZUH_VERSION} mailutils libsasl2-modules - -# Adding first run script. -ADD config/data_dirs.env /data_dirs.env -ADD config/init.bash /init.bash +# Adding first run script and entrypoint +COPY config/data_dirs.env /data_dirs.env +COPY config/init.bash /init.bash +COPY config/entrypoint.sh /entrypoint.sh # Sync calls are due to https://github.com/docker/docker/issues/9547 -RUN chmod 755 /init.bash &&\ - sync && /init.bash &&\ - sync && rm /init.bash +RUN chmod 755 /init.bash && \ + sync && /init.bash && \ + sync && rm /init.bash && \ + 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 && \ + chmod 755 /entrypoint.sh -# Installing and configuring fiebeat -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 COPY config/filebeat.yml /etc/filebeat/ -RUN chmod go-w /etc/filebeat/filebeat.yml - -# Adding entrypoint -ADD config/entrypoint.sh /entrypoint.sh -RUN chmod 755 /entrypoint.sh +RUN chmod go-w /etc/filebeat/filebeat.yml # Setting volumes VOLUME ["/var/ossec/data"] @@ -60,25 +44,22 @@ VOLUME ["/var/lib/filebeat"] # Services ports EXPOSE 55000/tcp 1514/udp 1515/tcp 514/udp 1516/tcp -# Clean up -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - # Adding services -RUN mkdir /etc/service/wazuh +RUN mkdir /etc/service/wazuh && \ + mkdir /etc/service/wazuh-api && \ + mkdir /etc/service/postfix && \ + mkdir /etc/service/filebeat + COPY config/wazuh.runit.service /etc/service/wazuh/run -RUN chmod +x /etc/service/wazuh/run - -RUN mkdir /etc/service/wazuh-api COPY config/wazuh-api.runit.service /etc/service/wazuh-api/run -RUN chmod +x /etc/service/wazuh-api/run - -RUN mkdir /etc/service/postfix COPY config/postfix.runit.service /etc/service/postfix/run -RUN chmod +x /etc/service/postfix/run - -RUN mkdir /etc/service/filebeat COPY config/filebeat.runit.service /etc/service/filebeat/run -RUN chmod +x /etc/service/filebeat/run + +RUN chmod +x /etc/service/wazuh-api/run && \ + chmod +x /etc/service/wazuh/run && \ + chmod +x /etc/service/postfix/run && \ + chmod +x /etc/service/filebeat/run # Run all services ENTRYPOINT ["/entrypoint.sh"] + diff --git a/wazuh/config/entrypoint.sh b/wazuh/config/entrypoint.sh index 37b37be2..67107f55 100644 --- a/wazuh/config/entrypoint.sh +++ b/wazuh/config/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) # # OSSEC container bootstrap. See the README for information of the environment diff --git a/wazuh/config/filebeat.yml b/wazuh/config/filebeat.yml index fcb32e1e..1835863b 100644 --- a/wazuh/config/filebeat.yml +++ b/wazuh/config/filebeat.yml @@ -1,4 +1,4 @@ -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) filebeat: prospectors: - type: log diff --git a/wazuh/config/init.bash b/wazuh/config/init.bash index 21306499..cfff523d 100644 --- a/wazuh/config/init.bash +++ b/wazuh/config/init.bash @@ -1,5 +1,5 @@ #!/bin/bash -# Wazuh App Copyright (C) 2018 Wazuh Inc. (License GPLv2) +# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) # # Initialize the custom data directory layout