Skip to content

Commit

Permalink
Assign wazuh-indexer group and user as owner of the keystore file
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Dec 20, 2024
1 parent 9fb8d0c commit 25e5770
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions build-scripts/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,12 @@ function assemble_deb() {
# Copy spec
cp "distribution/packages/src/deb/Makefile" "${TMP_DIR}"
cp "distribution/packages/src/deb/debmake_install.sh" "${TMP_DIR}"
cp -r "distribution/packages/src/common/scripts" "${TMP_DIR}"
cp -r "distribution/packages/src/common/scripts/*" "${TMP_DIR}/debian"
chmod a+x "${TMP_DIR}/debmake_install.sh"
# Copy performance analyzer service file
enable_performance_analyzer

cd "${TMP_DIR}"
ls -ll
mv scripts debian
local src_path="./usr/share/wazuh-indexer"
PATH_CONF="./etc/wazuh-indexer"
PATH_BIN="${src_path}/bin"
Expand All @@ -381,11 +379,11 @@ function assemble_deb() {
tar zvxf data.tar.gz
# Extracts debian control files (preinst, postrm, ...)
# We need to use some custom files, otherwise debuild fails
mv "./debian/control" "./debian/wazuh-control"
ar xf "${ARTIFACT_BUILD_NAME}" control.tar.gz
tar zvxf control.tar.gz -C "debian"
mv "./debian/wazuh-control" "./debian/control"
rm "./debian/conffiles"
# mv "./debian/control" "./debian/wazuh-control"
# ar xf "${ARTIFACT_BUILD_NAME}" control.tar.gz
# tar zvxf control.tar.gz -C "debian"
# mv "./debian/wazuh-control" "./debian/control"
# rm "./debian/conffiles"

local version
version=$(cat ./usr/share/wazuh-indexer/VERSION)
Expand Down
2 changes: 1 addition & 1 deletion distribution/packages/src/common/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fi
if [ "$PACKAGE" = "deb" ]; then
if [ ! -f "${OPENSEARCH_PATH_CONF}"/opensearch.keystore ]; then
/usr/share/wazuh-indexer/bin/opensearch-keystore create
chown root:wazuh-indexer "${OPENSEARCH_PATH_CONF}"/opensearch.keystore
chown wazuh-indexer:wazuh-indexer "${OPENSEARCH_PATH_CONF}"/opensearch.keystore
chmod 660 "${OPENSEARCH_PATH_CONF}"/opensearch.keystore
md5sum "${OPENSEARCH_PATH_CONF}"/opensearch.keystore > "${OPENSEARCH_PATH_CONF}"/.opensearch.keystore.initial_md5sum
else
Expand Down
2 changes: 1 addition & 1 deletion distribution/packages/src/common/scripts/posttrans
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export OPENSEARCH_PATH_CONF=${OPENSEARCH_PATH_CONF:-${path.conf}}

if [ ! -f "${OPENSEARCH_PATH_CONF}"/opensearch.keystore ]; then
/usr/share/wazuh-indexer/bin/opensearch-keystore create
chown root:wazuh-indexer "${OPENSEARCH_PATH_CONF}"/opensearch.keystore
chown wazuh-indexer:wazuh-indexer "${OPENSEARCH_PATH_CONF}"/opensearch.keystore
chmod 660 "${OPENSEARCH_PATH_CONF}"/opensearch.keystore
md5sum "${OPENSEARCH_PATH_CONF}"/opensearch.keystore > "${OPENSEARCH_PATH_CONF}"/.opensearch.keystore.initial_md5sum
else
Expand Down

0 comments on commit 25e5770

Please sign in to comment.