wazuh-ruby-client 0.3.0 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/CHANGELOG.md +25 -0
- data/README.md +18 -1
- data/Rakefile +4 -0
- data/docs/Wazuh/Api/Endpoints/ActiveResponse.html +10 -13
- data/docs/Wazuh/Api/Endpoints/Agents.html +483 -204
- data/docs/Wazuh/Api/Endpoints/Cache.html +7 -7
- data/docs/Wazuh/Api/Endpoints/Ciscat.html +10 -13
- data/docs/Wazuh/Api/Endpoints/Cluster.html +52 -58
- data/docs/Wazuh/Api/Endpoints/Decoders.html +27 -39
- data/docs/Wazuh/Api/Endpoints/Experimental.html +63 -96
- data/docs/Wazuh/Api/Endpoints/Lists.html +15 -21
- data/docs/Wazuh/Api/Endpoints/Manager.html +44 -62
- data/docs/Wazuh/Api/Endpoints/Rootcheck.html +36 -52
- data/docs/Wazuh/Api/Endpoints/Rules.html +49 -68
- data/docs/Wazuh/Api/Endpoints/SecurityConfigurationAssessment.html +20 -31
- data/docs/Wazuh/Api/Endpoints/Summary.html +7 -7
- data/docs/Wazuh/Api/Endpoints/Syscheck.html +26 -33
- data/docs/Wazuh/Api/Endpoints/Syscollector.html +43 -61
- data/docs/Wazuh/Api/Endpoints/V4/ActiveResponse.html +198 -0
- data/docs/Wazuh/Api/Endpoints/V4/Agents.html +1079 -0
- data/docs/Wazuh/Api/Endpoints/V4/Cache.html +195 -0
- data/docs/Wazuh/Api/Endpoints/V4/Ciscat.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Cluster.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Decoders.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Experimental.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Lists.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Manager.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Rootcheck.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Rules.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/SecurityConfigurationAssessment.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Summary.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Syscheck.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Syscollector.html +126 -0
- data/docs/Wazuh/Api/Endpoints/V4/Vulnerabilities.html +399 -0
- data/docs/Wazuh/Api/Endpoints/V4.html +403 -0
- data/docs/Wazuh/Api/Endpoints.html +9 -14
- data/docs/Wazuh/Api/Errors/WazuhError.html +9 -9
- data/docs/Wazuh/Api/Errors.html +6 -6
- data/docs/Wazuh/Api.html +7 -7
- data/docs/Wazuh/Client.html +35 -190
- data/docs/Wazuh/Config.html +20 -11
- data/docs/Wazuh/Logger.html +6 -6
- data/docs/Wazuh/Sawyer/Connection/Token.html +208 -0
- data/docs/Wazuh/Sawyer/Connection.html +19 -7
- data/docs/Wazuh/Sawyer/Request.html +78 -6
- data/docs/Wazuh/Sawyer.html +8 -8
- data/docs/Wazuh.html +16 -16
- data/docs/WazuhRubyClient.html +7 -7
- data/docs/_index.html +149 -7
- data/docs/class_list.html +3 -3
- data/docs/css/style.css +2 -2
- data/docs/file.README.html +39 -18
- data/docs/file_list.html +2 -2
- data/docs/frames.html +2 -2
- data/docs/index.html +39 -18
- data/docs/js/app.js +25 -3
- data/docs/method_list.html +269 -69
- data/docs/top-level-namespace.html +6 -6
- data/lib/wazuh/api/endpoints/v4/vulnerabilities.rb +47 -0
- data/lib/wazuh/api/endpoints/v4.rb +2 -1
- data/lib/wazuh/sawyer/connection.rb +2 -2
- data/lib/wazuh/sawyer/request.rb +5 -2
- data/lib/wazuh/sawyer/token.rb +1 -1
- data/lib/wazuh/version.rb +1 -1
- data/lib/wazuh-ruby-client/version.rb +1 -1
- metadata +25 -5
data/docs/index.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.25
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
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'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'>'</span><span class='tstring_content'>wazuh-ruby-client</span><span class='tstring_end'>'</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'>"</span><span class='tstring_content'>https://wazuh.local:55000</span><span class='tstring_end'>"</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'>"</span><span class='tstring_content'>foo</span><span class='tstring_end'>"</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'>"</span><span class='tstring_content'>bar</span><span class='tstring_end'>"</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='
|
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'># => {"error"=>0, "data"=>{"items"=>[{"os"=>{"arch"=>"x86_64", "codename"=>"Xenial Xerus", "major"=>"16", "minor"=>"04", "name"=>"Ubuntu", "platform"=>"ubuntu", "uname"=>"Linux |wazuh-manager-master-0 |4.14.138+ |#1 SMP Tue Sep 3 02:58:08 PDT 2019 |x86_64", "version"=>"16.04.6 LTS"}, "status"=>"Active", "name"=>"wazuh-manager-master-0", "registerIP"=>"127.0.0.1", "manager"=>"wazuh-manager-master-0", "dateAdd"=>"2020-01-07 16:13:05", "ip"=>"127.0.0.1", "node_name"=>"wazuh-manager-master", "version"=>"Wazuh v3.11.1", "lastKeepAlive"=>"9999-12-31 23:59:59", "id"=>"000"}], "totalItems"=>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
|
> client.all_agents({ 'os.name' => 'ubuntu' })
|
201
215
|
</code></pre>
|
202
216
|
|
203
|
-
<h3>Syscollector</h3>
|
217
|
+
<h3 id="syscollector">Syscollector</h3>
|
204
218
|
|
205
219
|
<p>List agent'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
|
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
|
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.
|
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
|
-
|
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++)
|
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
|
-
|
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
|
})();
|