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

Remove legacy plugins #7187

Merged
merged 9 commits into from
Dec 27, 2024
Merged

Remove legacy plugins #7187

merged 9 commits into from
Dec 27, 2024

Conversation

guidomodarelli
Copy link
Contributor

@guidomodarelli guidomodarelli commented Dec 2, 2024

Description

Remove legacy plugins

As part of the legacy removal objective, we want to remove all the legacy modules, features, and components to ensure a clean start in which only the necessary components will be included in Wazuh 5.0. The goal is to avoid dragging old bugs and sub-optimal designs.

Issues Resolved

wazuh/wazuh-dashboard#401

Evidence

arm deb

image

Test

ARM

DEB
https://github.com/wazuh/wazuh-dashboard/actions/runs/12484705833
RPM
https://github.com/wazuh/wazuh-dashboard/actions/runs/12484708968

x86

DEB
https://github.com/wazuh/wazuh-dashboard/actions/runs/12484704855
RPM
https://github.com/wazuh/wazuh-dashboard/actions/runs/12484707657

  1. Using the development environments, the plugins that are in the main folder should not appear.
  2. The same in the packages generated from wazuh-dashboard

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@yenienserrano yenienserrano linked an issue Dec 3, 2024 that may be closed by this pull request
2 tasks
Copy link
Contributor

Wazuh Engine plugin code coverage (Jest) test % values
Statements 8.63% ( 64 / 741 )
Branches 7.94% ( 22 / 277 )
Functions 1.87% ( 7 / 373 )
Lines 9.1% ( 64 / 703 )

Copy link
Contributor

Wazuh Fleet plugin code coverage (Jest) test % values
Statements 4.68% ( 9 / 192 )
Branches 16.66% ( 7 / 42 )
Functions 1.11% ( 1 / 90 )
Lines 4.76% ( 9 / 189 )

- Deleted references to the Wazuh Engine and Wazuh Fleet plugins in both the dev-environment and manual-build workflows.
- Streamlined the workflows by eliminating unnecessary download steps for these plugins' artifacts.
Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 36.82% ( 816 / 2216 )
Branches 38.31% ( 467 / 1219 )
Functions 38.65% ( 259 / 670 )
Lines 37.06% ( 811 / 2188 )

@JuanGarriuz JuanGarriuz self-requested a review December 26, 2024 12:42
@chantal-kelm chantal-kelm self-requested a review December 26, 2024 12:44
@guidomodarelli
Copy link
Contributor Author

guidomodarelli commented Dec 26, 2024

Test 2024/12/26 🟢

OS: ubuntu22.04
Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-22.04"
  config.vm.provider "virtualbox" do |vb|
    vb.cpus = 4
    vb.memory = 8192
  end
end

Wazuh indexer: Build [ "deb", "rpm" ] Wazuh Indexer on [ "x64" ]
Wazuh dashboard: Build [ "deb" ] on [ "amd64" ]

