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

Fixed os agent filter #7278

Merged
merged 4 commits into from
Feb 12, 2025
Merged

Fixed os agent filter #7278

merged 4 commits into from
Feb 12, 2025

Conversation

JuanGarriuz
Copy link
Member

@JuanGarriuz JuanGarriuz commented Feb 5, 2025

Description

In /plugins/main/public/components/endpoints-summary/dashboard/endpoints-summary-dashboard.tsx, when retrieving agents filtered by os (getAgentsByOs), the os.platform field is used. However, the onClick function (filterAgentByOS) applies the filter using os.name.

The best way to manage the filters is using os.platform instead of os.name.

Issues Resolved

Evidence

image
image
image

Test

  • Add an oracle-linux agent

I used this Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "generic/oracle8"
  config.vm.network "private_network", ip: "<agent-ip>"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "<memory-assignment>"
    vb.cpus = <cpu-assignment>
  end

  config.vm.provision "shell", inline: <<-SHELL
    sudo dnf update -y
  SHELL
end
  • Check that TOP 5 OS filters are filtered by os.platform instead of os.name.

Aditional tests

  • Add other agents with different os and check that TOP-5-OS filter works correctly.

Example:

Vagrant.configure("2") do |config|
  
  config.vm.box = "StefanScherer/windows_2019"
  config.vm.network "private_network", ip: "<agent-ip>"
  config.vm.provider "virtualbox" do |v|
    v.memory = "<memory-assignment>"
    v.cpus = <cpu-assignment>
  end

  config.vm.provision "shell", inline: <<-SHELL

  SHELL

end

Check List

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

@JuanGarriuz JuanGarriuz self-assigned this Feb 5, 2025
@JuanGarriuz JuanGarriuz linked an issue Feb 5, 2025 that may be closed by this pull request
@JuanGarriuz JuanGarriuz marked this pull request as ready for review February 5, 2025 10:26
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.3% ( 400 / 883 )
Branches 41.09% ( 157 / 382 )
Functions 43.31% ( 136 / 314 )
Lines 45.48% ( 398 / 875 )

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 78.72% ( 185 / 235 )
Branches 62.72% ( 69 / 110 )
Functions 61.7% ( 29 / 47 )
Lines 78.72% ( 185 / 235 )

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Main plugin code coverage (Jest) test % values
Statements 16.91% ( 5053 / 29879 )
Branches 10.33% ( 1991 / 19265 )
Functions 17.95% ( 1300 / 7239 )
Lines 17.19% ( 4943 / 28754 )

@JuanGarriuz JuanGarriuz changed the title Fixed so agent filter Fixed os agent filter Feb 6, 2025
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: 🟢

Peek 2025-02-10 19-08

@yenienserrano yenienserrano self-requested a review February 12, 2025 11:27
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM 🟢

Screen.Recording.2025-02-12.at.1.09.53.PM.mov

@asteriscos asteriscos merged commit 086926b into 4.12.0 Feb 12, 2025
5 checks passed
@asteriscos asteriscos deleted the bug/7252-fixed-os-agent-filter branch February 12, 2025 12:13
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.

Oracle Linux Agents Not Displayed Correctly in Endpoints List
3 participants