-
Notifications
You must be signed in to change notification settings - Fork 32
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
Integration tests: Improve Wazuh manager statistics #3112
Comments
Signed-off-by: Mauro Malara <[email protected]>
Signed-off-by: Mauro Malara <[email protected]>
For this development, the tests will be divided into three different modules. In addition, these tests will test both the API request and the sockets: Manager statisticsIn these tests, we will check the statistics of three daemons: We should check:
Examples of the statistics obtained:
|
Update 11/10/2022After trying to implement the test as a system test, it has been decided that it will be an integration test using the agent simulator, although we will not be able to cover all types of events until we update this simulator. The behavior of the simulator has been studied and tested to see how it can help the test implementation. In addition, we have started with the test that returns the manager configuration, trying to follow the format of the Vulnerability Detector integration tests. |
Update 16/11/2022This issue will be divided into the following issues:
|
Closing this issue. Superseded by version 5.0. |
Description
In order to validate the changes of the branch https://github.com/wazuh/wazuh/tree/dev-state-counters, some tests are required.
As part of wazuh/wazuh#13099, the statistics of the Wazuh manager have been improved.
Now, global statistics in JSON format can be requested using the API for the following daemons:
wazuh-remoted
wazuh-analysisd
wazuh-db
Also, agent's related statistics can be requested for the following daemons:
wazuh-remoted
wazuh-analysisd
Information related to the fields of the JSON can be found here and here.
All requests must point to the following sockets:
wazuh-remoted
->queue/sockets/remote
wazuh-analysisd
->queue/sockets/analysis
wazuh-remoted
->queue/db/wdb
Information related to the fields of the JSON request/response can be found here.
Configuration
No extra configuration is required.
Logs
No logs needed to verify.
Feature validation
Use the new API endpoints to retrieve and validate these counters/configurations.
Test cases
When consulting daemons statistics, note that this mechanism may not be exact for all counters, so the results may not always be exactly the same. It should be better to compare between ranges of expected values rather than exact values.
Verify that
wazuh-remoted
global state counters work as expected: generate different type of messages and validate counters.Verify that
wazuh-remoted
agents state counters work as expected: generate different type of messages and validate counters, they should only display statistics of connected agents.Verify that
wazuh-remoted
active configuration is retrieved as expected: compare it with the configuration located at theossec.conf
andinternal_options.conf
files. Allowed values forsection
:remote
,internal
,global
.Verify that
wazuh-analysisd
global state counters work as expected: generate different type of events and validate counters.Verify that
wazuh-analysisd
agents state counters work as expected: generate different type of events and validate counters, they should only display statistics of connected agents.Verify that
wazuh-analysisd
active configuration is retrieved as expected: compare it with the configuration located at theossec.conf
andinternal_options.conf
files. Allowed values forsection
:global
,active_response
,alerts
,decoders
,rules
,internal
,command
,labels
,rule_test
.Verify that
wazuh-db
global state counters work as expected: generate different type of queries and validate counters.Verify that
wazuh-db
active configuration is retrieved as expected: compare it with the configuration located at theossec.conf
andinternal_options.conf
files. Allowed values forsection
:internal
,wdb
.Fix integration tests that were broken with these changes:
The text was updated successfully, but these errors were encountered: