From 3d90bae045d6a34857d20c537bdb5870d3e2aa97 Mon Sep 17 00:00:00 2001 From: verdx Date: Wed, 1 Dec 2021 13:44:16 +0100 Subject: [PATCH 1/3] Unattended installation now changes the kibana login screen --- ova/assets/steps.sh | 17 ---------------- ova/provision.sh | 3 --- .../install_functions/opendistro/kibana.sh | 20 +++++++++++++++++++ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ova/assets/steps.sh b/ova/assets/steps.sh index c8a3d12719..b0fff1d9a4 100644 --- a/ova/assets/steps.sh +++ b/ova/assets/steps.sh @@ -81,23 +81,6 @@ preInstall() { } -# Edit wazuh installation -postInstall() { - - # Edit window title - sed -i "s/null, \"Elastic\"/null, \"Wazuh\"/g" /usr/share/kibana/src/core/server/rendering/views/template.js - - curl -so ${CUSTOM_PATH}/custom_welcome.tar.gz https://wazuh-demo.s3-us-west-1.amazonaws.com/custom_welcome_opendistro_docker.tar.gz - tar -xf ${CUSTOM_PATH}/custom_welcome.tar.gz -C ${CUSTOM_PATH} - cp ${CUSTOM_PATH}/custom_welcome/wazuh_logo_circle.svg /usr/share/kibana/src/core/server/core_app/assets/ - cp ${CUSTOM_PATH}/custom_welcome/wazuh_wazuh_bg.svg /usr/share/kibana/src/core/server/core_app/assets/ - cp ${CUSTOM_PATH}/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs - - # Add custom css in kibana - less ${CUSTOM_PATH}/customWelcomeKibana.css >> /usr/share/kibana/src/core/server/core_app/assets/legacy_light_theme.css - -} - clean() { rm /securityadmin_demo.sh diff --git a/ova/provision.sh b/ova/provision.sh index a297ef6faa..55dca5fb1a 100755 --- a/ova/provision.sh +++ b/ova/provision.sh @@ -29,7 +29,4 @@ sh ${UNATTENDED_PATH}/${INSTALLER} systemctl stop kibana filebeat elasticsearch systemctl enable wazuh-manager -# Edit installation -postInstall - clean diff --git a/unattended_scripts/install_functions/opendistro/kibana.sh b/unattended_scripts/install_functions/opendistro/kibana.sh index 85cb4a6016..13619f38c7 100644 --- a/unattended_scripts/install_functions/opendistro/kibana.sh +++ b/unattended_scripts/install_functions/opendistro/kibana.sh @@ -37,6 +37,16 @@ configureKibanaAIO() { eval "chmod 440 /etc/kibana/certs/kibana* ${debug}" eval "setcap 'cap_net_bind_service=+ep' /usr/share/kibana/node/bin/node ${debug}" + # Edit window title + eval "sed -i 's/null, \"Elastic\"/null, \"Wazuh\"/g' /usr/share/kibana/src/core/server/rendering/views/template.js ${debug}" + eval "curl -so ~/custom_welcome.tar.gz https://wazuh-demo.s3-us-west-1.amazonaws.com/custom_welcome_opendistro_docker.tar.gz ${debug}" + eval "tar -xf ~/custom_welcome.tar.gz -C ~ ${debug}" + eval "cp ~/custom_welcome/wazuh_logo_circle.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" + eval "cp ~/custom_welcome/wazuh_wazuh_bg.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" + eval "cp -f ~/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs ${debug}" + eval "curl -so ~/customWelcomeKibana.css ${resources}/open-distro/kibana/customWelcomeKibana.css ${debug}" + eval "cat ~/customWelcomeKibana.css | tee -a /usr/share/kibana/src/core/server/core_app/assets/legacy_light_theme.css ${debug}" + # Start Kibana startService "kibana" } @@ -80,6 +90,16 @@ configureKibana() { logger "Kibana installed." + # Edit window title + eval "sed -i 's/null, \"Elastic\"/null, \"Wazuh\"/g' /usr/share/kibana/src/core/server/rendering/views/template.js ${debug}" + eval "curl -so ~/custom_welcome.tar.gz https://wazuh-demo.s3-us-west-1.amazonaws.com/custom_welcome_opendistro_docker.tar.gz ${debug}" + eval "tar -xf ~/custom_welcome.tar.gz -C ~ ${debug}" + eval "cp ~/custom_welcome/wazuh_logo_circle.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" + eval "cp ~/custom_welcome/wazuh_wazuh_bg.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" + eval "cp -f ~/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs ${debug}" + eval "curl -so ~/customWelcomeKibana.css ${resources}/open-distro/kibana/customWelcomeKibana.css ${debug}" + eval "cat ~/customWelcomeKibana.css | tee -a /usr/share/kibana/src/core/server/core_app/assets/legacy_light_theme.css ${debug}" + copyKibanacerts initializeKibana kip } From a643a765e31c90d4c53f0ac62db2938fa611e33c Mon Sep 17 00:00:00 2001 From: verdx Date: Wed, 1 Dec 2021 13:47:10 +0100 Subject: [PATCH 2/3] Added customWelcomeKibana.css to change kibana login screen --- .../opendistro/kibana/customWelcomeKibana.css | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 unattended_scripts/config/opendistro/kibana/customWelcomeKibana.css diff --git a/unattended_scripts/config/opendistro/kibana/customWelcomeKibana.css b/unattended_scripts/config/opendistro/kibana/customWelcomeKibana.css new file mode 100644 index 0000000000..597b7d38b9 --- /dev/null +++ b/unattended_scripts/config/opendistro/kibana/customWelcomeKibana.css @@ -0,0 +1,65 @@ +/*------------- WAZUH -------------*/ +.wz-login { + background: url(./wazuh_wazuh_bg.svg) !important; + width: 100% !important; + height: 100% !important; + background-size: cover !important; +} + +.login-wrapper { + text-align: center; + width: 430px!important; + top: 55px; + border-radius: 1px; + padding: 1em; +} + +#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul > div.euiText.euiText--medium > div { + text-align: center; + padding-bottom: 10px; + color: #ffffff !important; + font-size: 35px !important; + font-weight: 300; +} + +#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul > div.euiText.euiText--small > div { + text-align: center; + padding-bottom: 15px; + color: #ffffff !important; + font-size: 16px !important; +} + +#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul > form { + padding: 16px; + box-shadow: 0 2px 2px -1px rgba(152, 162, 179, 0.3), 0 1px 5px -2px rgba(152, 162, 179, 0.3); + background-color: #FFF; + border: 1px solid #D3DAE6; + border-radius: 4px; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + margin-top: 32px; +} + +.loginWelcome__logo { + display: inline-block; + width: 80px; + height: 80px; + line-height: 80px; + text-align: center; + background-color: #FFF; + border-radius: 100%; + padding: 16px; + box-shadow: 0 6px 12px -1px rgba(152, 162, 179, 0.2), 0 4px 4px -1px rgba(152, 162, 179, 0.2), 0 2px 2px 0 rgba(152, 162, 179, 0.2); + margin-bottom: 32px; +} + +div.euiFormRow > div.euiFormRow__fieldWrapper > button { + background-color: #00a9e5!important; + border-color: #00a9e5!important; + color: #fff; +} + +.loginWelcome__logo { + background: url(./wazuh_logo_circle.svg) center center no-repeat !important; +} \ No newline at end of file From 2410e85817123d565e41a46c548b0b1f959c461f Mon Sep 17 00:00:00 2001 From: verdx Date: Tue, 14 Dec 2021 15:15:47 +0100 Subject: [PATCH 3/3] Created function modifyKibanaLogin to avoid repetition Signed-off-by: verdx --- .../install_functions/opendistro/kibana.sh | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/unattended_scripts/install_functions/opendistro/kibana.sh b/unattended_scripts/install_functions/opendistro/kibana.sh index 8150034062..d2a3695230 100644 --- a/unattended_scripts/install_functions/opendistro/kibana.sh +++ b/unattended_scripts/install_functions/opendistro/kibana.sh @@ -44,15 +44,7 @@ configureKibanaAIO() { eval "chmod 440 /etc/kibana/certs/kibana* ${debug}" eval "setcap 'cap_net_bind_service=+ep' /usr/share/kibana/node/bin/node ${debug}" - # Edit window title - eval "sed -i 's/null, \"Elastic\"/null, \"Wazuh\"/g' /usr/share/kibana/src/core/server/rendering/views/template.js ${debug}" - eval "curl -so ~/custom_welcome.tar.gz https://wazuh-demo.s3-us-west-1.amazonaws.com/custom_welcome_opendistro_docker.tar.gz ${debug}" - eval "tar -xf ~/custom_welcome.tar.gz -C ~ ${debug}" - eval "cp ~/custom_welcome/wazuh_logo_circle.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" - eval "cp ~/custom_welcome/wazuh_wazuh_bg.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" - eval "cp -f ~/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs ${debug}" - eval "curl -so ~/customWelcomeKibana.css ${resources}/open-distro/kibana/customWelcomeKibana.css ${debug}" - eval "cat ~/customWelcomeKibana.css | tee -a /usr/share/kibana/src/core/server/core_app/assets/legacy_light_theme.css ${debug}" + modifyKibanaLogin # Start Kibana startService "kibana" @@ -97,16 +89,8 @@ configureKibana() { logger "Kibana installed." - # Edit window title - eval "sed -i 's/null, \"Elastic\"/null, \"Wazuh\"/g' /usr/share/kibana/src/core/server/rendering/views/template.js ${debug}" - eval "curl -so ~/custom_welcome.tar.gz https://wazuh-demo.s3-us-west-1.amazonaws.com/custom_welcome_opendistro_docker.tar.gz ${debug}" - eval "tar -xf ~/custom_welcome.tar.gz -C ~ ${debug}" - eval "cp ~/custom_welcome/wazuh_logo_circle.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" - eval "cp ~/custom_welcome/wazuh_wazuh_bg.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" - eval "cp -f ~/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs ${debug}" - eval "curl -so ~/customWelcomeKibana.css ${resources}/open-distro/kibana/customWelcomeKibana.css ${debug}" - eval "cat ~/customWelcomeKibana.css | tee -a /usr/share/kibana/src/core/server/core_app/assets/legacy_light_theme.css ${debug}" - + modifyKibanaLogin + copyKibanacerts eval "chown -R kibana:kibana /etc/kibana/ ${debug}" eval "chmod -R 500 /etc/kibana/certs ${debug}" @@ -144,3 +128,17 @@ initializeKibana() { logger $'\nYou can access the web interface https://'${kip}'. The credentials are admin:admin' } + +modifyKibanaLogin() { + # Edit window title + eval "sed -i 's/null, \"Elastic\"/null, \"Wazuh\"/g' /usr/share/kibana/src/core/server/rendering/views/template.js ${debug}" + + # Edit background and logos + eval "curl -so ~/custom_welcome.tar.gz https://wazuh-demo.s3-us-west-1.amazonaws.com/custom_welcome_opendistro_docker.tar.gz ${debug}" + eval "tar -xf ~/custom_welcome.tar.gz -C ~ ${debug}" + eval "cp ~/custom_welcome/wazuh_logo_circle.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" + eval "cp ~/custom_welcome/wazuh_wazuh_bg.svg /usr/share/kibana/src/core/server/core_app/assets/ ${debug}" + eval "cp -f ~/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs ${debug}" + eval "curl -so ~/customWelcomeKibana.css ${resources}/open-distro/kibana/customWelcomeKibana.css ${debug}" + eval "cat ~/customWelcomeKibana.css | tee -a /usr/share/kibana/src/core/server/core_app/assets/legacy_light_theme.css ${debug}" +}