forked from wazuh/wazuh-docker
Backport PR #393
This commit is contained in:
@@ -133,6 +133,19 @@ set_custom_hostname() {
|
|||||||
sed -i 's/<node_name>to_be_replaced_by_hostname<\/node_name>/<node_name>'"${HOSTNAME}"'<\/node_name>/g' ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
sed -i 's/<node_name>to_be_replaced_by_hostname<\/node_name>/<node_name>'"${HOSTNAME}"'<\/node_name>/g' ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Allow users to set the container cluster key dynamically on
|
||||||
|
# container start.
|
||||||
|
#
|
||||||
|
# To use this:
|
||||||
|
# 1. Create your own ossec.conf file
|
||||||
|
# 2. In your ossec.conf file, set to_be_replaced_by_cluster_key as your key
|
||||||
|
# 3. Mount your custom ossec.conf file at $WAZUH_CONFIG_MOUNT/etc/ossec.conf
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
set_custom_cluster_key() {
|
||||||
|
sed -i 's/<key>to_be_replaced_by_cluster_key<\/key>/<key>'"${WAZUH_CLUSTER_KEY}"'<\/key>/g' ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
|
}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Main function
|
# Main function
|
||||||
@@ -163,6 +176,9 @@ main() {
|
|||||||
# Allow setting custom hostname
|
# Allow setting custom hostname
|
||||||
set_custom_hostname
|
set_custom_hostname
|
||||||
|
|
||||||
|
# Allow setting custom cluster key
|
||||||
|
set_custom_cluster_key
|
||||||
|
|
||||||
# Delete temporary data folder
|
# Delete temporary data folder
|
||||||
rm -rf ${WAZUH_INSTALL_PATH}/data_tmp
|
rm -rf ${WAZUH_INSTALL_PATH}/data_tmp
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user