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

Add new endpoint 'recalculate-agent-group-hashes' to wazuh-db #23441

Merged
merged 6 commits into from
May 16, 2024

Conversation

Nicogp
Copy link
Member

@Nicogp Nicogp commented May 15, 2024

Related issue
#23422

Description

This PR adds the new endpoint 'recalculate-agent-group-hashes' to wazuh-db, this endpoint performs the recalculation of agent-group hashes for each agent stored in the global.db database.

Conditions (agent by agent) for hash recalculation:

  • Agent id must be greater than 0
  • The 'group' field of that agent must be different from NULL.

Conditions for updating the value of the 'group_hash' and 'group' column in the database:

  • The newly calculated hash must be different from the previous one.
  • Now, in all calls to the endpoint, the values are updated.

Conditions for updating the value of the 'group_sync_status' column in the database:

  • The newly calculated hash must be different from the previous one.
  • The value of 'group_sync_status' will be set to 'synced' if the manager is a single-node or a worker node.
  • The value of 'group_sync_status' will be set to 'syncreq' if the manager is the master node.
  • Now, in this endpoint, the group_sync_status value is not modified.

Values that can be returned by the endpoint:

  • In case of success: ok
  • In case of error: err Error recalculating group hash of agents in global.db

Tests

  • Compilation without warnings in every supported platform
    • Linux
  • Source installation
  • Package installation
  • Source upgrade
  • Review logs syntax and correct language
  • Memory tests for Linux
    • Scan-build report
    • Valgrind (memcheck and descriptor leaks check)
    • AddressSanitizer
  • Retrocompatibility with older Wazuh versions
  • Working on cluster environments
  • Configuration on demand reports new parameters
  • Added unit tests (for new features)

@Nicogp Nicogp self-assigned this May 15, 2024
@Nicogp Nicogp linked an issue May 15, 2024 that may be closed by this pull request
[WDB_STMT_GLOBAL_UPDATE_AGENT_INFO] = "UPDATE agent SET config_sum = :config_sum, ip = :ip, manager_host = :manager_host, merged_sum = :merged_sum, name = :name, node_name = :node_name, os_arch = :os_arch, os_build = :os_build, os_codename = :os_codename, os_major = :os_major, os_minor = :os_minor, os_name = :os_name, os_platform = :os_platform, os_uname = :os_uname, os_version = :os_version, version = :version, last_keepalive = :last_keepalive, connection_status = :connection_status, disconnection_time = :disconnection_time, group_config_status = :group_config_status, status_code= :status_code, sync_status = :sync_status WHERE id = :id;",
[WDB_STMT_GLOBAL_GET_GROUPS] = "SELECT DISTINCT `group`, group_hash from agent WHERE id > 0 AND group_hash > ? ORDER BY group_hash;",
[WDB_STMT_GLOBAL_GET_AGENTS] = "SELECT id FROM agent WHERE id > ?;",
[WDB_STMT_GLOBAL_GET_AGENTS_BY_CONNECTION_STATUS] = "SELECT id FROM agent WHERE id > ? AND connection_status = ?;",
[WDB_STMT_GLOBAL_GET_AGENTS_BY_CONNECTION_STATUS_AND_NODE] = "SELECT id FROM agent WHERE id > ? AND connection_status = ? AND node_name = ? ORDER BY id LIMIT ?;",
[WDB_STMT_GLOBAL_GET_AGENTS_TO_RECALCULATE_GROUP_HASH] = "SELECT id FROM agent WHERE id > 0;",
Copy link
Member

Choose a reason for hiding this comment

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

I think you can use the query WDB_STMT_GLOBAL_GET_AGENTS.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

