diff --git a/config/opensearch_dashboards.prod.yml b/config/opensearch_dashboards.prod.yml index f7eaf6ac84b4..930f061b3e75 100644 --- a/config/opensearch_dashboards.prod.yml +++ b/config/opensearch_dashboards.prod.yml @@ -1,12 +1,13 @@ server.host: 0.0.0.0 server.port: 443 -opensearch.hosts: https://localhost:9200 +opensearch.hosts: https://127.0.0.1:9200 opensearch.ssl.verificationMode: certificate opensearch.requestHeadersAllowlist: ["securitytenant","Authorization"] opensearch_security.multitenancy.enabled: false opensearch_security.readonly_mode.roles: ["kibana_read_only"] server.ssl.enabled: true -server.ssl.key: "/etc/wazuh-dashboard/certs/dashboard-key.pem" -server.ssl.certificate: "/etc/wazuh-dashboard/certs/dashboard.pem" +server.ssl.key: "/etc/wazuh-dashboard/certs/wazuh-dashboard-key.pem" +server.ssl.certificate: "/etc/wazuh-dashboard/certs/wazuh-dashboard.pem" opensearch.ssl.certificateAuthorities: ["/etc/wazuh-dashboard/certs/root-ca.pem"] uiSettings.overrides.defaultRoute: /app/wz-home +opensearch_security.cookie.secure: true diff --git a/dev-tools/build-packages/config/default b/dev-tools/build-packages/config/default index c4f94fd36814..250239f4c827 100644 --- a/dev-tools/build-packages/config/default +++ b/dev-tools/build-packages/config/default @@ -5,3 +5,4 @@ chdir="/" nice="" KILL_ON_STOP_TIMEOUT=0 +OSD_PATH_CONF="/etc/wazuh-dashboard" diff --git a/dev-tools/build-packages/config/wazuh-dashboard.service b/dev-tools/build-packages/config/wazuh-dashboard.service index 94334950ae94..ef1d2afd42f1 100644 --- a/dev-tools/build-packages/config/wazuh-dashboard.service +++ b/dev-tools/build-packages/config/wazuh-dashboard.service @@ -7,7 +7,7 @@ User=wazuh-dashboard Group=wazuh-dashboard EnvironmentFile=-/etc/default/wazuh-dashboard EnvironmentFile=-/etc/sysconfig/wazuh-dashboard -ExecStart=/usr/share/wazuh-dashboard/bin/opensearch-dashboards -c "/etc/wazuh-dashboard/opensearch_dashboards.yml" +ExecStart=/usr/share/wazuh-dashboard/bin/opensearch-dashboards WorkingDirectory=/usr/share/wazuh-dashboard [Install] diff --git a/dev-tools/build-packages/deb/debian/rules b/dev-tools/build-packages/deb/debian/rules index 98638dab5602..7fe98ddcc597 100644 --- a/dev-tools/build-packages/deb/debian/rules +++ b/dev-tools/build-packages/deb/debian/rules @@ -58,6 +58,9 @@ override_dh_install: useradd -g $(GROUP) $(USER) tar -xf $(DASHBOARD_FILE) + sed -i 's/OSD_NODE_OPTS_PREFIX/OSD_PATH_CONF="\/etc\/wazuh-dashboard" OSD_NODE_OPTS_PREFIX/g' "wazuh-dashboard-base/bin/opensearch-dashboards" + sed -i 's/OSD_USE_NODE_JS_FILE_PATH/OSD_PATH_CONF="\/etc\/wazuh-dashboard" OSD_USE_NODE_JS_FILE_PATH/g' "wazuh-dashboard-base/bin/opensearch-dashboards-keystore" + mkdir -p $(TARGET_DIR)$(CONFIG_DIR) mkdir -p $(TARGET_DIR)$(INSTALLATION_DIR) @@ -95,6 +98,7 @@ override_dh_fixperms: chmod 440 $(TARGET_DIR)$(INSTALLATION_DIR)/VERSION chmod 750 $(TARGET_DIR)/etc/systemd/system/wazuh-dashboard chmod 750 $(TARGET_DIR)/etc/default/wazuh-dashboard + chmod 640 "$(TARGET_DIR)$(CONFIG_DIR)"/opensearch_dashboards.yml chmod 640 "$(TARGET_DIR)$(CONFIG_DIR)"/node.options chmod 640 $(TARGET_DIR)/etc/systemd/system/wazuh-dashboard.service find "$(TARGET_DIR)$(INSTALLATION_DIR)" -type d -exec chmod 750 {} \; diff --git a/dev-tools/build-packages/rpm/wazuh-dashboard.spec b/dev-tools/build-packages/rpm/wazuh-dashboard.spec index 3506f455e601..2c9496aaa053 100644 --- a/dev-tools/build-packages/rpm/wazuh-dashboard.spec +++ b/dev-tools/build-packages/rpm/wazuh-dashboard.spec @@ -54,6 +54,9 @@ useradd -g %{GROUP} %{USER} %build tar -xf %{DASHBOARD_FILE} +sed -i 's/OSD_NODE_OPTS_PREFIX/OSD_PATH_CONF="\/etc\/wazuh-dashboard" OSD_NODE_OPTS_PREFIX/g' "wazuh-dashboard-base/bin/opensearch-dashboards" +sed -i 's/OSD_USE_NODE_JS_FILE_PATH/OSD_PATH_CONF="\/etc\/wazuh-dashboard" OSD_USE_NODE_JS_FILE_PATH/g' "wazuh-dashboard-base/bin/opensearch-dashboards-keystore" + # -----------------------------------------------------------------------------