Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unattended changes the login screen in kibana [unified] #1033

Merged
merged 4 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions ova/assets/steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions ova/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,4 @@ sh ${UNATTENDED_PATH}/${INSTALLER}
systemctl stop kibana filebeat elasticsearch
systemctl enable wazuh-manager

# Edit installation
postInstall

clean
Original file line number Diff line number Diff line change
@@ -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;
}
18 changes: 18 additions & 0 deletions unattended_scripts/install_functions/opendistro/kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ configureKibanaAIO() {
eval "chmod 440 /etc/kibana/certs/kibana* ${debug}"
eval "setcap 'cap_net_bind_service=+ep' /usr/share/kibana/node/bin/node ${debug}"

modifyKibanaLogin

# Start Kibana
startService "kibana"
}
Expand Down Expand Up @@ -87,6 +89,8 @@ configureKibana() {

logger "Kibana installed."

modifyKibanaLogin

copyKibanacerts
eval "chown -R kibana:kibana /etc/kibana/ ${debug}"
eval "chmod -R 500 /etc/kibana/certs ${debug}"
Expand Down Expand Up @@ -124,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}"
}