modify uid and giufor indexer and dashboard user and file permissions

This commit is contained in:
vcerenu
2024-03-04 07:51:00 -03:00
parent b274806f60
commit 6e7e8525bb
6 changed files with 24 additions and 34 deletions
@@ -34,7 +34,7 @@ if [[ "$1" != "opensearchwrapper" ]]; then
# `bin/opensearch -E x.y=z` would not work.
set -- "opensearch" "${@:2}"
# Use chroot to switch to UID 1000 / GID 0
exec chroot --userspec=1000:0 / "$@"
exec chroot --userspec=999:0 / "$@"
else
# User probably wants to run something else, like /bin/bash, with another uid forced (Openshift?)
exec "$@"
@@ -79,7 +79,7 @@ fi
if [[ "$(id -u)" == "0" ]]; then
# If requested and running as root, mutate the ownership of bind-mounts
if [[ -n "$TAKE_FILE_OWNERSHIP" ]]; then
chown -R 1000:0 /usr/share/wazuh-indexer/{data,logs}
chown -R 999:0 /usr/share/wazuh-indexer/{data,logs}
fi
fi