wazuh-ruby-client 0.3.3 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql-analysis.yml +70 -0
  3. data/.rubocop.yml +59 -0
  4. data/CHANGELOG.md +35 -0
  5. data/README.md +18 -1
  6. data/Rakefile +5 -1
  7. data/docs/Wazuh/Api/Endpoints/ActiveResponse.html +10 -13
  8. data/docs/Wazuh/Api/Endpoints/Agents.html +483 -204
  9. data/docs/Wazuh/Api/Endpoints/Cache.html +7 -7
  10. data/docs/Wazuh/Api/Endpoints/Ciscat.html +10 -13
  11. data/docs/Wazuh/Api/Endpoints/Cluster.html +52 -58
  12. data/docs/Wazuh/Api/Endpoints/Decoders.html +27 -39
  13. data/docs/Wazuh/Api/Endpoints/Experimental.html +63 -96
  14. data/docs/Wazuh/Api/Endpoints/Lists.html +15 -21
  15. data/docs/Wazuh/Api/Endpoints/Manager.html +44 -62
  16. data/docs/Wazuh/Api/Endpoints/Rootcheck.html +36 -52
  17. data/docs/Wazuh/Api/Endpoints/Rules.html +49 -68
  18. data/docs/Wazuh/Api/Endpoints/SecurityConfigurationAssessment.html +20 -31
  19. data/docs/Wazuh/Api/Endpoints/Summary.html +7 -7
  20. data/docs/Wazuh/Api/Endpoints/Syscheck.html +26 -33
  21. data/docs/Wazuh/Api/Endpoints/Syscollector.html +43 -61
  22. data/docs/Wazuh/Api/Endpoints/V4/ActiveResponse.html +198 -0
  23. data/docs/Wazuh/Api/Endpoints/V4/Agents.html +1079 -0
  24. data/docs/Wazuh/Api/Endpoints/V4/Cache.html +195 -0
  25. data/docs/Wazuh/Api/Endpoints/V4/Ciscat.html +126 -0
  26. data/docs/Wazuh/Api/Endpoints/V4/Cluster.html +126 -0
  27. data/docs/Wazuh/Api/Endpoints/V4/Decoders.html +126 -0
  28. data/docs/Wazuh/Api/Endpoints/V4/Experimental.html +126 -0
  29. data/docs/Wazuh/Api/Endpoints/V4/Lists.html +126 -0
  30. data/docs/Wazuh/Api/Endpoints/V4/Manager.html +126 -0
  31. data/docs/Wazuh/Api/Endpoints/V4/Rootcheck.html +126 -0
  32. data/docs/Wazuh/Api/Endpoints/V4/Rules.html +126 -0
  33. data/docs/Wazuh/Api/Endpoints/V4/SecurityConfigurationAssessment.html +126 -0
  34. data/docs/Wazuh/Api/Endpoints/V4/Summary.html +126 -0
  35. data/docs/Wazuh/Api/Endpoints/V4/Syscheck.html +126 -0
  36. data/docs/Wazuh/Api/Endpoints/V4/Syscollector.html +126 -0
  37. data/docs/Wazuh/Api/Endpoints/V4/Vulnerabilities.html +399 -0
  38. data/docs/Wazuh/Api/Endpoints/V4.html +403 -0
  39. data/docs/Wazuh/Api/Endpoints.html +9 -14
  40. data/docs/Wazuh/Api/Errors/WazuhError.html +9 -9
  41. data/docs/Wazuh/Api/Errors.html +6 -6
  42. data/docs/Wazuh/Api.html +7 -7
  43. data/docs/Wazuh/Client.html +35 -190
  44. data/docs/Wazuh/Config.html +20 -11
  45. data/docs/Wazuh/Logger.html +6 -6
  46. data/docs/Wazuh/Sawyer/Connection/Token.html +208 -0
  47. data/docs/Wazuh/Sawyer/Connection.html +19 -7
  48. data/docs/Wazuh/Sawyer/Request.html +78 -6
  49. data/docs/Wazuh/Sawyer.html +8 -8
  50. data/docs/Wazuh.html +16 -16
  51. data/docs/WazuhRubyClient.html +7 -7
  52. data/docs/_index.html +149 -7
  53. data/docs/class_list.html +3 -3
  54. data/docs/css/style.css +2 -2
  55. data/docs/file.README.html +39 -18
  56. data/docs/file_list.html +2 -2
  57. data/docs/frames.html +2 -2
  58. data/docs/index.html +39 -18
  59. data/docs/js/app.js +25 -3
  60. data/docs/method_list.html +269 -69
  61. data/docs/top-level-namespace.html +6 -6
  62. data/lib/wazuh/api/endpoints/agents.rb +1 -1
  63. data/lib/wazuh/api/endpoints/rootcheck.rb +1 -1
  64. data/lib/wazuh/api/endpoints/security_configuration_assessment.rb +1 -1
  65. data/lib/wazuh/api/endpoints/syscollector.rb +1 -1
  66. data/lib/wazuh/api/endpoints/v4/cluster.rb +127 -0
  67. data/lib/wazuh/api/endpoints/v4/vulnerabilities.rb +47 -0
  68. data/lib/wazuh/api/endpoints/v4.rb +2 -1
  69. data/lib/wazuh/client.rb +0 -1
  70. data/lib/wazuh/sawyer/connection.rb +1 -1
  71. data/lib/wazuh/sawyer/request.rb +26 -16
  72. data/lib/wazuh/version.rb +1 -1
  73. data/lib/wazuh-ruby-client/version.rb +1 -1
  74. metadata +23 -3
  75. data/.travis.yml +0 -7
