diff --git a/distribution/packages/src/deb/debian/postinst b/distribution/packages/src/deb/debian/postinst index c523ffa260091..909fd66e1b6dc 100644 --- a/distribution/packages/src/deb/debian/postinst +++ b/distribution/packages/src/deb/debian/postinst @@ -46,6 +46,12 @@ if command -v systemd-tmpfiles > /dev/null; then systemd-tmpfiles --create wazuh-indexer.conf fi +if ! [ -d "${config_dir}/certs" ] && [ -f "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh" ]; then + echo "No certificates detected in ${config_dir}, installing demo certificates..." + echo "### If you are using a custom certificates path, ignore this message." + bash "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh" +fi + if [ -f $restart_service ]; then rm -f $restart_service echo "Restarting wazuh-indexer service..." diff --git a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec index e9420754c1136..845b9559c5cfb 100644 --- a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec +++ b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec @@ -205,6 +205,12 @@ if command -v systemd-tmpfiles > /dev/null; then systemd-tmpfiles --create %{name}.conf fi +if ! [ -d "${config_dir}/certs" ] && [ -f "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh" ]; then + echo "No certificates detected in ${config_dir}, installing demo certificates..." + echo "### If you are using a custom certificates path, ignore this message." + bash "${product_dir}/plugins/opensearch-security/tools/install-demo-certificates.sh" +fi + if [ -f %{tmp_dir}/wazuh-indexer.restart ]; then rm -f %{tmp_dir}/wazuh-indexer.restart if command -v systemctl > /dev/null; then