diff --git a/CHANGELOG.md b/CHANGELOG.md index cd900438..55d51374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - Adding the option to disable some xpack features. ([#111](https://github.com/wazuh/wazuh-docker/pull/111)) - Wazuh-Kibana customizable at plugin level. ([#117](https://github.com/wazuh/wazuh-docker/pull/117)) - Adding env variables for alerts data flow. ([#118](https://github.com/wazuh/wazuh-docker/pull/118)) +- Welcome screen management. ([#133](https://github.com/wazuh/wazuh-docker/pull/133)) ### Changed diff --git a/kibana/Dockerfile b/kibana/Dockerfile index 8bb08523..92beac63 100644 --- a/kibana/Dockerfile +++ b/kibana/Dockerfile @@ -49,6 +49,7 @@ ARG XPACK_DEVTOOLS="true" ARG XPACK_MONITORING="true" ARG XPACK_APM="true" +ARG CHANGE_WELCOME="false" COPY --chown=kibana:kibana ./config/wazuh_app_config.sh ./ @@ -64,6 +65,12 @@ RUN chmod +x ./xpack_config.sh RUN ./xpack_config.sh +COPY --chown=kibana:kibana ./config/welcome_wazuh.sh ./ + +RUN chmod +x ./welcome_wazuh.sh + +RUN ./welcome_wazuh.sh + RUN /usr/local/bin/kibana-docker --optimize ENTRYPOINT /entrypoint.sh diff --git a/kibana/config/welcome_wazuh.sh b/kibana/config/welcome_wazuh.sh new file mode 100644 index 00000000..0925d57a --- /dev/null +++ b/kibana/config/welcome_wazuh.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [[ $CHANGE_WELCOME == "true" ]] +then + + rm -rf ./optimize/bundles + + kibana_path="/usr/share/kibana" + # Set Wazuh app as the default landing page + echo "Set Wazuh app as the default landing page" + echo "server.defaultRoute: /app/wazuh" >> /usr/share/kibana/config/kibana.yml + + # Redirect Kibana welcome screen to Discover + echo "Redirect Kibana welcome screen to Discover" + sed -i "s:'/app/kibana#/home':'/app/wazuh':g" $kibana_path/src/ui/public/chrome/directives/global_nav/global_nav.html + sed -i "s:'/app/kibana#/home':'/app/wazuh':g" $kibana_path/src/ui/public/chrome/directives/header_global_nav/header_global_nav.js + + # Redirect Kibana welcome screen to Discover + echo "Hide undesired links" + sed -i 's#visible: true#visible: false#g' $kibana_path/node_modules/x-pack/plugins/rollup/public/crud_app/index.js + sed -i 's#visible: true#visible: false#g' $kibana_path/node_modules/x-pack/plugins/license_management/public/management_section.js +fi +