wazuh-ruby-client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/CHANGELOG.md +0 -0
  6. data/Gemfile +5 -0
  7. data/LICENSE +21 -0
  8. data/README.md +74 -0
  9. data/Rakefile +6 -0
  10. data/docs/.nojekyll +0 -0
  11. data/docs/Wazuh/Api/Endpoints/ActiveResponse.html +278 -0
  12. data/docs/Wazuh/Api/Endpoints/Agents.html +1877 -0
  13. data/docs/Wazuh/Api/Endpoints/Cache.html +415 -0
  14. data/docs/Wazuh/Api/Endpoints/Ciscat.html +418 -0
  15. data/docs/Wazuh/Api/Endpoints/Cluster.html +2270 -0
  16. data/docs/Wazuh/Api/Endpoints/Decoders.html +860 -0
  17. data/docs/Wazuh/Api/Endpoints/Experimental.html +2610 -0
  18. data/docs/Wazuh/Api/Endpoints/Lists.html +452 -0
  19. data/docs/Wazuh/Api/Endpoints/Manager.html +1596 -0
  20. data/docs/Wazuh/Api/Endpoints/Rootcheck.html +1025 -0
  21. data/docs/Wazuh/Api/Endpoints/Rules.html +872 -0
  22. data/docs/Wazuh/Api/Endpoints/SecurityConfigurationAssessment.html +680 -0
  23. data/docs/Wazuh/Api/Endpoints/Summary.html +199 -0
  24. data/docs/Wazuh/Api/Endpoints/Syscheck.html +755 -0
  25. data/docs/Wazuh/Api/Endpoints/Syscollector.html +2069 -0
  26. data/docs/Wazuh/Api/Endpoints.html +292 -0
  27. data/docs/Wazuh/Api/Errors/TooManyRequestsError.html +398 -0
  28. data/docs/Wazuh/Api/Errors/WazuhError.html +290 -0
  29. data/docs/Wazuh/Api/Errors.html +117 -0
  30. data/docs/Wazuh/Api.html +133 -0
  31. data/docs/Wazuh/Client.html +521 -0
  32. data/docs/Wazuh/Config.html +223 -0
  33. data/docs/Wazuh/Faraday/Connection.html +110 -0
  34. data/docs/Wazuh/Faraday/Request.html +335 -0
  35. data/docs/Wazuh/Faraday/Response/RaiseError.html +191 -0
  36. data/docs/Wazuh/Faraday/Response.html +115 -0
  37. data/docs/Wazuh/Faraday.html +117 -0
  38. data/docs/Wazuh/Logger.html +201 -0
  39. data/docs/Wazuh.html +256 -0
  40. data/docs/WazuhRubyClient.html +121 -0
  41. data/docs/_index.html +391 -0
  42. data/docs/class_list.html +51 -0
  43. data/docs/css/common.css +1 -0
  44. data/docs/css/full_list.css +58 -0
  45. data/docs/css/style.css +496 -0
  46. data/docs/file.README.html +142 -0
  47. data/docs/file_list.html +56 -0
  48. data/docs/frames.html +17 -0
  49. data/docs/index.html +142 -0
  50. data/docs/js/app.js +292 -0
  51. data/docs/js/full_list.js +216 -0
  52. data/docs/js/jquery.js +4 -0
  53. data/docs/method_list.html +1059 -0
  54. data/docs/top-level-namespace.html +110 -0
  55. data/lib/tasks/api.rake +78 -0
  56. data/lib/wazuh/api/endpoints/active_response.rb +22 -0
  57. data/lib/wazuh/api/endpoints/agents.rb +175 -0
  58. data/lib/wazuh/api/endpoints/cache.rb +38 -0
  59. data/lib/wazuh/api/endpoints/ciscat.rb +43 -0
  60. data/lib/wazuh/api/endpoints/cluster.rb +199 -0
  61. data/lib/wazuh/api/endpoints/decoders.rb +91 -0
  62. data/lib/wazuh/api/endpoints/experimental.rb +309 -0
  63. data/lib/wazuh/api/endpoints/lists.rb +42 -0
  64. data/lib/wazuh/api/endpoints/manager.rb +156 -0
  65. data/lib/wazuh/api/endpoints/rootcheck.rb +93 -0
  66. data/lib/wazuh/api/endpoints/rules.rb +80 -0
  67. data/lib/wazuh/api/endpoints/security_configuration_assessment.rb +73 -0
  68. data/lib/wazuh/api/endpoints/summary.rb +15 -0
  69. data/lib/wazuh/api/endpoints/syscheck.rb +75 -0
  70. data/lib/wazuh/api/endpoints/syscollector.rb +227 -0
  71. data/lib/wazuh/api/endpoints.rb +37 -0
  72. data/lib/wazuh/api/error.rb +6 -0
  73. data/lib/wazuh/api/errors/too_many_requests_error.rb +22 -0
  74. data/lib/wazuh/api/errors/wazuh_error.rb +14 -0
  75. data/lib/wazuh/client.rb +27 -0
  76. data/lib/wazuh/config.rb +42 -0
  77. data/lib/wazuh/faraday/connection.rb +38 -0
  78. data/lib/wazuh/faraday/request.rb +38 -0
  79. data/lib/wazuh/faraday/response/raise_error.rb +11 -0
  80. data/lib/wazuh/logger.rb +13 -0
  81. data/lib/wazuh/version.rb +4 -0
  82. data/lib/wazuh-ruby-client/version.rb +3 -0
  83. data/lib/wazuh-ruby-client.rb +17 -0
  84. data/lib/wazuh_ruby_client.rb +2 -0
  85. data/wazuh-ruby-client.gemspec +43 -0
  86. metadata +200 -0
