Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump wazuh-indexer and wazuh-dashboard to 2.0 #1555

Closed
2 tasks done
alberpilot opened this issue May 18, 2022 · 2 comments
Closed
2 tasks done

Bump wazuh-indexer and wazuh-dashboard to 2.0 #1555

alberpilot opened this issue May 18, 2022 · 2 comments

Comments

@alberpilot
Copy link
Contributor

alberpilot commented May 18, 2022

We need to bump the Wazuh indexer/dashboard to use the latest stable Opensearch version (2.0).

Not only building packages with Opensearch 2.0 is necessary. We need:

@alberpilot alberpilot changed the title Bump wazuh-indexer to 1.3.2 Bump wazuh-indexer to 2.0 Jun 6, 2022
@alberpilot alberpilot changed the title Bump wazuh-indexer to 2.0 Bump wazuh-indexer and wazuh-dashboard to 2.0 Jun 14, 2022
@c-bordon c-bordon self-assigned this Jul 1, 2022
@c-bordon
Copy link
Member

c-bordon commented Jul 1, 2022

I have come across changes in the opensearch plugins script, initially I think it does not allow installing custom plugins, but I have to continue investigating, it happens both when trying to build our package and when we want to install the Wazuh plugin in an opensearch dashboard installation 2.0.1:

Opensearch installation:

[root@centos7-1 ~]# /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.4.0-1.zip --allow-root
Attempting to transfer from https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.4.0-1.zip
Attempting to transfer from https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.0.1/latest/linux/x64/tar/builds/opensearch-dashboards/plugins/https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.4.0-1.zip-2.0.1.zip
Plugin installation was unsuccessful due to error "No valid url specified."

Package building:

chown wazuh-dashboard:wazuh-dashboard /build/wazuh-dashboard/wazuh-dashboard-4.4.0/debian/wazuh-dashboard/etc/default/wazuh-dashboard
if [ "4.4.0" = "99.99.0" ]; then \
        runuser wazuh-dashboard --shell="/bin/bash" --command="/build/wazuh-dashboard/wazuh-dashboard-4.4.0/debian/wazuh-dashboard/usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/futures/ui/dashboard/wazuh-99.99.0-1.zip" ;\
else \
        runuser wazuh-dashboard --shell="/bin/bash" --command="/build/wazuh-dashboard/wazuh-dashboard-4.4.0/debian/wazuh-dashboard/usr/share/wazuh-dashboard/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.4.0-1.zip" ;\
fi
Attempting to transfer from https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.4.0-1.zip
Attempting to transfer from https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.0.1/latest/linux/x64/tar/builds/opensearch-dashboards/plugins/https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-4.4.0-1.zip-2.0.1.zip
Plugin installation was unsuccessful due to error "No valid url specified."

This is the change found in the javascript:

function generatePluginUrl(version, plugin) {
  const platform = process.platform === 'win32' ? 'windows' : process.platform;
  const arch = process.arch === 'arm64' ? 'arm64' : 'x64';

  if (platform !== 'linux') {
    throw new Error('Plugins are only available for Linux');
  }

  return `${LATEST_PLUGIN_BASE_URL}/${version}/latest/${platform}/${arch}/tar/builds/opensearch-dashboards/plugins/${plugin}-${version}.zip`;
}

this function was not in version 1.2.0

@c-bordon
Copy link
Member

c-bordon commented Jul 1, 2022

There are some changes in indexer that I need to investigate further:

+ cp /root/unattended_installer/wazuh-certs-tool.sh /build/rpmbuild/BUILDROOT/wazuh-indexer-4.4.0-1.x86_64/usr/share/wazuh-indexer/plugins/opensearch-security/tools/
+ cp /root/unattended_installer/wazuh-passwords-tool.sh /build/rpmbuild/BUILDROOT/wazuh-indexer-4.4.0-1.x86_64/usr/share/wazuh-indexer/plugins/opensearch-security/tools/
+ cp /root/documentation-templates/wazuh/config.yml /build/rpmbuild/BUILDROOT/wazuh-indexer-4.4.0-1.x86_64/usr/share/wazuh-indexer/plugins/opensearch-security/tools/config.yml
+ cp /root/unattended_installer/config/indexer/roles/internal_users.yml /build/rpmbuild/BUILDROOT/wazuh-indexer-4.4.0-1.x86_64/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/
cp: cannot create regular file '/build/rpmbuild/BUILDROOT/wazuh-indexer-4.4.0-1.x86_64/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/': Not a directory
error: Bad exit status from /var/tmp/rpm-tmp.8chbvd (%install)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants