Update config and certs path

This commit is contained in:
vcerenu
2022-03-04 18:20:15 -03:00
parent 8e42f30b19
commit 9f1dec3338
17 changed files with 818 additions and 70 deletions
+6 -5
View File
@@ -6,12 +6,12 @@ umask 0002
export USER=wazuh-indexer
export INSTALLATION_DIR=/usr/share/wazuh-indexer
export OPENSEARCH_PATH_CONF=/etc/wazuh-indexer
export OPENSEARCH_PATH_CONF=${INSTALLATION_DIR}/config
export JAVA_HOME=${INSTALLATION_DIR}/jdk
export DISCOVERY=$(grep -oP "(?<=discovery.type: ).*" /etc/wazuh-indexer/opensearch.yml)
export CACERT=$(grep -oP "(?<=plugins.security.ssl.transport.pemtrustedcas_filepath: ).*" /etc/wazuh-indexer/opensearch.yml)
export CERT="/etc/wazuh-indexer/certs/admin.pem"
export KEY="/etc/wazuh-indexer/certs/admin-key.pem"
export DISCOVERY=$(grep -oP "(?<=discovery.type: ).*" ${OPENSEARCH_PATH_CONF}/opensearch.yml)
export CACERT=$(grep -oP "(?<=plugins.security.ssl.transport.pemtrustedcas_filepath: ).*" ${OPENSEARCH_PATH_CONF}/opensearch.yml)
export CERT="${OPENSEARCH_PATH_CONF}/admin.pem"
export KEY="${OPENSEARCH_PATH_CONF}/admin-key.pem"
run_as_other_user_if_needed() {
if [[ "$(id -u)" == "0" ]]; then
@@ -83,6 +83,7 @@ if [[ "$(id -u)" == "0" ]]; then
fi
fi
if [[ "$DISCOVERY" == "single-node" ]]; then
# run securityadmin.sh for single node with CACERT, CERT and KEY parameter
nohup /securityadmin.sh &