diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 2ef82708e5c6..b4ddca3be4d6 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -115,7 +115,6 @@ jobs: WAZUH_DASHBOARD_SLIM: ${{ steps.setup-variables.outputs.WAZUH_DASHBOARD_SLIM }} WAZUH_SECURITY_PLUGIN: ${{ steps.setup-variables.outputs.WAZUH_SECURITY_PLUGIN }} WAZUH_REPORT_PLUGIN: ${{ steps.setup-variables.outputs.WAZUH_REPORT_PLUGIN }} - WAZUH_PLUGINS_WAZUH: ${{ steps.setup-variables.outputs.WAZUH_PLUGINS_WAZUH }} WAZUH_PLUGINS_CORE: ${{ steps.setup-variables.outputs.WAZUH_PLUGINS_CORE }} WAZUH_PLUGINS_CHECK_UPDATES: ${{ steps.setup-variables.outputs.WAZUH_PLUGINS_CHECK_UPDATES }} PACKAGE_NAME: ${{ steps.setup-variables.outputs.PACKAGE_NAME }} @@ -168,8 +167,7 @@ jobs: WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.tar.gz WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_security_plugins }} | sed 's/\//-/g').zip WAZUH_REPORT_PLUGIN=reports-dashboards_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_report_plugins }} | sed 's/\//-/g').zip - WAZUH_PLUGINS_WAZUH=wazuh-dashboard-plugins_wazuh_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip - WAZUH_PLUGINS_CORE=wazuh-dashboard-plugins_wazuh-core_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip + WAZUH_PLUGINS_CORE=wazuh-dashboard-plugins_wazuh-core_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip WAZUH_PLUGINS_CHECK_UPDATES=wazuh-dashboard-plugins_wazuh-check-updates_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip if [ "${{ inputs.system }}" = "deb" ]; then if [ "${{ inputs.is_stage }}" = "true" ]; then @@ -201,7 +199,6 @@ jobs: echo "WAZUH_DASHBOARD_SLIM=$WAZUH_DASHBOARD_SLIM" >> $GITHUB_OUTPUT echo "WAZUH_SECURITY_PLUGIN=$WAZUH_SECURITY_PLUGIN" >> $GITHUB_OUTPUT echo "WAZUH_REPORT_PLUGIN=$WAZUH_REPORT_PLUGIN" >> $GITHUB_OUTPUT - echo "WAZUH_PLUGINS_WAZUH=$WAZUH_PLUGINS_WAZUH" >> $GITHUB_OUTPUT echo "WAZUH_PLUGINS_CORE=$WAZUH_PLUGINS_CORE" >> $GITHUB_OUTPUT echo "WAZUH_PLUGINS_CHECK_UPDATES=$WAZUH_PLUGINS_CHECK_UPDATES" >> $GITHUB_OUTPUT echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT @@ -242,7 +239,7 @@ jobs: build-main-plugins: needs: [validate-job] name: Build plugins - uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@master + uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@change/401-remove-legacy-plugins with: reference: ${{ inputs.reference_wazuh_plugins }} @@ -286,11 +283,6 @@ jobs: name: ${{ needs.setup-variables.outputs.WAZUH_SECURITY_PLUGIN }} path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/security-plugin - - name: Download plugins artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ needs.setup-variables.outputs.WAZUH_PLUGINS_WAZUH }} - path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/plugins - name: Download plugins artifacts uses: actions/download-artifact@v4 with: diff --git a/dev-tools/build-packages/deb/debian/postinst b/dev-tools/build-packages/deb/debian/postinst index 8951ca33792a..1abd6f6bdf2a 100644 --- a/dev-tools/build-packages/deb/debian/postinst +++ b/dev-tools/build-packages/deb/debian/postinst @@ -20,35 +20,34 @@ chown -R "${NAME}":"${NAME}" "${PID_DIR}" case "$1" in configure) - chmod 750 "${TARGET_DIR}""${CONFIG_DIR}" - chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${CONFIG_DIR}" - chmod 750 "${TARGET_DIR}""${INSTALLATION_DIR}" - chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${INSTALLATION_DIR}" - setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/bin/node - setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/fallback/bin/node - if [ -f "${INSTALLATION_DIR}"/"${NAME}".restart ]; then - rm -f "${INSTALLATION_DIR}"/"${NAME}".restart - if command -v systemctl >/dev/null 2>&1 && systemctl >/dev/null 2>&1; then - systemctl daemon-reload >/dev/null 2>&1 - systemctl restart wazuh-dashboard.service >/dev/null 2>&1 - elif command -v service >/dev/null 2>&1 && service wazuh-dashboard status 2>/dev/null | grep "running" >/dev/null 2>&1; then - service wazuh-dashboard restart >/dev/null 2>&1 - fi + chmod 750 "${TARGET_DIR}""${CONFIG_DIR}" + chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${CONFIG_DIR}" + chmod 750 "${TARGET_DIR}""${INSTALLATION_DIR}" + chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${INSTALLATION_DIR}" + setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/bin/node + setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/fallback/bin/node + if [ -f "${INSTALLATION_DIR}"/"${NAME}".restart ]; then + rm -f "${INSTALLATION_DIR}"/"${NAME}".restart + if command -v systemctl >/dev/null 2>&1 && systemctl >/dev/null 2>&1; then + systemctl daemon-reload >/dev/null 2>&1 + systemctl restart wazuh-dashboard.service >/dev/null 2>&1 + elif command -v service >/dev/null 2>&1 && service wazuh-dashboard status 2>/dev/null | grep "running" >/dev/null 2>&1; then + service wazuh-dashboard restart >/dev/null 2>&1 fi - if [ ! -f "${CONFIG_DIR}"/opensearch_dashboards.keystore ]; then - runuser "${NAME}" --shell="/bin/bash" --command="${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore create" >/dev/null 2>&1 - runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.username --stdin" >/dev/null 2>&1 - runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.password --stdin" >/dev/null 2>&1 - fi - /usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin remove wazuh --allow-root >/dev/null 2>&1 - ;; + fi + if [ ! -f "${CONFIG_DIR}"/opensearch_dashboards.keystore ]; then + runuser "${NAME}" --shell="/bin/bash" --command="${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore create" >/dev/null 2>&1 + runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.username --stdin" >/dev/null 2>&1 + runuser "${NAME}" --shell="/bin/bash" --command="echo kibanaserver | ${INSTALLATION_DIR}/bin/opensearch-dashboards-keystore add opensearch.password --stdin" >/dev/null 2>&1 + fi + ;; abort-upgrade | abort-remove | abort-deconfigure) ;; *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; esac diff --git a/dev-tools/build-packages/deb/debian/rules b/dev-tools/build-packages/deb/debian/rules index ac2087b35ef0..e4addb20517c 100644 --- a/dev-tools/build-packages/deb/debian/rules +++ b/dev-tools/build-packages/deb/debian/rules @@ -82,8 +82,6 @@ override_dh_install: chown -R $(USER):$(GROUP) $(TARGET_DIR)$(INSTALLATION_DIR) chown -R $(USER):$(GROUP) $(TARGET_DIR)$(CONFIG_DIR) - find $(TARGET_DIR)$(INSTALLATION_DIR)/plugins/wazuh/ -exec chown $(USER):$(GROUP) {} \; - # ----------------------------------------------------------------------------- override_dh_fixperms: diff --git a/dev-tools/build-packages/rpm/wazuh-dashboard.spec b/dev-tools/build-packages/rpm/wazuh-dashboard.spec index a7c69e5d1fb0..73bb8ab3b378 100644 --- a/dev-tools/build-packages/rpm/wazuh-dashboard.spec +++ b/dev-tools/build-packages/rpm/wazuh-dashboard.spec @@ -91,12 +91,6 @@ find %{buildroot}%{CONFIG_DIR} -exec chown %{USER}:%{GROUP} {} \; chown root:root %{buildroot}/etc/systemd/system/wazuh-dashboard.service -find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -exec chown %{USER}:%{GROUP} {} \; -find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 644 -exec chmod 640 {} \; -find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 755 -exec chmod 750 {} \; -find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type d -exec chmod 750 {} \; -find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 744 -exec chmod 740 {} \; - # ----------------------------------------------------------------------------- %pre @@ -191,7 +185,6 @@ if [ -f %{INSTALL_DIR}/wazuh-dashboard.restart ]; then fi fi -/usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin remove wazuh --allow-root # -----------------------------------------------------------------------------