data/docs/index.html CHANGED
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.16
9
+ &mdash; Documentation by YARD 0.9.25
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
14
 
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
16
 
17
- <script type="text/javascript" charset="utf-8">
17
+ <script type="text/javascript">
18
18
  pathId = "README";
19
19
  relpath = '';
20
20
  </script>
@@ -57,7 +57,7 @@
57
57
  <div class="clear"></div>
58
58
  </div>
59
59
 
60
- <div id="content"><div id='filecontents'><h1>Wazuh Ruby Client</h1>
60
+ <div id="content"><div id='filecontents'><h1 id="wazuh-ruby-client">Wazuh Ruby Client</h1>
61
61
 
62
62
  <p><a href="https://github.com/mrtc0/wazuh-ruby-client/blob/master/LICENSE.txt"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
63
63
  <img src="https://github.com/mrtc0/wazuh-ruby-client/workflows/GitHub%20Workflow/badge.svg" alt="">
@@ -65,28 +65,30 @@
65
65
 
66
66
  <p>A Ruby client for the wazuh APIs.</p>
67
67
 
68
- <h2>Installation</h2>
68
+ <h2 id="installation">Installation</h2>
69
69
 
70
70
  <p>Add this line to your application&#39;s Gemfile:</p>
71
71
 
72
72
  <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>wazuh-ruby-client</span><span class='tstring_end'>&#39;</span></span>
73
73
  </code></pre>
74
74
 
75
- <h2>Usage</h2>
75
+ <h2 id="usage">Usage</h2>
76
76
 
77
77
  <pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Wazuh.html" title="Wazuh (module)">Wazuh</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="Wazuh.html#configure-class_method" title="Wazuh.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
78
78
  <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_endpoint'>endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://wazuh.local:55000</span><span class='tstring_end'>&quot;</span></span>
79
79
  <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_basic_user'>basic_user</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>foo</span><span class='tstring_end'>&quot;</span></span>
80
80
  <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_basic_password'>basic_password</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bar</span><span class='tstring_end'>&quot;</span></span>
81
81
  <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_verify_ssl'>verify_ssl</span> <span class='op'>=</span> <span class='kw'>false</span>
82
- <span class='kw'>end</span>
82
+ <span class='comment'># if you are using the Wazuh version 4
83
+ </span> <span class='comment'># config.api_version = 4
84
+ </span><span class='kw'>end</span>
83
85
 
84
86
  <span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Wazuh.html" title="Wazuh (module)">Wazuh</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Wazuh/Client.html" title="Wazuh::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Wazuh/Client.html#initialize-instance_method" title="Wazuh::Client#initialize (method)">new</a></span></span>
85
87
  <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_all_agents'>all_agents</span>
