From a5013d2cf82e433b73194f4712be38272c155409 Mon Sep 17 00:00:00 2001 From: AlfonsoRBJ Date: Thu, 5 Dec 2019 11:48:15 +0100 Subject: [PATCH] Remove Logstash pipeline customization (#280) Former-commit-id: 2b7171101baca6c96e49183bb8a4fc59e4c505e5 --- logstash/Dockerfile | 5 ++--- logstash/config/01-wazuh.conf | 4 ---- logstash/config/10-entrypoint.sh | 9 ++++----- logstash/config/10-entrypoint_pipeline.sh | 21 --------------------- 4 files changed, 6 insertions(+), 33 deletions(-) delete mode 100644 logstash/config/10-entrypoint_pipeline.sh diff --git a/logstash/Dockerfile b/logstash/Dockerfile index 385b105f..5fce09d1 100644 --- a/logstash/Dockerfile +++ b/logstash/Dockerfile @@ -9,6 +9,7 @@ RUN chmod 755 /entrypoint.sh RUN rm -f /usr/share/logstash/pipeline/logstash.conf +ENV PIPELINE_FROM_FILE="false" COPY config/01-wazuh.conf /usr/share/logstash/pipeline/01-wazuh.conf # This CA is created for testing. Please set your own CA pem signed certificate. @@ -36,11 +37,9 @@ RUN chown -R logstash:logstash /entrypoint-scripts COPY --chown=logstash:logstash ./config/05-decrypt_credentials.sh /entrypoint-scripts/05-decrypt_credentials.sh COPY --chown=logstash:logstash ./config/10-entrypoint.sh /entrypoint-scripts/10-entrypoint.sh COPY --chown=logstash:logstash ./config/10-entrypoint_configuration.sh ./config/10-entrypoint_configuration.sh -COPY --chown=logstash:logstash ./config/10-entrypoint_pipeline.sh ./config/10-entrypoint_pipeline.sh RUN chmod +x /entrypoint-scripts/05-decrypt_credentials.sh && \ chmod +x /entrypoint-scripts/10-entrypoint.sh && \ - chmod +x ./config/10-entrypoint_configuration.sh && \ - chmod +x ./config/10-entrypoint_pipeline.sh + chmod +x ./config/10-entrypoint_configuration.sh USER logstash diff --git a/logstash/config/01-wazuh.conf b/logstash/config/01-wazuh.conf index f51d38ab..ea7b9fdb 100644 --- a/logstash/config/01-wazuh.conf +++ b/logstash/config/01-wazuh.conf @@ -44,9 +44,5 @@ output { elasticsearch { hosts => ["elasticsearch:9200"] index => "wazuh-alerts-3.x-%{+YYYY.MM.dd}" - #user => service_logstash - #password => service_logstash_internal_password - #ssl => true - #cacert => "/path/to/cert.pem" } } diff --git a/logstash/config/10-entrypoint.sh b/logstash/config/10-entrypoint.sh index 491c9b67..a1b9de88 100644 --- a/logstash/config/10-entrypoint.sh +++ b/logstash/config/10-entrypoint.sh @@ -67,8 +67,11 @@ echo "ENTRYPOINT - curl authentication established" if [ "$LOGSTASH_OUTPUT" != "" ]; then >&2 echo "ENTRYPOINT - Customize Logstash ouput ip." - sed -i 's|elasticsearch:9200|'$LOGSTASH_OUTPUT'|g' /usr/share/logstash/pipeline/01-wazuh.conf sed -i 's|http://elasticsearch:9200|'$LOGSTASH_OUTPUT'|g' /usr/share/logstash/config/logstash.yml + + if [[ "$PIPELINE_FROM_FILE" == "false" ]]; then + sed -i 's|elasticsearch:9200|'$LOGSTASH_OUTPUT'|g' /usr/share/logstash/pipeline/01-wazuh.conf + fi fi @@ -101,10 +104,6 @@ if [[ $SECURITY_ENABLED == "yes" ]]; then ## Settings for logstash.yml bash /usr/share/logstash/config/10-entrypoint_configuration.sh - - ## Settings for 01-wazuh.conf - - bash /usr/share/logstash/config/10-entrypoint_pipeline.sh ## Add keys to the keystore echo -e "$LOGSTASH_USER" | /usr/share/logstash/bin/logstash-keystore --path.settings /usr/share/logstash/config add LOGSTASH_KS_USER diff --git a/logstash/config/10-entrypoint_pipeline.sh b/logstash/config/10-entrypoint_pipeline.sh deleted file mode 100644 index 3c232689..00000000 --- a/logstash/config/10-entrypoint_pipeline.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# 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. -# - -set -e - -############################################################################## -# Adapt 01-wazuh.conf pipeline. Adapt pipeline if it is necessary. -############################################################################## - -if [[ $SECURITY_ENABLED == "yes" ]]; then - - echo "PIPELINE - TO DO" - # Settings for 01-wazuh.conf - # TO DO - -fi - \ No newline at end of file