From 4914e7b41ad65006c1173a8cc264f9fcdb20e21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Fri, 26 Apr 2024 14:07:11 +0200 Subject: [PATCH] Fix access denied error during log rotation (#212) --- packaging_scripts/assemble.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packaging_scripts/assemble.sh b/packaging_scripts/assemble.sh index c7b7311c3ebe0..c881ae860dcbb 100755 --- a/packaging_scripts/assemble.sh +++ b/packaging_scripts/assemble.sh @@ -195,6 +195,17 @@ function enable_performance_analyzer() { cp "distribution/packages/src/common/wazuh-indexer-performance-analyzer.service" "${TMP_DIR}"/usr/lib/systemd/system } +# ==== +# Fix https://github.com/wazuh/wazuh-indexer/issues/205 +# ==== +function fix_log_rotation() { + { + echo 'grant {' + echo ' permission java.lang.RuntimePermission "accessUserInformation";' + echo '};' + } >> "${1}/opensearch-performance-analyzer/opensearch_security.policy" +} + # ==== # Move performance-analyzer-rca to its final location # ==== @@ -245,6 +256,7 @@ function assemble_tar() { # Install plugins install_plugins + fix_log_rotation ${PATH_CONF} # Swap configuration files add_configuration_files remove_unneeded_files @@ -284,6 +296,7 @@ function assemble_rpm() { # Install plugins install_plugins + fix_log_rotation ${PATH_CONF} enable_performance_analyzer_rca ${src_path} # Swap configuration files add_configuration_files @@ -337,6 +350,7 @@ function assemble_deb() { # Install plugins install_plugins + fix_log_rotation ${PATH_CONF} enable_performance_analyzer_rca ${src_path} # Swap configuration files add_configuration_files