86
88
  <span class='comment'># =&gt; {&quot;error&quot;=&gt;0, &quot;data&quot;=&gt;{&quot;items&quot;=&gt;[{&quot;os&quot;=&gt;{&quot;arch&quot;=&gt;&quot;x86_64&quot;, &quot;codename&quot;=&gt;&quot;Xenial Xerus&quot;, &quot;major&quot;=&gt;&quot;16&quot;, &quot;minor&quot;=&gt;&quot;04&quot;, &quot;name&quot;=&gt;&quot;Ubuntu&quot;, &quot;platform&quot;=&gt;&quot;ubuntu&quot;, &quot;uname&quot;=&gt;&quot;Linux |wazuh-manager-master-0 |4.14.138+ |#1 SMP Tue Sep 3 02:58:08 PDT 2019 |x86_64&quot;, &quot;version&quot;=&gt;&quot;16.04.6 LTS&quot;}, &quot;status&quot;=&gt;&quot;Active&quot;, &quot;name&quot;=&gt;&quot;wazuh-manager-master-0&quot;, &quot;registerIP&quot;=&gt;&quot;127.0.0.1&quot;, &quot;manager&quot;=&gt;&quot;wazuh-manager-master-0&quot;, &quot;dateAdd&quot;=&gt;&quot;2020-01-07 16:13:05&quot;, &quot;ip&quot;=&gt;&quot;127.0.0.1&quot;, &quot;node_name&quot;=&gt;&quot;wazuh-manager-master&quot;, &quot;version&quot;=&gt;&quot;Wazuh v3.11.1&quot;, &quot;lastKeepAlive&quot;=&gt;&quot;9999-12-31 23:59:59&quot;, &quot;id&quot;=&gt;&quot;000&quot;}], &quot;totalItems&quot;=&gt;1}}
87
89
  </span></code></pre>
88
90
 
89
- <h3>Authorization</h3>
91
+ <h3 id="authorization">Authorization</h3>
90
92
 
91
93
  <p>Set <code>basic_user</code> and <code>basic_password</code> for basic authentication.<br>
92
94
  If you using self-signed certificate, <code>verify_ssl</code> must be set to <code>false</code> .</p>
@@ -110,7 +112,7 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
110
112
  <span class='kw'>end</span>
111
113
  </code></pre>
112
114
 
113
- <h3>Global Settings</h3>
115
+ <h3 id="global-settings">Global Settings</h3>
114
116
 
115
117
  <p>The following global settings are supported via <code>Wazuh.configure</code> .</p>
116
118
 
@@ -125,6 +127,10 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
125
127
  <td style="text-align: left">User-Agent</td>
126
128
  </tr>
127
129
  <tr>
130
+ <td style="text-align: left">ca_file</td>
131
+ <td style="text-align: left">CA file (if use Client Certificate Authentication and specify CA file)</td>
132
+ </tr>
133
+ <tr>
128
134
  <td style="text-align: left">client_cert</td>
129
135
  <td style="text-align: left">Client certificate (if use Client Certificate Authentication)</td>
130
136
  </tr>
@@ -152,9 +158,17 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
152
158
  <td style="text-align: left">endpoint</td>
153
159
  <td style="text-align: left">Wazuh API endpoint URL</td>
154
160
  </tr>
161
+ <tr>
162
+ <td style="text-align: left">ignore_env_proxy</td>
163
+ <td style="text-align: left">Ignores ENV proxy settings</td>
164
+ </tr>
165
+ <tr>
166
+ <td style="text-align: left">api_version</td>
167
+ <td style="text-align: left">Wazuh API Version (3 or 4)</td>
168
+ </tr>
155
169
  </tbody></table>
156
170
 
157
- <h3>Agents</h3>
171
+ <h3 id="agents">Agents</h3>
158
172
 
159
173
  <p>Get all agents list.</p>
160
174
 
