forked from wazuh/wazuh-docker
Added wazuh_app script execution to config.sh file
This commit is contained in:
@@ -8,7 +8,6 @@ ARG INSTALL_DIR=/usr/share/wazuh-dashboard
|
|||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG wazuh_dashboard_url_amd64_rpm
|
ARG wazuh_dashboard_url_amd64_rpm
|
||||||
ARG wazuh_dashboard_url_arm64_rpm
|
ARG wazuh_dashboard_url_arm64_rpm
|
||||||
ARG wazuh_certs_tool
|
|
||||||
ARG wazuh_config_yml
|
ARG wazuh_config_yml
|
||||||
|
|
||||||
# Update and install dependencies
|
# Update and install dependencies
|
||||||
@@ -76,8 +75,7 @@ RUN yum install shadow-utils -y && \
|
|||||||
mkdir -p $INSTALL_DIR && \
|
mkdir -p $INSTALL_DIR && \
|
||||||
chown 1000:1000 $INSTALL_DIR && \
|
chown 1000:1000 $INSTALL_DIR && \
|
||||||
chown 1000:1000 /*.sh && \
|
chown 1000:1000 /*.sh && \
|
||||||
mkdir -p /usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom && \
|
mkdir -p /usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
|
||||||
bash /wazuh_app_config.sh
|
|
||||||
|
|
||||||
# Copy Install dir from builder to current image
|
# Copy Install dir from builder to current image
|
||||||
COPY --from=builder --chown=1000:1000 $INSTALL_DIR $INSTALL_DIR
|
COPY --from=builder --chown=1000:1000 $INSTALL_DIR $INSTALL_DIR
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export OPENSEARCH_DASHBOARDS_HOME=/usr/share/wazuh-dashboard
|
|||||||
export PATH=$OPENSEARCH_DASHBOARDS_HOME/bin:$PATH
|
export PATH=$OPENSEARCH_DASHBOARDS_HOME/bin:$PATH
|
||||||
DASHBOARD_USERNAME="${DASHBOARD_USERNAME:-kibanaserver}"
|
DASHBOARD_USERNAME="${DASHBOARD_USERNAME:-kibanaserver}"
|
||||||
DASHBOARD_PASSWORD="${DASHBOARD_PASSWORD:-kibanaserver}"
|
DASHBOARD_PASSWORD="${DASHBOARD_PASSWORD:-kibanaserver}"
|
||||||
|
export OPENSEARCH_DASHBOARDS_CONFIG=/usr/share/wazuh-dashboard/config/opensearch_dashboards.yml
|
||||||
|
|
||||||
# Create and configure Wazuh dashboard keystore
|
# Create and configure Wazuh dashboard keystore
|
||||||
|
|
||||||
@@ -24,6 +25,8 @@ yes | $OPENSEARCH_DASHBOARDS_HOME/bin/opensearch-dashboards-keystore create --al
|
|||||||
echo $DASHBOARD_USERNAME | $OPENSEARCH_DASHBOARDS_HOME/bin/opensearch-dashboards-keystore add opensearch.username --stdin --allow-root && \
|
echo $DASHBOARD_USERNAME | $OPENSEARCH_DASHBOARDS_HOME/bin/opensearch-dashboards-keystore add opensearch.username --stdin --allow-root && \
|
||||||
echo $DASHBOARD_PASSWORD | $OPENSEARCH_DASHBOARDS_HOME/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root
|
echo $DASHBOARD_PASSWORD | $OPENSEARCH_DASHBOARDS_HOME/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root
|
||||||
|
|
||||||
|
/wazuh_app_config.sh
|
||||||
|
|
||||||
opensearch_dashboards_vars=(
|
opensearch_dashboards_vars=(
|
||||||
opensearch.hosts
|
opensearch.hosts
|
||||||
server.port
|
server.port
|
||||||
|
|||||||
@@ -15,21 +15,6 @@ export CONFIG_DIR=${INSTALLATION_DIR}/config
|
|||||||
|
|
||||||
dashboard_config_file="${CONFIG_DIR}/opensearch_dashboards.yml"
|
dashboard_config_file="${CONFIG_DIR}/opensearch_dashboards.yml"
|
||||||
|
|
||||||
printf "Modifying Wazuh App configuration file: %s\n" "$dashboard_config_file"
|
|
||||||
ls -la ${CONFIG_DIR}
|
|
||||||
|
|
||||||
printf "/etc/wazuh-dashboard contents:\n"
|
|
||||||
ls -la /etc/wazuh-dashboard
|
|
||||||
|
|
||||||
# Modify opensearch_dashboards.yml config paths
|
|
||||||
if [ -d "/etc/wazuh-dashboard" ]; then
|
|
||||||
mkdir -p ${CONFIG_DIR}
|
|
||||||
mkdir -p ${CONFIG_DIR}/certs
|
|
||||||
mv /etc/wazuh-dashboard/* ${CONFIG_DIR}/
|
|
||||||
rmdir /etc/wazuh-dashboard
|
|
||||||
fi
|
|
||||||
sed -i "s|/etc/wazuh-dashboard|${CONFIG_DIR}|g" ${dashboard_config_file}
|
|
||||||
|
|
||||||
declare -A CONFIG_MAP=(
|
declare -A CONFIG_MAP=(
|
||||||
[pattern]=$PATTERN
|
[pattern]=$PATTERN
|
||||||
[checks.pattern]=$CHECKS_PATTERN
|
[checks.pattern]=$CHECKS_PATTERN
|
||||||
|
|||||||
Reference in New Issue
Block a user