Patching the Gaps: Essential Kibana Configurations added (#53871)

* adding few environment variiables

Signed-off-by: muhammeddanish <45929712+muhammeddanish@users.noreply.github.com>

* removing the version detais as recommended by github team

Signed-off-by: muhammeddanish <45929712+muhammeddanish@users.noreply.github.com>

* refactoring the code as per the suggestion from bitnami team

Signed-off-by: muhammeddanish <45929712+muhammeddanish@users.noreply.github.com>

* adding the changes to version 7

Signed-off-by: muhammeddanish <45929712+muhammeddanish@users.noreply.github.com>

---------

Signed-off-by: muhammeddanish <45929712+muhammeddanish@users.noreply.github.com>
This commit is contained in:
muhammeddanish
2023-12-19 08:31:06 +01:00
committed by GitHub
parent 808370482c
commit 51b571b430
4 changed files with 68 additions and 4 deletions
@@ -55,6 +55,11 @@ kibana_env_vars=(
KIBANA_ELASTICSEARCH_PORT
KIBANA_PORT_NUMBER
KIBANA_INITSCRIPTS_MAX_RETRIES
KIBANA_SERVER_PUBLICBASEURL
KIBANA_XPACK_SECURITY_ENCRYPTIONKEY
KIBANA_XPACK_REPORTING_ENCRYPTIONKEY
KIBANA_NEWSFEED_ENABLED
KIBANA_ELASTICSEARCH_REQUESTTIMEOUT
)
for env_var in "${kibana_env_vars[@]}"; do
file_env_var="${env_var}_FILE"
@@ -127,6 +132,11 @@ export KIBANA_FORCE_INITSCRIPTS="${KIBANA_FORCE_INITSCRIPTS:-no}"
export SERVER_FORCE_INITSCRIPTS="$KIBANA_FORCE_INITSCRIPTS"
export KIBANA_DISABLE_STRICT_CSP="${KIBANA_DISABLE_STRICT_CSP:-no}"
export SERVER_DISABLE_STRICT_CSP="$KIBANA_DISABLE_STRICT_CSP"
export KIBANA_SERVER_PUBLICBASEURL="${KIBANA_SERVER_PUBLICBASEURL:-}"
export KIBANA_XPACK_SECURITY_ENCRYPTIONKEY="${KIBANA_XPACK_SECURITY_ENCRYPTIONKEY:-}"
export KIBANA_XPACK_REPORTING_ENCRYPTIONKEY="${KIBANA_XPACK_REPORTING_ENCRYPTIONKEY:-}"
export KIBANA_NEWSFEED_ENABLED="${KIBANA_NEWSFEED_ENABLED:-true}"
export KIBANA_ELASTICSEARCH_REQUESTTIMEOUT="${KIBANA_ELASTICSEARCH_REQUESTTIMEOUT:-30000}"
# Kibana server SSL/TLS configuration
export KIBANA_CERTS_DIR="${KIBANA_CERTS_DIR:-${SERVER_CONF_DIR}/certs}"
@@ -211,8 +211,30 @@ kibana_initialize() {
fi
fi
# Override configuration
if [[ "$SERVER_FLAVOR" = "kibana" ]] && is_boolean_yes "$KIBANA_DISABLE_STRICT_CSP"; then
kibana_conf_set "csp.strict" "false" "bool"
if [[ "$SERVER_FLAVOR" = "kibana" ]]; then
if is_boolean_yes "$KIBANA_DISABLE_STRICT_CSP"; then
kibana_conf_set "csp.strict" "false" "bool"
fi
#The publicly available URL that end-users access Kibana at
if ! is_empty_value "$KIBANA_SERVER_PUBLICBASEURL"; then
kibana_conf_set "server.publicBaseUrl" "$KIBANA_SERVER_PUBLICBASEURLL"
fi
#Set an encryption key so that sessions are not invalidated. Use any text string that is 32 characters or longer as the encryption key.
if ! is_empty_value "$KIBANA_XPACK_SECURITY_ENCRYPTIONKEY"; then
kibana_conf_set "xpack.security.encryptionKey" "$KIBANA_XPACK_SECURITY_ENCRYPTIONKEY"
fi
#The static encryption key for reporting. Use an alphanumeric text string that is at least 32 characters. By default, Kibana generates a random key when it starts, which causes pending reports to fail
if ! is_empty_value "$KIBANA_XPACK_REPORTING_ENCRYPTIONKEY"; then
kibana_conf_set "xpack.reporting.encryptionKey" "$KIBANA_XPACK_REPORTING_ENCRYPTIONKEY"
fi
#Controls whether to enable the newsfeed system for the Kibana UI notification center
if ! is_boolean_yes "$KIBANA_NEWSFEED_ENABLED"; then
kibana_conf_set "newsfeed.enabled" "false" "bool"
fi
#Time in milliseconds to wait for responses from the back end or Elasticsearch. This value must be a positive integer. Default: 30000
if [[ "$KIBANA_ELASTICSEARCH_REQUESTTIMEOUT" != "30000" ]]; then
kibana_conf_set "elasticsearch.requestTimeout" "$KIBANA_ELASTICSEARCH_REQUESTTIMEOUT"
fi
fi
# Configure Elasticsearch/Opensearch authentication
@@ -55,6 +55,11 @@ kibana_env_vars=(
KIBANA_ELASTICSEARCH_PORT
KIBANA_PORT_NUMBER
KIBANA_INITSCRIPTS_MAX_RETRIES
KIBANA_SERVER_PUBLICBASEURL
KIBANA_XPACK_SECURITY_ENCRYPTIONKEY
KIBANA_XPACK_REPORTING_ENCRYPTIONKEY
KIBANA_NEWSFEED_ENABLED
KIBANA_ELASTICSEARCH_REQUESTTIMEOUT
)
for env_var in "${kibana_env_vars[@]}"; do
file_env_var="${env_var}_FILE"
@@ -127,6 +132,11 @@ export KIBANA_FORCE_INITSCRIPTS="${KIBANA_FORCE_INITSCRIPTS:-no}"
export SERVER_FORCE_INITSCRIPTS="$KIBANA_FORCE_INITSCRIPTS"
export KIBANA_DISABLE_STRICT_CSP="${KIBANA_DISABLE_STRICT_CSP:-no}"
export SERVER_DISABLE_STRICT_CSP="$KIBANA_DISABLE_STRICT_CSP"
export KIBANA_SERVER_PUBLICBASEURL="${KIBANA_SERVER_PUBLICBASEURL:-}"
export KIBANA_XPACK_SECURITY_ENCRYPTIONKEY="${KIBANA_XPACK_SECURITY_ENCRYPTIONKEY:-}"
export KIBANA_XPACK_REPORTING_ENCRYPTIONKEY="${KIBANA_XPACK_REPORTING_ENCRYPTIONKEY:-}"
export KIBANA_NEWSFEED_ENABLED="${KIBANA_NEWSFEED_ENABLED:-true}"
export KIBANA_ELASTICSEARCH_REQUESTTIMEOUT="${KIBANA_ELASTICSEARCH_REQUESTTIMEOUT:-30000}"
# Kibana server SSL/TLS configuration
export KIBANA_CERTS_DIR="${KIBANA_CERTS_DIR:-${SERVER_CONF_DIR}/certs}"
@@ -211,8 +211,30 @@ kibana_initialize() {
fi
fi
# Override configuration
if [[ "$SERVER_FLAVOR" = "kibana" ]] && is_boolean_yes "$KIBANA_DISABLE_STRICT_CSP"; then
kibana_conf_set "csp.strict" "false" "bool"
if [[ "$SERVER_FLAVOR" = "kibana" ]]; then
if is_boolean_yes "$KIBANA_DISABLE_STRICT_CSP"; then
kibana_conf_set "csp.strict" "false" "bool"
fi
#The publicly available URL that end-users access Kibana at
if ! is_empty_value "$KIBANA_SERVER_PUBLICBASEURL"; then
kibana_conf_set "server.publicBaseUrl" "$KIBANA_SERVER_PUBLICBASEURLL"
fi
#Set an encryption key so that sessions are not invalidated. Use any text string that is 32 characters or longer as the encryption key.
if ! is_empty_value "$KIBANA_XPACK_SECURITY_ENCRYPTIONKEY"; then
kibana_conf_set "xpack.security.encryptionKey" "$KIBANA_XPACK_SECURITY_ENCRYPTIONKEY"
fi
#The static encryption key for reporting. Use an alphanumeric text string that is at least 32 characters. By default, Kibana generates a random key when it starts, which causes pending reports to fail
if ! is_empty_value "$KIBANA_XPACK_REPORTING_ENCRYPTIONKEY"; then
kibana_conf_set "xpack.reporting.encryptionKey" "$KIBANA_XPACK_REPORTING_ENCRYPTIONKEY"
fi
#Controls whether to enable the newsfeed system for the Kibana UI notification center
if ! is_boolean_yes "$KIBANA_NEWSFEED_ENABLED"; then
kibana_conf_set "newsfeed.enabled" "false" "bool"
fi
#Time in milliseconds to wait for responses from the back end or Elasticsearch. This value must be a positive integer. Default: 30000
if [[ "$KIBANA_ELASTICSEARCH_REQUESTTIMEOUT" != "30000" ]]; then
kibana_conf_set "elasticsearch.requestTimeout" "$KIBANA_ELASTICSEARCH_REQUESTTIMEOUT"
fi
fi
# Configure Elasticsearch/Opensearch authentication