@@ -200,7 +214,7 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
200
214
  &gt; client.all_agents({ &#39;os.name&#39; =&gt; &#39;ubuntu&#39; })
201
215
  </code></pre>
202
216
 
203
- <h3>Syscollector</h3>
217
+ <h3 id="syscollector">Syscollector</h3>
204
218
 
205
219
  <p>List agent&#39;s packages.</p>
206
220
 
@@ -227,9 +241,10 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
227
241
  ...
228
242
  </code></pre>
229
243
 
230
- <h3>Other</h3>
244
+ <h3 id="other">Other</h3>
231
245
 
232
- <p>wazuh-ruby-client is support to all Wazuh API. </p>
246
+ <p>wazuh-ruby-client is supports some of the Wazuh API.<br>
247
+ The v4 API is not yet supported.</p>
233
248
 
234
249
  <ul>
235
250
  <li>[x] Active Response</li>
@@ -239,14 +254,20 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
239
254
  <li>[x] Cluster</li>
240
255
  <li>[x] Decoders</li>
241
256
  <li>[x] Experimental</li>
257
+ <li>[ ] Groups</li>
242
258
  <li>[x] Lists</li>
259
+ <li>[ ] Logtest</li>
260
+ <li>[ ] Mitre</li>
243
261
  <li>[x] Manager</li>
244
262
  <li>[x] Rootcheck</li>
245
263
  <li>[x] Rules</li>
264
+ <li>[ ] Security</li>
246
265
  <li>[x] Security Configuration Assessment</li>
247
266
  <li>[x] Summary</li>
248
267
  <li>[x] Syscheck</li>
249
268
  <li>[x] Syscollector</li>
269
+ <li>[ ] Tasks</li>
270
+ <li>[x] Vulnerability</li>
250
271
  </ul>
251
272
 
252
273
  <p>Refer to the document of wazuh-ruby-client and Wazuh API Reference for the list of all available methods.</p>
@@ -256,11 +277,11 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
256
277
  <li><a href="https://documentation.wazuh.com/3.10/user-manual/api/reference.html">https://documentation.wazuh.com/3.10/user-manual/api/reference.html</a></li>
257
278
  </ul>
258
279
 
259
- <h2>Contributing</h2>
280
+ <h2 id="contributing">Contributing</h2>
260
281
 
261
282
  <p>Bug reports and pull requests are welcome on GitHub at <a href="https://github.com/mrtc0/wazuh-ruby-client">https://github.com/mrtc0/wazuh-ruby-client</a>.</p>
262
283
 
263
- <h2>Copyright and License</h2>
284
+ <h2 id="copyright-and-license">Copyright and License</h2>
264
285
 
265
286
  <p>Copyright (c) 2015-2019, <a href="https://blog.ssrf.in">Kohei Morita</a></p>
266
287
 
@@ -268,9 +289,9 @@ If you using self-signed certificate, <code>verify_ssl</code> must be set to <co
268
289
  </div></div>
269
290
 
270
291
  <div id="footer">
271
- Generated on Tue Feb 18 20:12:27 2020 by
292
+ Generated on Thu Feb 3 21:40:17 2022 by
272
293
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
273
- 0.9.16 (ruby-2.5.1).
294
+ 0.9.25 (ruby-2.6.3).
274
295
  </div>
275
296
 
276
297
  </div>
data/docs/js/app.js CHANGED
@@ -171,6 +171,7 @@ function generateTOC() {
171
171
  var counter = 0;
172
172
  var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
173
173
  var i;
174
+ var curli;
174
175
  if ($('#filecontents h1').length > 1) tags.unshift('h1');
175
176
  for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
176
177
  var lastTag = parseInt(tags[0][1], 10);
@@ -190,15 +191,25 @@ function generateTOC() {
190
191
  }
191
192
  if (thisTag > lastTag) {
192
193
  for (i = 0; i < thisTag - lastTag; i++) {
193
- var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
194
+ if ( typeof(curli) == "undefined" ) {
195
+ curli = $('<li/>');
196
+ toc.append(curli);
197
+ }
198
+ toc = $('<ol/>');
199
+ curli.append(toc);
200
+ curli = undefined;
194
201
  }
195
202
  }
196
203
  if (thisTag < lastTag) {
197
- for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
204
+ for (i = 0; i < lastTag - thisTag; i++) {
205
+ toc = toc.parent();
206
+ toc = toc.parent();
207
+ }
198
208
  }
199
209
  var title = $(this).attr('toc-title');
200
210
  if (typeof(title) == "undefined") title = $(this).text();
201
- toc.append('<li><a href="#' + this.id + '">' + title + '</a></li>');
211
+ curli =$('<li><a href="#' + this.id + '">' + title + '</a></li>');
212
+ toc.append(curli);
202
213
  lastTag = thisTag;
203
214
  });
204
215
  if (!show) return;
@@ -275,6 +286,16 @@ function mainFocus() {
275
286
  setTimeout(function() { $('#main').focus(); }, 10);
276
287
  }
277
288
 
289
+ function navigationChange() {
290
+ // This works around the broken anchor navigation with the YARD template.
291
+ window.onpopstate = function() {
292
+ var hash = window.location.hash;
293
+ if (hash !== '' && $(hash)[0]) {
294
+ $(hash)[0].scrollIntoView();
295
+ }
296
+ };
297
+ }
298
+
278
299
  $(document).ready(function() {
279
300
  navResizer();
280
301
  navExpander();
@@ -287,6 +308,7 @@ $(document).ready(function() {
287
308
  constantSummaryToggle();
288
309
  generateTOC();
289
310
  mainFocus();
311
+ navigationChange();
290
312
  });
291
313
 
292
314
  })();