int wdb_parse_global_recalculate_agent_group_hashes(wdb_t* wdb, char* output) {

if (OS_SUCCESS != wdb_global_recalculate_all_agent_groups_hash(wdb)) {
mdebug1("Error recalculating group hash of agents in global.db.");
Copy link
Member

Choose a reason for hiding this comment

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

I think we can change this log to warning.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

…ALCULATE_GROUP_HASH, WDB_STMT_GLOBAL_GET_AGENTS is used.

          + Changes the debugging message “Error recalculating group hash of agents in global.db.” to warning
@Nicogp
Copy link
Member Author

Nicogp commented May 16, 2024

UTs running in local environment:

UTs server
ctest
Test project /home/vagrant/wazuh/src/unit_tests/build
        Start   1: test_analysisd_syscheck
  1/170 Test   #1: test_analysisd_syscheck .................................   Passed    0.18 sec
        Start   2: test_cleanevent
  2/170 Test   #2: test_cleanevent .........................................   Passed    0.18 sec
        Start   3: test_dbsync
  3/170 Test   #3: test_dbsync .............................................   Passed    0.15 sec
        Start   4: test_exec
  4/170 Test   #4: test_exec ...............................................   Passed    0.16 sec
        Start   5: test_log
  5/170 Test   #5: test_log ................................................   Passed    0.16 sec
        Start   6: test_labels
  6/170 Test   #6: test_labels .............................................   Passed    0.19 sec
        Start   7: test_mitre
  7/170 Test   #7: test_mitre ..............................................   Passed    0.03 sec
        Start   8: test_rules
  8/170 Test   #8: test_rules ..............................................   Passed    0.25 sec
        Start   9: test_same_different_loop
  9/170 Test   #9: test_same_different_loop ................................   Passed    0.23 sec
        Start  10: test_logtest
 10/170 Test  #10: test_logtest ............................................   Passed    0.08 sec
        Start  11: test_logtest-config
 11/170 Test  #11: test_logtest-config .....................................   Passed    0.02 sec
        Start  12: test_decoder_list
 12/170 Test  #12: test_decoder_list .......................................   Passed    0.02 sec
        Start  13: test_decode-xml
 13/170 Test  #13: test_decode-xml .........................................   Passed    0.27 sec
        Start  14: test_lists_list
 14/170 Test  #14: test_lists_list .........................................   Passed    0.02 sec
        Start  15: test_rule_list
 15/170 Test  #15: test_rule_list ..........................................   Passed    0.03 sec
        Start  16: test_eventinfo_list
 16/170 Test  #16: test_eventinfo_list .....................................   Passed    0.02 sec
        Start  17: test_logmsg
 17/170 Test  #17: test_logmsg .............................................   Passed    0.02 sec
        Start  18: test_decoder_rootcheck
 18/170 Test  #18: test_decoder_rootcheck ..................................   Passed    0.16 sec
        Start  19: test_decoder_syscollector
 19/170 Test  #19: test_decoder_syscollector ...............................   Passed    0.16 sec
        Start  20: test_decoder_winevtchannel
 20/170 Test  #20: test_decoder_winevtchannel ..............................   Passed    0.15 sec
        Start  21: test_decoder_winevtchannel_input
 21/170 Test  #21: test_decoder_winevtchannel_input ........................   Passed    0.16 sec
        Start  22: test_analysis-state
 22/170 Test  #22: test_analysis-state .....................................   Passed    0.15 sec
        Start  23: test_asyscom
 23/170 Test  #23: test_asyscom ............................................   Passed    0.16 sec
        Start  24: test_limits
 24/170 Test  #24: test_limits .............................................   Passed    0.03 sec
        Start  25: test_manager
 25/170 Test  #25: test_manager ............................................   Passed    0.14 sec
        Start  26: test_secure
 26/170 Test  #26: test_secure .............................................   Passed    0.13 sec
        Start  27: test_netbuffer
 27/170 Test  #27: test_netbuffer ..........................................   Passed    0.13 sec
        Start  28: test_sendmsg
 28/170 Test  #28: test_sendmsg ............................................   Passed    0.12 sec
        Start  29: test_remote-config
 29/170 Test  #29: test_remote-config ......................................   Passed    0.05 sec
        Start  30: test_syslogtcp
 30/170 Test  #30: test_syslogtcp ..........................................   Passed    0.13 sec
        Start  31: test_remote-state
 31/170 Test  #31: test_remote-state .......................................   Passed    0.12 sec
        Start  32: test_remcom
 32/170 Test  #32: test_remcom .............................................   Passed    0.13 sec
        Start  33: test_wdb_integrity
 33/170 Test  #33: test_wdb_integrity ......................................   Passed    0.02 sec
        Start  34: test_wdb_fim
 34/170 Test  #34: test_wdb_fim ............................................   Passed    0.04 sec
        Start  35: test_wdb_parser
 35/170 Test  #35: test_wdb_parser .........................................   Passed    0.05 sec
        Start  36: test_wdb_global_parser
 36/170 Test  #36: test_wdb_global_parser ..................................   Passed    0.06 sec
        Start  37: test_wdb_global
 37/170 Test  #37: test_wdb_global .........................................   Passed    0.34 sec
        Start  38: test_wdb_agents
 38/170 Test  #38: test_wdb_agents .........................................   Passed    0.02 sec
        Start  39: test_wdb_global_helpers
 39/170 Test  #39: test_wdb_global_helpers .................................   Passed    0.04 sec
        Start  40: test_wdb_agents_helpers
 40/170 Test  #40: test_wdb_agents_helpers .................................   Passed    0.04 sec
        Start  41: test_wdb
 41/170 Test  #41: test_wdb ................................................   Passed    0.08 sec
        Start  42: test_wdb_upgrade
 42/170 Test  #42: test_wdb_upgrade ........................................   Passed    0.03 sec
        Start  43: test_wdb_metadata
 43/170 Test  #43: test_wdb_metadata .......................................   Passed    0.01 sec
        Start  44: test_wdb_task_parser
 44/170 Test  #44: test_wdb_task_parser ....................................   Passed    0.04 sec
        Start  45: test_wdb_rootcheck
 45/170 Test  #45: test_wdb_rootcheck ......................................   Passed    0.01 sec
        Start  46: test_wdb_syscollector
 46/170 Test  #46: test_wdb_syscollector ...................................   Passed    0.04 sec
        Start  47: test_wdb_task
 47/170 Test  #47: test_wdb_task ...........................................   Passed    0.01 sec
        Start  48: test_wdb_delta_event
 48/170 Test  #48: test_wdb_delta_event ....................................   Passed    0.01 sec
        Start  49: test_wazuh_db-config
 49/170 Test  #49: test_wazuh_db-config ....................................   Passed    0.04 sec
        Start  50: test_wazuh_db_state
 50/170 Test  #50: test_wazuh_db_state .....................................   Passed    0.03 sec
        Start  51: test_wdb_com
 51/170 Test  #51: test_wdb_com ............................................   Passed    0.02 sec
        Start  52: test_wdb_pool
 52/170 Test  #52: test_wdb_pool ...........................................   Passed    0.03 sec
        Start  53: test_auth_parse
 53/170 Test  #53: test_auth_parse .........................................   Passed    0.04 sec
        Start  54: test_auth_validate
 54/170 Test  #54: test_auth_validate ......................................   Passed    0.05 sec
        Start  55: test_auth_add
 55/170 Test  #55: test_auth_add ...........................................   Passed    0.04 sec
        Start  56: test_ssl
 56/170 Test  #56: test_ssl ................................................   Passed    0.02 sec
        Start  57: test_auth_key_request
 57/170 Test  #57: test_auth_key_request ...................................   Passed    0.04 sec
        Start  58: test_auth
 58/170 Test  #58: test_auth ...............................................   Passed    0.05 sec
        Start  59: test_generate_cert
 59/170 Test  #59: test_generate_cert ......................................   Passed    0.02 sec
        Start  60: test_authd-config
 60/170 Test  #60: test_authd-config .......................................   Passed    0.02 sec
        Start  61: test_msgs
 61/170 Test  #61: test_msgs ...............................................   Passed    0.02 sec
        Start  62: test_keys
 62/170 Test  #62: test_keys ...............................................   Passed    0.03 sec
        Start  63: test_sha1_op
 63/170 Test  #63: test_sha1_op ............................................   Passed    0.02 sec
        Start  64: test_blowfish_op
 64/170 Test  #64: test_blowfish_op ........................................   Passed    0.01 sec
        Start  65: test_md5_op
 65/170 Test  #65: test_md5_op .............................................   Passed    0.02 sec
        Start  66: test_md5_sha1_op
 66/170 Test  #66: test_md5_sha1_op ........................................   Passed    0.01 sec
        Start  67: test_md5_sha1_sha256_op
 67/170 Test  #67: test_md5_sha1_sha256_op .................................   Passed    0.02 sec
        Start  68: test_sha256_op
 68/170 Test  #68: test_sha256_op ..........................................   Passed    0.01 sec
        Start  69: test_sha512_op
 69/170 Test  #69: test_sha512_op ..........................................   Passed    0.01 sec
        Start  70: test_wm_aws
 70/170 Test  #70: test_wm_aws .............................................   Passed    0.15 sec
        Start  71: test_wm_azure
 71/170 Test  #71: test_wm_azure ...........................................   Passed    0.14 sec
        Start  72: test_wm_ciscat
 72/170 Test  #72: test_wm_ciscat ..........................................   Passed    0.17 sec
        Start  73: test_wm_command
 73/170 Test  #73: test_wm_command .........................................   Passed    0.14 sec
        Start  74: test_wm_database
 74/170 Test  #74: test_wm_database ........................................   Passed    0.05 sec
        Start  75: test_wm_docker
 75/170 Test  #75: test_wm_docker ..........................................   Passed    0.12 sec
        Start  76: test_wm_gcp
 76/170 Test  #76: test_wm_gcp .............................................   Passed    0.14 sec
        Start  77: test_wmodules_gcp
 77/170 Test  #77: test_wmodules_gcp .......................................   Passed    0.15 sec
        Start  78: test_wm_oscap
 78/170 Test  #78: test_wm_oscap ...........................................   Passed    0.14 sec
        Start  79: test_wm_sca
 79/170 Test  #79: test_wm_sca .............................................   Passed    0.18 sec
        Start  80: test_wmodules_scheduling
 80/170 Test  #80: test_wmodules_scheduling ................................   Passed    0.03 sec
        Start  81: test_wm_vuln_detector
 81/170 Test  #81: test_wm_vuln_detector ...................................   Passed    0.21 sec
        Start  82: test_wm_vuln_detector_evr
 82/170 Test  #82: test_wm_vuln_detector_evr ...............................   Passed    0.03 sec
        Start  83: test_wm_vuln_detector_nvd
 83/170 Test  #83: test_wm_vuln_detector_nvd ...............................   Passed    0.15 sec
        Start  84: test_wm_vuln_detector_run_now
 84/170 Test  #84: test_wm_vuln_detector_run_now ...........................   Passed    0.12 sec
        Start  85: test_wm_task_manager
 85/170 Test  #85: test_wm_task_manager ....................................   Passed    0.13 sec
        Start  86: test_wm_task_manager_parsing
 86/170 Test  #86: test_wm_task_manager_parsing ............................   Passed    0.02 sec
        Start  87: test_wm_task_manager_commands
 87/170 Test  #87: test_wm_task_manager_commands ...........................   Passed    0.03 sec
        Start  88: test_wm_agent_upgrade
 88/170 Test  #88: test_wm_agent_upgrade ...................................   Passed    0.02 sec
        Start  89: test_wm_agent_upgrade_manager
 89/170 Test  #89: test_wm_agent_upgrade_manager ...........................   Passed    0.11 sec
        Start  90: test_wm_agent_upgrade_parsing
 90/170 Test  #90: test_wm_agent_upgrade_parsing ...........................   Passed    0.13 sec
        Start  91: test_wm_agent_upgrade_validate
 91/170 Test  #91: test_wm_agent_upgrade_validate ..........................   Passed    0.03 sec
        Start  92: test_wm_agent_upgrade_tasks
 92/170 Test  #92: test_wm_agent_upgrade_tasks .............................   Passed    0.01 sec
        Start  93: test_wm_agent_upgrade_tasks_callbacks
 93/170 Test  #93: test_wm_agent_upgrade_tasks_callbacks ...................   Passed    0.10 sec
        Start  94: test_wm_agent_upgrade_commands
 94/170 Test  #94: test_wm_agent_upgrade_commands ..........................   Passed    0.11 sec
        Start  95: test_wm_agent_upgrade_upgrades
 95/170 Test  #95: test_wm_agent_upgrade_upgrades ..........................   Passed    0.13 sec
        Start  96: test_wmodules
 96/170 Test  #96: test_wmodules ...........................................   Passed    0.10 sec
        Start  97: test_wm_control
 97/170 Test  #97: test_wm_control .........................................   Passed    0.09 sec
        Start  98: test_wm_github
 98/170 Test  #98: test_wm_github ..........................................   Passed    0.11 sec
        Start  99: test_wm_office365
 99/170 Test  #99: test_wm_office365 .......................................   Passed    0.14 sec
        Start 100: test_wm_ms_graph
100/170 Test #100: test_wm_ms_graph ........................................   Passed    0.14 sec
        Start 101: test_wm_osquery_already_running
101/170 Test #101: test_wm_osquery_already_running .........................   Passed    0.12 sec
        Start 102: test_monitord
102/170 Test #102: test_monitord ...........................................   Passed    0.07 sec
        Start 103: test_monitor_actions
103/170 Test #103: test_monitor_actions ....................................   Passed    0.17 sec
        Start 104: test_logcollector
104/170 Test #104: test_logcollector .......................................   Passed    0.12 sec
        Start 105: test_read_multiline_regex
105/170 Test #105: test_read_multiline_regex ...............................   Passed    0.11 sec
        Start 106: test_localfile-config
106/170 Test #106: test_localfile-config ...................................   Passed    0.11 sec
        Start 107: test_state
107/170 Test #107: test_state ..............................................   Passed    0.04 sec
        Start 108: test_lccom
108/170 Test #108: test_lccom ..............................................   Passed    0.10 sec
        Start 109: test_macos_log
109/170 Test #109: test_macos_log ..........................................   Passed    0.04 sec
        Start 110: test_read_macos
110/170 Test #110: test_read_macos .........................................   Passed    0.11 sec
        Start 111: test_read_multiline
111/170 Test #111: test_read_multiline .....................................   Passed    0.13 sec
        Start 112: test_execd
112/170 Test #112: test_execd ..............................................   Passed    0.02 sec
        Start 113: test_get_command_by_name
113/170 Test #113: test_get_command_by_name ................................   Passed    0.03 sec
        Start 114: test_integrator
114/170 Test #114: test_integrator .........................................   Passed    0.04 sec
        Start 115: test_manage_keys
115/170 Test #115: test_manage_keys ........................................   Passed    0.04 sec
        Start 116: test_printtable
116/170 Test #116: test_printtable .........................................   Passed    0.02 sec
        Start 117: test_syscom
117/170 Test #117: test_syscom .............................................   Passed    0.04 sec
        Start 118: test_fim_diff_changes
118/170 Test #118: test_fim_diff_changes ...................................   Passed    0.14 sec
        Start 119: test_run_realtime
119/170 Test #119: test_run_realtime .......................................   Passed    0.15 sec
        Start 120: test_config
120/170 Test #120: test_config .............................................   Passed    0.18 sec
        Start 121: test_syscheck
121/170 Test #121: test_syscheck ...........................................   Passed    0.10 sec
        Start 122: test_run_check
122/170 Test #122: test_run_check ..........................................   Passed    0.12 sec
        Start 123: test_create_db
123/170 Test #123: test_create_db ..........................................   Passed    0.34 sec
        Start 124: test_audit_healthcheck
124/170 Test #124: test_audit_healthcheck ..................................   Passed    0.13 sec
        Start 125: test_audit_rule_handling
125/170 Test #125: test_audit_rule_handling ................................   Passed    0.12 sec
        Start 126: test_syscheck_audit
126/170 Test #126: test_syscheck_audit .....................................   Passed    0.13 sec
        Start 127: test_audit_parse
127/170 Test #127: test_audit_parse ........................................   Passed    0.17 sec
        Start 128: test_list_op
128/170 Test #128: test_list_op ............................................   Passed    0.15 sec
        Start 129: test_file_op
129/170 Test #129: test_file_op ............................................   Passed    0.02 sec
        Start 130: test_integrity_op
130/170 Test #130: test_integrity_op .......................................   Passed    0.01 sec
        Start 131: test_rbtree_op
131/170 Test #131: test_rbtree_op ..........................................   Passed    0.03 sec
        Start 132: test_validate_op
132/170 Test #132: test_validate_op ........................................   Passed    0.03 sec
        Start 133: test_string_op
133/170 Test #133: test_string_op ..........................................   Passed    0.02 sec
        Start 134: test_expression
134/170 Test #134: test_expression .........................................   Passed    0.03 sec
        Start 135: test_version_op
135/170 Test #135: test_version_op .........................................   Passed    0.03 sec
        Start 136: test_queue_op
136/170 Test #136: test_queue_op ...........................................   Passed    0.02 sec
        Start 137: test_queue_linked_op
137/170 Test #137: test_queue_linked_op ....................................   Passed    0.02 sec
        Start 138: test_agent_op
138/170 Test #138: test_agent_op ...........................................   Passed    0.02 sec
        Start 139: test_enrollment_op
139/170 Test #139: test_enrollment_op ......................................   Passed    0.06 sec
        Start 140: test_time_op
140/170 Test #140: test_time_op ............................................   Passed    0.02 sec
        Start 141: test_buffer_op
141/170 Test #141: test_buffer_op ..........................................   Passed    0.02 sec
        Start 142: test_utf8_op
142/170 Test #142: test_utf8_op ............................................   Passed    0.03 sec
        Start 143: test_log_builder
143/170 Test #143: test_log_builder ........................................   Passed    0.03 sec
        Start 144: test_custom_output_search_replace
144/170 Test #144: test_custom_output_search_replace .......................   Passed    0.02 sec
        Start 145: test_bzip2_op
145/170 Test #145: test_bzip2_op ...........................................   Passed    0.02 sec
        Start 146: test_schedule_scan
146/170 Test #146: test_schedule_scan ......................................   Passed    0.03 sec
        Start 147: test_rootcheck_op
147/170 Test #147: test_rootcheck_op .......................................   Passed    0.02 sec
        Start 148: test_fs_op
148/170 Test #148: test_fs_op ..............................................   Passed    0.02 sec
        Start 149: test_wazuhdb_op
149/170 Test #149: test_wazuhdb_op .........................................   Passed    0.03 sec
        Start 150: test_syscheck_op
150/170 Test #150: test_syscheck_op ........................................   Passed    0.15 sec
        Start 151: test_json_op
151/170 Test #151: test_json_op ............................................   Passed    0.03 sec
        Start 152: test_audit_op
152/170 Test #152: test_audit_op ...........................................   Passed    0.02 sec
        Start 153: test_privsep_op
153/170 Test #153: test_privsep_op .........................................   Passed    0.02 sec
        Start 154: test_mq_op
154/170 Test #154: test_mq_op ..............................................   Passed    0.03 sec
        Start 155: test_remoted_op
155/170 Test #155: test_remoted_op .........................................   Passed    0.04 sec
        Start 156: test_json-queue
156/170 Test #156: test_json-queue .........................................   Passed    0.01 sec
        Start 157: test_bqueue
157/170 Test #157: test_bqueue .............................................   Passed    0.02 sec
        Start 158: test_atomic
158/170 Test #158: test_atomic .............................................   Passed    0.02 sec
        Start 159: test_url
159/170 Test #159: test_url ................................................   Passed    0.03 sec
        Start 160: test_sysinfo_utils
160/170 Test #160: test_sysinfo_utils ......................................   Passed    0.03 sec
        Start 161: test_rwlock_op
161/170 Test #161: test_rwlock_op ..........................................   Passed    0.03 sec
        Start 162: test_os_xml
162/170 Test #162: test_os_xml .............................................   Passed    0.06 sec
        Start 163: test_os_regex
163/170 Test #163: test_os_regex ...........................................   Passed    0.03 sec
        Start 164: test_os_regex_match
164/170 Test #164: test_os_regex_match .....................................   Passed    0.01 sec
        Start 165: test_os_regex_execute
165/170 Test #165: test_os_regex_execute ...................................   Passed    0.04 sec
        Start 166: test_os_zlib
166/170 Test #166: test_os_zlib ............................................   Passed    0.03 sec
        Start 167: test_client-config_validate_ipv6_link_local_interface
167/170 Test #167: test_client-config_validate_ipv6_link_local_interface ...   Passed    0.10 sec
        Start 168: test_os_net
168/170 Test #168: test_os_net .............................................   Passed    0.09 sec
        Start 169: test_fluentd_forwarder
169/170 Test #169: test_fluentd_forwarder ..................................   Passed    0.16 sec
        Start 170: test_active-response
170/170 Test #170: test_active-response ....................................   Passed    0.03 sec

100% tests passed, 0 tests failed out of 170

Total Test time (real) =  13.36 sec
UTs agent linux
ctest
Test project /home/vagrant/wazuh/src/unit_tests/build
      Start  1: test_start_agent
 1/66 Test  #1: test_start_agent ........................................   Passed    0.04 sec
      Start  2: test_notify
 2/66 Test  #2: test_notify .............................................   Passed    0.03 sec
      Start  3: test_agentd_state
 3/66 Test  #3: test_agentd_state .......................................   Passed    0.09 sec
      Start  4: test_buffer
 4/66 Test  #4: test_buffer .............................................   Passed    0.08 sec
      Start  5: test_logcollector
 5/66 Test  #5: test_logcollector .......................................   Passed    0.06 sec
      Start  6: test_read_multiline_regex
 6/66 Test  #6: test_read_multiline_regex ...............................   Passed    0.05 sec
      Start  7: test_localfile-config
 7/66 Test  #7: test_localfile-config ...................................   Passed    0.04 sec
      Start  8: test_state
 8/66 Test  #8: test_state ..............................................   Passed    0.03 sec
      Start  9: test_lccom
 9/66 Test  #9: test_lccom ..............................................   Passed    0.03 sec
      Start 10: test_macos_log
10/66 Test #10: test_macos_log ..........................................   Passed    0.04 sec
      Start 11: test_read_macos
11/66 Test #11: test_read_macos .........................................   Passed    0.18 sec
      Start 12: test_read_multiline
12/66 Test #12: test_read_multiline .....................................   Passed    0.05 sec
      Start 13: test_execd
13/66 Test #13: test_execd ..............................................   Passed    0.02 sec
      Start 14: test_get_command_by_name
14/66 Test #14: test_get_command_by_name ................................   Passed    0.06 sec
      Start 15: test_wm_control
15/66 Test #15: test_wm_control .........................................   Passed    0.04 sec
      Start 16: test_wm_github
16/66 Test #16: test_wm_github ..........................................   Passed    0.06 sec
      Start 17: test_wm_office365
17/66 Test #17: test_wm_office365 .......................................   Passed    0.08 sec
      Start 18: test_wm_ms_graph
18/66 Test #18: test_wm_ms_graph ........................................   Passed    0.08 sec
      Start 19: test_wm_osquery_already_running
19/66 Test #19: test_wm_osquery_already_running .........................   Passed    0.04 sec
      Start 20: test_syscom
20/66 Test #20: test_syscom .............................................   Passed    0.03 sec
      Start 21: test_fim_diff_changes
21/66 Test #21: test_fim_diff_changes ...................................   Passed    0.04 sec
      Start 22: test_run_realtime
22/66 Test #22: test_run_realtime .......................................   Passed    0.06 sec
      Start 23: test_config
23/66 Test #23: test_config .............................................   Passed    0.08 sec
      Start 24: test_syscheck
24/66 Test #24: test_syscheck ...........................................   Passed    0.06 sec
      Start 25: test_run_check
25/66 Test #25: test_run_check ..........................................   Passed    0.09 sec
      Start 26: test_create_db
26/66 Test #26: test_create_db ..........................................   Passed    0.11 sec
      Start 27: test_audit_healthcheck
27/66 Test #27: test_audit_healthcheck ..................................   Passed    0.11 sec
      Start 28: test_audit_rule_handling
28/66 Test #28: test_audit_rule_handling ................................   Passed    0.09 sec
      Start 29: test_syscheck_audit
29/66 Test #29: test_syscheck_audit .....................................   Passed    0.08 sec
      Start 30: test_audit_parse
30/66 Test #30: test_audit_parse ........................................   Passed    0.07 sec
      Start 31: test_list_op
31/66 Test #31: test_list_op ............................................   Passed    0.03 sec
      Start 32: test_file_op
32/66 Test #32: test_file_op ............................................   Passed    0.01 sec
      Start 33: test_integrity_op
33/66 Test #33: test_integrity_op .......................................   Passed    0.01 sec
      Start 34: test_rbtree_op
34/66 Test #34: test_rbtree_op ..........................................   Passed    0.01 sec
      Start 35: test_validate_op
35/66 Test #35: test_validate_op ........................................   Passed    0.02 sec
      Start 36: test_string_op
36/66 Test #36: test_string_op ..........................................   Passed    0.08 sec
      Start 37: test_expression
37/66 Test #37: test_expression .........................................   Passed    0.03 sec
      Start 38: test_version_op
38/66 Test #38: test_version_op .........................................   Passed    0.08 sec
      Start 39: test_queue_op
39/66 Test #39: test_queue_op ...........................................   Passed    0.02 sec
      Start 40: test_queue_linked_op
40/66 Test #40: test_queue_linked_op ....................................   Passed    0.02 sec
      Start 41: test_agent_op
41/66 Test #41: test_agent_op ...........................................   Passed    0.04 sec
      Start 42: test_enrollment_op
42/66 Test #42: test_enrollment_op ......................................   Passed    0.04 sec
      Start 43: test_time_op
43/66 Test #43: test_time_op ............................................   Passed    0.02 sec
      Start 44: test_buffer_op
44/66 Test #44: test_buffer_op ..........................................   Passed    0.02 sec
      Start 45: test_utf8_op
45/66 Test #45: test_utf8_op ............................................   Passed    0.02 sec
      Start 46: test_log_builder
46/66 Test #46: test_log_builder ........................................   Passed    0.09 sec
      Start 47: test_custom_output_search_replace
47/66 Test #47: test_custom_output_search_replace .......................   Passed    0.02 sec
      Start 48: test_syscheck_op
48/66 Test #48: test_syscheck_op ........................................   Passed    0.18 sec
      Start 49: test_json_op
49/66 Test #49: test_json_op ............................................   Passed    0.04 sec
      Start 50: test_audit_op
50/66 Test #50: test_audit_op ...........................................   Passed    0.02 sec
      Start 51: test_privsep_op
51/66 Test #51: test_privsep_op .........................................   Passed    0.01 sec
      Start 52: test_mq_op
52/66 Test #52: test_mq_op ..............................................   Passed    0.03 sec
      Start 53: test_remoted_op
53/66 Test #53: test_remoted_op .........................................   Passed    0.03 sec
      Start 54: test_atomic
54/66 Test #54: test_atomic .............................................   Passed    0.02 sec
      Start 55: test_url
55/66 Test #55: test_url ................................................   Passed    0.02 sec
      Start 56: test_sysinfo_utils
56/66 Test #56: test_sysinfo_utils ......................................   Passed    0.01 sec
      Start 57: test_rwlock_op
57/66 Test #57: test_rwlock_op ..........................................   Passed    0.03 sec
      Start 58: test_os_xml
58/66 Test #58: test_os_xml .............................................   Passed    0.10 sec
      Start 59: test_os_regex
59/66 Test #59: test_os_regex ...........................................   Passed    0.02 sec
      Start 60: test_os_regex_match
60/66 Test #60: test_os_regex_match .....................................   Passed    0.02 sec
      Start 61: test_os_regex_execute
61/66 Test #61: test_os_regex_execute ...................................   Passed    0.04 sec
      Start 62: test_os_zlib
62/66 Test #62: test_os_zlib ............................................   Passed    0.10 sec
      Start 63: test_client-config_validate_ipv6_link_local_interface
63/66 Test #63: test_client-config_validate_ipv6_link_local_interface ...   Passed    0.04 sec
      Start 64: test_os_net
64/66 Test #64: test_os_net .............................................   Passed    0.04 sec
      Start 65: test_fluentd_forwarder
65/66 Test #65: test_fluentd_forwarder ..................................   Passed    0.06 sec
      Start 66: test_active-response
66/66 Test #66: test_active-response ....................................   Passed    0.05 sec

100% tests passed, 0 tests failed out of 66

Total Test time (real) =   3.50 sec

@TomasTurina TomasTurina merged commit 6047ac7 into 4.7.5 May 16, 2024
52 of 61 checks passed
@TomasTurina TomasTurina deleted the fix/23422-groups-hash branch May 16, 2024 16: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.

Create WazuhDB endpoint to recalculate agent group hashes
2 participants