@@ -0,0 +1,91 @@
1
+ module Wazuh
2
+ module Api
3
+ module Endpoints
4
+ module Decoders
5
+ #
6
+ # Get all decoders
7
+ # Returns all decoders included in ossec.conf.
8
+ #
9
+ # @option options [offset] :offset
10
+ # First element to return in the collection.
11
+ # @option options [limit] :limit
12
+ # Maximum number of elements to return.
13
+ # @option options [sort] :sort
14
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
15
+ # @option options [search] :search
16
+ # Looks for elements with the specified string.
17
+ # @option options [file] :file
18
+ # Filters by filename.
19
+ # @option options [path] :path
20
+ # Filters by path.
21
+ # @option options [status] :status
22
+ # Filters the decoders by status.
23
+ # Allowed values: enabled, disabled, all
24
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-all-decoders
25
+ def all_decoders(options = {})
26
+ get '/decoders', options
27
+ end
28
+
29
+ # Get all decoders files
30
+ # Returns all decoders files included in ossec.conf.
31
+ #
32
+ #
33
+ # @option options [offset] :offset
34
+ # First element to return in the collection.
35
+ # @option options [limit] :limit
36
+ # Maximum number of elements to return.
37
+ # @option options [sort] :sort
38
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
39
+ # @option options [search] :search
40
+ # Looks for elements with the specified string.
41
+ # @option options [file] :file
42
+ # Filters by filename.
43
+ # @option options [path] :path
44
+ # Filters by path.
45
+ # @option options [status] :status
46
+ # Filters the decoders by status.
47
+ # Allowed values: enabled, disabled, all
48
+ # @option options [download] :download
49
+ # Name of the decoder file to download.
50
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-all-decoders-files
51
+ def all_decoders_files(options = {})
52
+ get '/decoders/files', options
53
+ end
54
+
55
+ # Get all parent decoders
56
+ # Returns all parent decoders included in ossec.conf.
57
+ #
58
+ # @option options [offset] :offset
59
+ # First element to return in the collection.
60
+ # @option options [limit] :limit
61
+ # Maximum number of elements to return.
62
+ # @option options [sort] :sort
63
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
64
+ # @option options [search] :search
65
+ # Looks for elements with the specified string.
66
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-all-parent-decoders
67
+ def all_parent_decoders(options = {})
68
+ get '/decoders/parents', options
69
+ end
70
+
71
+ # Get decoders by name
72
+ # Returns the decoders with the specified name.
73
+ #
74
+ # @param [String] decoder_name
75
+ # Decoder name
76
+ # @option options [offset] :offset
77
+ # First element to return in the collection.
78
+ # @option options [limit] :limit
79
+ # Maximum number of elements to return.
80
+ # @option options [sort] :sort
81
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
82
+ # @option options [search] :search
83
+ # Looks for elements with the specified string.
84
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-decoders-by-name
85
+ def decoders_by_name(decoder_name, options = {})
86
+ get "/decoders/#{decoder_name}", options
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,309 @@
1
+ module Wazuh
2
+ module Api
3
+ module Endpoints
4
+ module Experimental
5
+ # These methods are experimental API wrapper and
6
+ # requires `experimental_*` prefix.
7
+
8
+ #
9
+ # Clear syscheck database
10
+ # Clears the syscheck database for all agents.
11
+ #
12
+ def experimental_clear_syscheck_database
13
+ delete '/experimental/syscheck'
14
+ end
15
+
16
+ # Get hardware info of all agents
17
+ # Returns the agent’s hardware info.
18
+ #
19
+ # @option options [agent_id] :agent_id
20
+ # Agent ID
21
+ # @option options [offset] :offset
22
+ # First element to return in the collection.
23
+ # @option options [limit] :limit
24
+ # Maximum number of elements to return.
25
+ # @option options [sort] :sort
26
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
27
+ # @option options [search] :search
28
+ # Looks for elements with the specified string.
29
+ # @option options [select] :select
30
+ # List of selected fields separated by commas.
31
+ # @option options [ram_free] :ram_free
32
+ # Filters by ram_free.
33
+ # @option options [ram_total] :ram_total
34
+ # Filters by ram_total.
35
+ # @option options [cpu_cores] :cpu_cores
36
+ # Filters by cpu_cores.
37
+ # @option options [cpu_mhz] :cpu_mhz
38
+ # Filters by cpu_mhz.
39
+ # @option options [cpu_name] :cpu_name
40
+ # Filters by cpu_name.
41
+ # @option options [board_serial] :board_serial
42
+ # Filters by board_serial.
43
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-hardware-info-of-all-agents
44
+ def experimental_hardware(options = {})
45
+ get '/experimental/syscollector/hardware', options
46
+ end
47
+
48
+ # Get network address info of all agents
49
+ # Returns the agent’s network address info.
50
+ #
51
+ # @option options [agent_id] :agent_id
52
+ # @option options [offset] :offset
53
+ # First element to return in the collection.
54
+ # @option options [limit] :limit
55
+ # Maximum number of elements to return.
56
+ # @option options [sort] :sort
57
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
58
+ # @option options [search] :search
59
+ # Looks for elements with the specified string.
60
+ # @option options [select] :select
61
+ # List of selected fields separated by commas.
62
+ # @option options [iface] :iface
63
+ # Filters by interface name.
64
+ # @option options [proto] :proto
65
+ # Filters by proto.
66
+ # @option options [address] :address
67
+ # Filters by address.
68
+ # @option options [broadcast] :broadcast
69
+ # Filters by broadcast.
70
+ # @option options [netmask] :netmask
71
+ # Filters by netmask.
72
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-network-address-info-of-all-agents
73
+ def experimental_netaddr(options = {})
74
+ get '/experimental/syscollector/netaddr', options
75
+ end
76
+
77
+ # Get network interface info of all agents
78
+ # Returns the agent’s network interface info.
79
+ #
80
+ # @option options [offset] :offset
81
+ # First element to return in the collection.
82
+ # @option options [limit] :limit
83
+ # Maximum number of elements to return.
84
+ # @option options [sort] :sort
85
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
86
+ # @option options [search] :search
87
+ # Looks for elements with the specified string.
88
+ # @option options [select] :select
89
+ # List of selected fields separated by commas.
90
+ # @option options [name] :name
91
+ # Filters by name.
92
+ # @option options [adapter] :adapter
93
+ # Filters by adapter.
94
+ # @option options [type] :type
95
+ # Filters by type.
96
+ # @option options [state] :state
97
+ # Filters by state.
98
+ # @option options [mtu] :mtu
99
+ # Filters by mtu.
100
+ # @option options [tx_packets] :tx_packets
101
+ # @option options [rx_packets] :rx_packets
102
+ # @option options [tx_bytes] :tx_bytes
103
+ # @option options [rx_bytes] :rx_bytes
104
+ # @option options [tx_errors] :tx_errors
105
+ # @option options [rx_errors] :rx_errors
106
+ # @option options [tx_dropped] :tx_dropped
107
+ # @option options [rx_dropped] :rx_dropped
108
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-network-interface-info-of-all-agents
109
+ def experimental_netiface(options = {})
110
+ get '/experimental/syscollector/netiface', options
111
+ end
112
+
113
+ # Get network protocol info of all agents
114
+ # Returns the agent’s network protocol info.
115
+ #
116
+ # @option options [agent_id] :agent_id
117
+ # @option options [offset] :offset
118
+ # First element to return in the collection.
119
+ # @option options [limit] :limit
120
+ # Maximum number of elements to return.
121
+ # @option options [sort] :sort
122
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
123
+ # @option options [search] :search
124
+ # Looks for elements with the specified string.
125
+ # @option options [select] :select
126
+ # List of selected fields separated by commas.
127
+ # @option options [iface] :iface
128
+ # Filters by interface name.
129
+ # @option options [type] :type
130
+ # Filters by type.
131
+ # @option options [gateway] :gateway
132
+ # Filters by gateway.
133
+ # @option options [dhcp] :dhcp
134
+ # Filters by dhcp.
135
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-network-protocol-info-of-all-agents
136
+ def experimental_netproto(options = {})
137
+ get '/experimental/syscollector/netproto', options
138
+ end
139
+
140
+ # Get os info of all agents
141
+ # Returns the agent’s os info.
142
+ #
143
+ # @option options [agent_id] :agent_id
144
+ # ID to agent
145
+ # @option options [limit] :limit
146
+ # Maximum number of elements to return.
147
+ # @option options [sort] :sort
148
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
149
+ # @option options [search] :search
150
+ # Looks for elements with the specified string.
151
+ # @option options [offset] :offset
152
+ # First element to return in the collection.
153
+ # @option options [select] :select
154
+ # List of selected fields separated by commas.
155
+ # @option options [os_name] :os_name
156
+ # Filters by os_name.
157
+ # @option options [architecture] :architecture
158
+ # Filters by architecture.
159
+ # @option options [os_version] :os_version
160
+ # Filters by os_version.
161
+ # @option options [version] :version
162
+ # Filters by version.
163
+ # @option options [release] :release
164
+ # Filters by release.
165
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-os-info-of-all-agents
166
+ def experimental_os(options = {})
167
+ get '/experimentalsyscollector/os', options
168
+ end
169
+
170
+ # Get packages info of all agents
171
+ # Returns the agent’s packages info.
172
+ #
173
+ # @option options [agent_id] :agent_id
174
+ # @option options [offset] :offset
175
+ # First element to return in the collection.
176
+ # @option options [limit] :limit
177
+ # Maximum number of elements to return.
178
+ # @option options [sort] :sort
179
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
180
+ # @option options [search] :search
181
+ # Looks for elements with the specified string.
182
+ # @option options [select] :select
183
+ # List of selected fields separated by commas.
184
+ # @option options [vendor] :vendor
185
+ # Filters by vendor.
186
+ # @option options [name] :name
187
+ # Filters by name.
188
+ # @option options [architecture] :architecture
189
+ # Filters by architecture.
190
+ # @option options [format] :format
191
+ # Filters by format.
192
+ # @option options [version] :version
193
+ # Filters by format.
194
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-packages-info-of-all-agents
195
+ def experimental_packages(options = {})
196
+ get '/experimental/syscollector/packages', options
197
+ end
198
+
199
+ # Get ports info of all agents
200
+ # Returns the agent’s ports info.
201
+ #
202
+ # @option options [agent_id] :agent_id
203
+ # @option options [offset] :offset
204
+ # First element to return in the collection.
205
+ # @option options [limit] :limit
206
+ # Maximum number of elements to return.
207
+ # @option options [sort] :sort
208
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
209
+ # @option options [search] :search
210
+ # Looks for elements with the specified string.
211
+ # @option options [select] :select
212
+ # List of selected fields separated by commas.
213
+ # @option options [pid] :pid
214
+ # Filters by pid.
215
+ # @option options [protocol] :protocol
216
+ # Filters by protocol.
217
+ # @option options [local_ip] :local_ip
218
+ # Filters by local_ip.
219
+ # @option options [local_port] :local_port
220
+ # Filters by local_port.
221
+ # @option options [remote_ip] :remote_ip
222
+ # Filters by remote_ip.
223
+ # @option options [tx_queue] :tx_queue
224
+ # Filters by tx_queue.
225
+ # @option options [state] :state
226
+ # Filters by state.
227
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-ports-info-of-all-agents
228
+ def experimental_ports(options = {})
229
+ get '/experimental/syscollector/ports', options
230
+ end
231
+
232
+ # Get processes info of all agents
233
+ # Returns the agent’s processes info.
234
+ #
235
+ # @option options [agent_id] :agent_id
236
+ # @option options [offset] :offset
237
+ # First element to return in the collection.
238
+ # @option options [limit] :limit
239
+ # Maximum number of elements to return.
240
+ # @option options [sort] :sort
241
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
242
+ # @option options [search] :search
243
+ # Looks for elements with the specified string.
244
+ # @option options [select] :select
245
+ # List of selected fields separated by commas.
246
+ # @option options [pid] :pid
247
+ # Filters by pid.
248
+ # @option options [state] :state
249
+ # Filters by process state.
250
+ # @option options [ppid] :ppid
251
+ # Filters by process parent pid.
252
+ # @option options [egroup] :egroup
253
+ # Filters by process egroup.
254
+ # @option options [euser] :euser
255
+ # Filters by process euser.
256
+ # @option options [fgroup] :fgroup
257
+ # Filters by process fgroup.
258
+ # @option options [name] :name
259
+ # Filters by process name.
260
+ # @option options [nlwp] :nlwp
261
+ # Filters by process nlwp.
262
+ # @option options [pgrp] :pgrp
263
+ # Filters by process pgrp.
264
+ # @option options [priority] :priority
265
+ # Filters by process priority.
266
+ # @option options [rgroup] :rgroup
267
+ # Filters by process rgroup.
268
+ # @option options [ruser] :ruser
269
+ # Filters by process ruser.
270
+ # @option options [sgroup] :sgroup
271
+ # Filters by process sgroup.
272
+ # @option options [suser] :suser
273
+ # Filters by process suser.
274
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-processes-info-of-all-agents
275
+ def experimental_processes(options = {})
276
+ get '/experimental/syscollector/processes', options
277
+ end
278
+
279
+ # Get CIS-CAT results
280
+ # Returns the agent’s ciscat results info.
281
+ #
282
+ # @option options [agent_id] :agent_id
283
+ # ID to agent
284
+ # @option options [offset] :offset
285
+ # First element to return in the collection.
286
+ # @option options [limit] :limit
287
+ # Maximum number of elements to return.
288
+ # @option options [sort] :sort
289
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
290
+ # @option options [search] :search
291
+ # Looks for elements with the specified string.
292
+ # @option options [select] :select
293
+ # List of selected fields separated by commas.
294
+ # @option options [benchmark] :benchmark
295
+ # @option options [profile] :profile
296
+ # @option options [pass] :pass
297
+ # @option options [fail] :fail
298
+ # @option options [error] :error
299
+ # @option options [notchecked] :notchecked
300
+ # @option options [unknown] :unkown
301
+ # @option options [score] :score
302
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-cis-cat-results
303
+ def experimental_ciscat_results(options = {})
304
+ get '/experimental/ciscat/results', options
305
+ end
306
+ end
307
+ end
308
+ end
309
+ end
@@ -0,0 +1,42 @@
1
+ module Wazuh
2
+ module Api
3
+ module Endpoints
4
+ module Lists
5
+ #
6
+ # Get all lists
7
+ # Returns the content of all CDB lists.
8
+ #
9
+ # @option options [offset] :offset
10
+ # First element to return in the collection.
11
+ # @option options [limit] :limit
12
+ # Maximum number of elements to return.
13
+ # @option options [sort] :sort
14
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
15
+ # @option options [search] :search
16
+ # Looks for elements with the specified string.
17
+ # @option options [path] :path
18
+ # Filters by path.
19
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-all-lists
20
+ def cdb_lists(options = {})
21
+ get '/lists', options
22
+ end
23
+
24
+ # Get paths from all lists
25
+ # Returns the path from all lists.
26
+ #
27
+ # @option options [offset] :offset
28
+ # First element to return in the collection.
29
+ # @option options [limit] :limit
30
+ # Maximum number of elements to return.
31
+ # @option options [sort] :sort
32
+ # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
33
+ # @option options [search] :search
34
+ # Looks for elements with the specified string.
35
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-paths-from-all-lists
36
+ def cdb_files(options = {})
37
+ get '/lists/files', options
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,156 @@
1
+ module Wazuh
2
+ module Api
3
+ module Endpoints
4
+ module Manager
5
+ # Get manager active configuration
6
+ # Returns the requested configuration in JSON format.
7
+ #
8
+ # @param [String] component
9
+ # Selected component.
10
+ # @param [String] configuration
11
+ # Configuration to read.
12
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-manager-active-configuration
13
+ def manager_active_configuration(component, configuration)
14
+ get "/manager/config/#{component}/#{configuration}"
15
+ end
16
+
17
+ # Get manager configuration
18
+ # Returns ossec.conf in JSON format.
19
+ #
20
+ # @option options [section] :section
21
+ # Indicates the ossec.conf section: global, rules, syscheck, rootcheck, remote, alerts, command, active-response, localfile.
22
+ # @option options [field] :field
23
+ # Indicates a section child, e.g, fields for rule section are: include, decoder_dir, etc.
24
+ def manager_configuration(options = {})
25
+ get '/manager/configuration', options
26
+ end
27
+
28
+ # Check Wazuh configuration
29
+ # Returns if Wazuh configuration is OK.
30
+ #
31
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#check-wazuh-configuration
32
+ def check_manager_configuration
33
+ get '/manager/configuration/validation'
34
+ end
35
+
36
+ # Delete a local file
37
+ # Confirmation message.
38
+ #
39
+ # @option options [path] :path
40
+ # Relative path of file. This parameter is mandatory.
41
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#delete-a-local-file
42
+ def delete_manager_local_file(options = {})
43
+ delete '/manager/files', options
44
+ end
45
+
46
+ # Get local file
47
+ # Returns the content of a local file (rules, decoders and lists).
48
+ #
49
+ # @option options [path] :path
50
+ # Relative path of file. This parameter is mandatory.
51
+ # @option options [validation] :validation
52
+ # Validates the content of the file. An error will be returned if file content is not strictly correct. False by default.
53
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-local-file
54
+ def get_manager_local_file(options = {})
55
+ get '/manager/files', options
56
+ end
57
+
58
+ # Update local file
59
+ # Upload a local file (rules, decoders and lists).
60
+ #
61
+ # @option options [path] :path
62
+ # Relative path of file. This parameter is mandatory.
63
+ # @option options [validation] :validation
64
+ # Validates the content of the file. An error will be returned if file content is not strictly correct. False by default.
65
+ # @option options [overwrite] :overwrite
66
+ # Replaces the existing file. False by default.
67
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#update-local-file
68
+ def update_manager_local_file(options = {})
69
+ post '/manager/files', options
70
+ end
71
+
72
+ # Get manager information
73
+ # Returns basic information about manager.
74
+ #
75
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-manager-information
76
+ def manager_information
77
+ get '/manager/info'
78
+ end
79
+
80
+ # Get manager status
81
+ # Returns the status of the manager processes.
82
+ #
83
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-manager-status
84
+ def manager_status
85
+ get '/manager/status'
86
+ end
87
+
88
+ # Get ossec.log
89
+ # Returns the three last months of ossec.log.
90
+ #
91
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-ossec-log
92
+ def manager_log
93
+ get '/manager/logs'
94
+ end
95
+
96
+ # Get summary of ossec.log
97
+ # Returns a summary of the last three months of the <code>ossec.log</code> file.
98
+ #
99
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-summary-of-ossec-log
100
+ def manager_summary_log
101
+ get '/manager/logs/summary'
102
+ end
103
+
104
+ # Restart Wazuh manager
105
+ # Restarts Wazuh manager.
106
+ #
107
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#restart-wazuh-manager
108
+ def restart_manager
109
+ put '/manager/restart'
110
+ end
111
+
112
+ # Get analysisd stats
113
+ # Returns a summary of the current analysisd stats.
114
+ #
115
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-analysisd-stats
116
+ def manager_analysisd_stats
117
+ get '/manager/stats/analysisd'
118
+ end
119
+
120
+ # Get manager stats
121
+ # Returns Wazuh statistical information for the current or specified date.
122
+ #
123
+ # @option options [date] :date
124
+ # Selects the date for getting the statistical information. Format: YYYYMMDD
125
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-manager-stats
126
+ def manager_stats(options = {})
127
+ get '/manager/stats', options
128
+ end
129
+
130
+ # Get manager stats by hour
131
+ # Returns Wazuh statistical information per hour. Each number in the averages field represents the average of alerts per hour.
132
+ #
133
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-manager-stats-by-hour
134
+ def manager_stats_by_hour
135
+ get '/manager/stats/hourly'
136
+ end
137
+
138
+ # Get manager stats by weekly
139
+ # Returns Wazuh statistical information per week. Each number in the hours field represents the average alerts per hour for that specific day.
140
+ #
141
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-manager-stats-by-week
142
+ def manager_stats_by_weekly
143
+ get '/manager/stats/weekly'
144
+ end
145
+
146
+ # Get remoted stats
147
+ # Returns a summary of the current remoted stats.
148
+ #
149
+ # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-remoted-stats
150
+ def manager_remoted_stats
151
+ get '/manager/stats/remoted'
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end