root@vagrant:/vagrant# systemctl status wazuh-indexer
● wazuh-indexer.service - wazuh-indexer
     Loaded: loaded (/lib/systemd/system/wazuh-indexer.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-12-26 17:04:55 UTC; 46min ago
       Docs: https://documentation.wazuh.com
   Main PID: 2054 (java)
      Tasks: 89 (limit: 9386)
     Memory: 1.4G
        CPU: 1min 59.015s
     CGroup: /system.slice/wazuh-indexer.service
             └─2054 /usr/share/wazuh-indexer/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava>

Dec 26 17:04:35 vagrant systemd-entrypoint[2054]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:/usr/share/wazuh-indexer/lib/opensearch-2.18.0.j>
Dec 26 17:04:35 vagrant systemd-entrypoint[2054]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch
Dec 26 17:04:35 vagrant systemd-entrypoint[2054]: WARNING: System::setSecurityManager will be removed in a future release
Dec 26 17:04:36 vagrant systemd-entrypoint[2054]: Dec 26, 2024 5:04:36 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
Dec 26 17:04:36 vagrant systemd-entrypoint[2054]: WARNING: COMPAT locale provider will be removed in a future release
Dec 26 17:04:37 vagrant systemd-entrypoint[2054]: WARNING: A terminally deprecated method in java.lang.System has been called
Dec 26 17:04:37 vagrant systemd-entrypoint[2054]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.Security (file:/usr/share/wazuh-indexer/lib/opensearch-2.18.0.jar)
Dec 26 17:04:37 vagrant systemd-entrypoint[2054]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.Security
Dec 26 17:04:37 vagrant systemd-entrypoint[2054]: WARNING: System::setSecurityManager will be removed in a future release
Dec 26 17:04:55 vagrant systemd[1]: Started wazuh-indexer.
root@vagrant:/vagrant# systemctl status wazuh-dashboard
● wazuh-dashboard.service - wazuh-dashboard
     Loaded: loaded (/etc/systemd/system/wazuh-dashboard.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-12-26 17:50:55 UTC; 22s ago
   Main PID: 3607 (node)
      Tasks: 11 (limit: 9386)
     Memory: 247.0M
        CPU: 7.503s
     CGroup: /system.slice/wazuh-dashboard.service
             └─3607 /usr/share/wazuh-dashboard/node/bin/node /usr/share/wazuh-dashboard/src/cli/dist

Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","setting:metaFields"],"pid":3607,"mess>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","setting:metaFields"],"pid":3607,"mess>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","index-pattern:alerts"],"pid":3607,"me>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","setting:timepicker:timeDefaults"],"pi>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","setting:timepicker:timeDefaults"],"pi>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","setting:timeline:max_buckets"],"pid":>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","setting:timeline:max_buckets"],"pid":>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","plugins","wazuhCore","initialization","index-pattern:statistics"],"pid":3607>
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["listening","info"],"pid":3607,"message":"Server running at https://0.0.0.0:443"}
Dec 26 17:51:01 vagrant opensearch-dashboards[3607]: {"type":"log","@timestamp":"2024-12-26T17:51:01Z","tags":["info","http","server","OpenSearchDashboards"],"pid":3607,"message":"http server run>

image

@guidomodarelli
Copy link
Contributor Author

guidomodarelli commented Dec 26, 2024

Test 2024/12/26 🟢

OS: centos8
Vagrantfile

Vagrant.configure("2") do |config|
  if ENV["VAGRANT_WSL"]
    config.ssh.insert_key = false
  end
  config.vm.box = "centos/8"
  config.vm.network "private_network", ip: "192.168.56.4"
  config.vm.provider "virtualbox" do |pmv|
    pmv.memory = 4096
    pmv.cpus = 2
    pmv.name = "Centos8"
  end
  ssh_pub_source = ENV["WZ_SSH_PUB_KEY_PATH"]
  if ssh_pub_source
    config.vm.provision "file", source: ssh_pub_source, destination: "~/.ssh/me.pub"
    config.vm.provision "shell", inline: <<-SHELL
        cat /home/vagrant/.ssh/me.pub >> /home/vagrant/.ssh/authorized_keys
        mkdir -p /root/.ssh/
        cat /home/vagrant/.ssh/me.pub >> /root/.ssh/authorized_keys
      SHELL
  end
  # https://stackoverflow.com/a/71309215
  config.vm.provision "shell", inline: <<-SHELL
      cd /etc/yum.repos.d/
      sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
      sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
      sudo yum upgrade -y
    SHELL
end

Wazuh indexer: Build [ "deb", "rpm" ] Wazuh Indexer on [ "x64" ]
Wazuh dashboard: Build [ "rpm" ] on [ "x86_64" ]

[root@vbox vagrant]# systemctl status wazuh-indexer
● wazuh-indexer.service - wazuh-indexer
   Loaded: loaded (/usr/lib/systemd/system/wazuh-indexer.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-12-26 18:23:07 UTC; 13min ago
     Docs: https://documentation.wazuh.com
 Main PID: 3527 (java)
    Tasks: 84 (limit: 24920)
   Memory: 1.3G
   CGroup: /system.slice/wazuh-indexer.service
           └─3527 /usr/share/wazuh-indexer/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.a>

Dec 26 18:22:50 vbox systemd-entrypoint[3527]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:/usr/share/wazuh-indexer/lib/opensearch-2.18.0.jar)
Dec 26 18:22:50 vbox systemd-entrypoint[3527]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch
Dec 26 18:22:50 vbox systemd-entrypoint[3527]: WARNING: System::setSecurityManager will be removed in a future release
Dec 26 18:22:51 vbox systemd-entrypoint[3527]: Dec 26, 2024 6:22:51 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
Dec 26 18:22:51 vbox systemd-entrypoint[3527]: WARNING: COMPAT locale provider will be removed in a future release
Dec 26 18:22:51 vbox systemd-entrypoint[3527]: WARNING: A terminally deprecated method in java.lang.System has been called
Dec 26 18:22:51 vbox systemd-entrypoint[3527]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.Security (file:/usr/share/wazuh-indexer/lib/opensearch-2.18.0.jar)
Dec 26 18:22:51 vbox systemd-entrypoint[3527]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.Security
Dec 26 18:22:51 vbox systemd-entrypoint[3527]: WARNING: System::setSecurityManager will be removed in a future release
Dec 26 18:23:07 vbox systemd[1]: Started wazuh-indexer.
[root@vbox vagrant]# systemctl status wazuh-dashboard
● wazuh-dashboard.service - wazuh-dashboard
   Loaded: loaded (/etc/systemd/system/wazuh-dashboard.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-12-26 18:36:49 UTC; 16s ago
 Main PID: 4049 (node)
    Tasks: 11 (limit: 24920)
   Memory: 241.9M
   CGroup: /system.slice/wazuh-dashboard.service
           └─4049 /usr/share/wazuh-dashboard/node/bin/node /usr/share/wazuh-dashboard/src/cli/dist

Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["error","opensearch","data"],"pid":4049,"message":"[version_conflict_engine_exception]:>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","index-pattern:alerts"],"pid":4049,"messa>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","setting:metaFields"],"pid":4049,"message>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","setting:metaFields"],"pid":4049,"message>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","setting:timeline:max_buckets"],"pid":404>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","setting:timeline:max_buckets"],"pid":404>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","setting:timepicker:timeDefaults"],"pid":>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","plugins","wazuhCore","initialization","setting:timepicker:timeDefaults"],"pid":>
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["listening","info"],"pid":4049,"message":"Server running at https://0.0.0.0:443"}
Dec 26 18:36:56 vbox opensearch-dashboards[4049]: {"type":"log","@timestamp":"2024-12-26T18:36:56Z","tags":["info","http","server","OpenSearchDashboards"],"pid":4049,"message":"http server runnin>

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the name changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is changed so that opensearch does not detect it as a plugin and does not load it. In order not to delete the code in case we still need to use some of it.

Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: 🟢
Test: 🟢

image

image

Copy link
Member

@chantal-kelm chantal-kelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Captura de pantalla 2024-12-27 a la(s) 10 49 52 a  m Captura de pantalla 2024-12-27 a la(s) 10 49 04 a  m Captura de pantalla 2024-12-26 a la(s) 10 52 05 a  m Captura de pantalla 2024-12-26 a la(s) 10 51 50 a  m Captura de pantalla 2024-12-26 a la(s) 10 51 44 a  m

@asteriscos asteriscos merged commit b58f540 into master Dec 27, 2024
5 checks passed
@asteriscos asteriscos deleted the change/401-remove-legacy-plugins branch December 27, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove legacy plugins
5 participants