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

Fix/missing packages inventory solaris agent #5144

Merged
merged 6 commits into from Jan 26, 2023

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Jan 19, 2023

Description

This PR aims to add capabilities to the inventory dashboard to show information from Solaris OSs

Issues Resolved

#5079

Evidence

imagen

Testing

Information for the test

To test this PR is necessary to have a manager and register a Solaris agent.
Additionally, it is possible to mock the responses. Here are the expected responses from the endpoints, cloned from a server with actual Solaris agents:

Solaris 11

GET /api/syscollector/{agent id}

{"hardware":{"cpu":{"name":" "},"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"board_serial":" ","agent_id":"002"},"os":{"os":{"major":"11","minor":"4","name":"SunOS","platform":"sunos","version":"11.4"},"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"release":"5.11","version":"11.4.0.15.0","sysname":"SunOS","architecture":"i86pc","hostname":"solaris11","agent_id":"002"}}

GET /syscollector/{agent id}/processes

{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}

GET /syscollector/{agent id}/ports

{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}

GET /syscollector/{agent id}/packages

{"data":{"affected_items":[{"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Audio Drivers","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"audd","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Removable volume manager","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"rmvolmgr","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Core Solaris Network Infrastructure (Root)","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"cnetr","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Sun IB Hermon HCA driver","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"hermon","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"ntfsprogs - Utilities that provide access to NTFS","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"ntfsprogs","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Interprocess Communications","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"ipc","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"kernel RPCSEC_GSS","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"rsgk","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Core Architecture, (Kvm)","architecture":"i386.i86pc","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"kvm.i","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:29+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Time Slider ZFS snapshot management","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"gnome-time-slider-l10n","agent_id":"002"},{"scan":{"id":0,"time":"2023-01-25T12:09:30+00:00"},"section":"system","source":" ","size":0,"version":"11.11","format":"pkg","description":"Core Solaris Kernel (Root)","architecture":"i386","vendor":"Oracle Corporation","install_time":"2018-08-20T13:11:00+00:00","name":"ckr","agent_id":"002"}],"total_affected_items":240,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}

GET /syscollector/{agent id}/netaddr

{"data":{"affected_items":[{"scan":{"id":0},"address":"fe80::a00:27ff:feca:207a","netmask":"ffc0::","iface":"net0","proto":"ipv6","agent_id":"002"},{"scan":{"id":0},"address":"192.168.0.217","netmask":"255.255.255.0","iface":"net0","broadcast":"192.168.0.255","proto":"ipv4","agent_id":"002"}],"total_affected_items":2,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}

GET /syscollector/{agent id}/netiface

{"data":{"affected_items":[{"rx":{"bytes":5072,"dropped":0,"errors":0,"packets":45},"scan":{"id":0,"time":"2023-01-25T12:09:28+00:00"},"tx":{"bytes":5256,"dropped":0,"errors":0,"packets":42},"name":"net0","mac":"08:00:27:CA:20:7A","mtu":1500,"state":"up","type":"Ethernet","agent_id":"002"}],"total_affected_items":1,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}

Solaris 10

GET /api/syscollector/{agent id}

{"hardware":{"cpu":{"name":" "},"scan":{"id":0,"time":"2023-01-25T12:13:08+00:00"},"board_serial":" ","agent_id":"003"},"os":{"os":{"major":"10","name":"SunOS","platform":"sunos","version":"10"},"scan":{"id":0,"time":"2023-01-25T12:13:08+00:00"},"release":"5.10","version":"Generic_147148-26","sysname":"SunOS","architecture":"i86pc","hostname":"unknown","agent_id":"003"}}

GET /syscollector/{agent id}/processes

{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}

GET /syscollector/{agent id}/processes

{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}

GET /syscollector/{agent id}/ports

{"data":{"affected_items":[],"total_affected_items":0,"total_failed_items":0,"failed_items":[]},"message":"No syscollector information was returned","error":0}

GET /syscollector/{agent id}/packages

{"data":{"affected_items":[{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.9.0","format":"pkg","description":"Symbios 895A, 896 and 1010 SCSI driver","architecture":"i386","vendor":"LSI Logic Corporation","install_time":"2023-01-19T12:26:00+00:00","name":"hisl","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"1.6.0","format":"pkg","description":"JDK 6.0 64-bit Dev. Tools (1.6.0_37)","architecture":"i386","vendor":"Sun Microsystems, Inc.","install_time":"2023-01-19T12:27:00+00:00","name":"j6dvx","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"6.6.2.4099","format":"pkg","description":"Pixman library","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:24:00+00:00","name":"pixman","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"LLC2 driver and its initialization programs","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:28:00+00:00","name":"llc","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"Intel 1Gb PCI Express NIC PF and VF Driver","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:27:00+00:00","name":"igb","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"GNOME2,application,JDS3","source":" ","size":0,"version":"20.2.6.0","format":"pkg","description":"libtiff - library for reading and writing TIFF - developer files","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:27:00+00:00","name":"Tiff-devel","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"GNOME2,application,JDS3","source":" ","size":0,"version":"2.6.0","format":"pkg","description":"Accessibility Implementation for GNOME - developer files, platform dependent, /usr","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:28:00+00:00","name":"gnome-a11y-libs-devel","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"Sun IP over InfiniBand","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:23:00+00:00","name":"ipoib","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:09+00:00"},"section":"system","source":" ","size":0,"version":"11.10.0","format":"pkg","description":"3COM EtherLink III PCMCIA Ethernet Driver","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:27:00+00:00","name":"pcelx","agent_id":"003"},{"scan":{"id":0,"time":"2023-01-25T12:13:10+00:00"},"section":"GNOME2,application,JDS3","source":" ","size":0,"version":"3.7.6.3","format":"pkg","description":"SQL database engine library","architecture":"i386","vendor":"Oracle Corporation","install_time":"2023-01-19T12:25:00+00:00","name":"sqlite3","agent_id":"003"}],"total_affected_items":1126,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}

GET /syscollector/{agent id}/netaddr

{"data":{"affected_items":[{"scan":{"id":0},"address":"192.168.0.120","netmask":"255.255.255.0","iface":"e1000g0","broadcast":"192.168.0.255","proto":"ipv4","agent_id":"003"},{"scan":{"id":0},"address":"fe80::a00:27ff:fead:f945","netmask":"ffc0::","iface":"e1000g0","proto":"ipv6","agent_id":"003"}],"total_affected_items":2,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}

GET /syscollector/{agent id}/netiface

{"data":{"affected_items":[{"rx":{"bytes":16065,"dropped":0,"errors":0,"packets":180},"scan":{"id":0,"time":"2023-01-25T12:13:08+00:00"},"tx":{"bytes":3740,"dropped":0,"errors":0,"packets":42},"name":"e1000g0","mac":"08:00:27:AD:F9:45","mtu":1500,"state":"up","agent_id":"003"}],"total_affected_items":1,"total_failed_items":0,"failed_items":[]},"message":"All specified syscollector information was returned","error":0}

Additional information:

The ports and processes modules are not currently supported in Solaris agents, is expected that that information will not be shown.

Test

Scenario: have a manager with a Solaris 10 agent registered, and syscheck enabled with all the modules and navigate to the agent tab
When the user navigates to the Inventory data section
Then it should display information from the system and the packages table should be visible.

Scenario: have a manager with a Solaris 11 agent registered, and syscheck enabled with all the modules and navigate to the agent tab
When the user navigates to the Inventory data section
Then it should display information from the system and the packages table should be visible.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@Tostti Tostti self-assigned this Jan 19, 2023
@Tostti Tostti linked an issue Jan 19, 2023 that may be closed by this pull request
@Tostti Tostti marked this pull request as ready for review January 25, 2023 15:36
@Tostti Tostti requested a review from a team as a code owner January 25, 2023 15:36
@github-actions
Copy link
Contributor

Code coverage (Jest) % values
Statements 8.8% ( 3253 / 36965 )
Branches 4.49% ( 1291 / 28739 )
Functions 7.68% ( 703 / 9154 )
Lines 8.87% ( 3138 / 35396 )

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.

Solaris 10 🟢

Screenshot from 2023-01-26 19-43-56
Screenshot from 2023-01-26 19-47-19

Solaris 11 🟢

Screenshot from 2023-01-26 20-06-46

@asteriscos asteriscos merged commit 1b8d218 into 4.4-7.10 Jan 26, 2023
@asteriscos asteriscos deleted the fix/missing-packages-inventory-solaris-agent branch January 26, 2023 19:09
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.

Missing packages inventory on Solaris agents
2 participants