Add new path for Wazun indexer and new function for permanent_data exception

This commit is contained in:
Victor Carlos Erenu 2025-11-25 01:22:11 +07:00
parent d52c076e62
commit d69f5c0c5d
No known key found for this signature in database
GPG Key ID: B199E04BCF80C99A
2 changed files with 14 additions and 5 deletions

View File

@ -73,10 +73,10 @@ mkdir -p ${TARGET_DIR}/usr/lib/sysctl.d
mkdir -p ${TARGET_DIR}/usr/lib/systemd/system
mkdir -p ${TARGET_DIR}${CONFIG_DIR}/certs
# Copy Wazuh's config files for the security plugin
cp -pr /roles_mapping.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /roles.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /action_groups.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /internal_users.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /roles_mapping.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
cp -pr /roles.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
cp -pr /action_groups.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
cp -pr /internal_users.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR}
# Copy Wazuh indexer's certificates
cp -pr /wazuh-certificates/demo.indexer.pem ${TARGET_DIR}${CONFIG_DIR}/certs/indexer.pem

View File

@ -70,8 +70,17 @@ apply_exclusion_data() {
mkdir -p ${DIR}
fi
safe_cp() {
if cp -p "$1" "$2" 2>/dev/null; then
return 0
else
echo "Warning: Could not copy $1 (may be read-only)"
return 0
fi
}
print "Updating ${exclusion_file}"
exec_cmd "cp -p ${WAZUH_INSTALL_PATH}/data_tmp/exclusion/${exclusion_file} ${exclusion_file}"
exec_cmd "safe_cp ${WAZUH_INSTALL_PATH}/data_tmp/exclusion/${exclusion_file} ${exclusion_file}"
fi
done
}