wazuh-ruby-client 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15da6e2031a3436d1aa11ec4131497d2d616f3c27d997a92183f4a8e3e94d19e
4
- data.tar.gz: a47ef14bb2e13720cf96f37942d88d496de56767e4a0a451fddc1cf7df3eb45d
3
+ metadata.gz: 63a6ddbb80cd6499e2cfe9a11f7b217db920f19f36a77c9adc0028e9395c9493
4
+ data.tar.gz: 6d83f60c2fb3cfc72d1ae0d6577c247b460b64ad3bacca2b9ee2b0a6d827793e
5
5
  SHA512:
6
- metadata.gz: d8914b3341e3d265defb99a63a8cde65218deb403f0b08eeac95de57f4381cce16b185a86a5c7bd027f1dfe06ee195bee02debe9f2b68f7425432bcf30601e86
7
- data.tar.gz: ac233ed7ba42fded2d84806fa2517a1517474795cf01940adab08aa5cce8ca9a72008c36d727f6404009f6eaa78cb714162877164df24457acfa5bc917364fb9
6
+ metadata.gz: e14095fa07607dbbac624bec91b8bbe0da5225eb582cde3e68302c9d17891e0b548df48507434a9dd88e33c1ba76e0fd03106539ec100a41a1316466c758bfd7
7
+ data.tar.gz: 032f27fbfbdff5ad128beca87f9331abc241dfaa349278d9ca97c37bc4ba74c8e77bc95cd105939efe59c07bb93af615c17fb847cbe5cec9b546c0cc95d97225
data/CHANGELOG.md CHANGED
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- Bump up to 0.2.0
10
+ ## [0.2.1] - 2019-02-10
11
+
12
+ - Fix `syscheck_files()` duplicated and confused
11
13
 
12
14
  ## [0.2.0] - 2019-02-03
13
15
 
data/README.md CHANGED
@@ -78,30 +78,37 @@ Get all agents list.
78
78
 
79
79
  ```ruby
80
80
  > client.all_agents
81
- # => {"error"=>0,
82
- "data"=>
83
- {"items"=>
84
- [{"os"=>
85
- {"arch"=>"x86_64",
86
- "codename"=>"Xenial Xerus",
87
- "major"=>"16",
88
- "minor"=>"04",
89
- "name"=>"Ubuntu",
90
- "platform"=>"ubuntu",
91
- "uname"=>"Linux |wazuh-manager-master-0 |4.14.138+ |#1 SMP Tue Sep 3 02:58:08 PDT 2019 |x86_64",
92
- "version"=>"16.04.6 LTS"},
93
- "status"=>"Active",
94
- "dateAdd"=>"2020-01-07 16:13:05",
95
- "ip"=>"127.0.0.1",
96
- "id"=>"000",
97
- "registerIP"=>"127.0.0.1",
98
- "node_name"=>"wazuh-manager-master",
99
- "manager"=>"wazuh-manager-master-0",
100
- "name"=>"wazuh-manager-master-0",
101
- "lastKeepAlive"=>"9999-12-31 23:59:59",
102
- "version"=>"Wazuh v3.11.1"}],
103
- ...
104
- "totalItems"=>5}}
81
+ => [
82
+ {
83
+ :os=>{
84
+ :arch=>"x86_64",
85
+ :codename=>"Xenial Xerus",
86
+ :major=>"16",
87
+ :minor=>"04",
88
+ :name=>"Ubuntu",
89
+ :platform=>"ubuntu",
90
+ :uname=>"Linux |wazuh-manager |4.15.0-60-generic |#67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 |x86_64",
91
+ :version=>"16.04.6 LTS"
92
+ },
93
+ :manager=>"wazuh-manager",
94
+ :id=>"000",
95
+ :registerIP=>"127.0.0.1",
96
+ :name=>"wazuh-manager",
97
+ :version=>"Wazuh v3.11.0",
98
+ :ip=>"127.0.0.1",
99
+ :dateAdd=>"2020-01-27 17:02:18",
100
+ :status=>"Active",
101
+ :lastKeepAlive=>"9999-12-31 23:59:59",
102
+ :node_name=>"wazuh-master-1"
103
+ },
104
+ ...
105
+ ]
106
+
107
+ > agents.first.os.name
108
+ => "Ubuntu"
109
+
110
+ > agents.first.id
111
+ => "000"
105
112
  ```
106
113
 
107
114
  filter by options. (see https://mrtc0.github.io/wazuh-ruby-client/Wazuh/Api/Endpoints/Agents.html#all_agents-instance_method )
@@ -118,7 +125,7 @@ filter by options. (see https://mrtc0.github.io/wazuh-ruby-client/Wazuh/Api/Endp
118
125
  List agent's packages.
119
126
 
120
127
  ```ruby
121
- > client.packages('000')['data']['items'].map { |package| package['name'] }
128
+ > client.packages('000').map { |package| package.name }
122
129
  => ["python-apt-common",
123
130
  "python-idna",
124
131
  "libedit2",
@@ -133,7 +140,7 @@ List agent's packages.
133
140
  List agents' processes.
134
141
 
135
142
  ```ruby
136
- > client.processes('000')['data']['items'].map { |p| p['name'] }
143
+ > client.packages('000').map { |package| package.name }
137
144
  => ["entrypoint.sh",
138
145
  "my_init",
139
146
  "syslog-ng",
@@ -55,39 +55,6 @@ module Wazuh
55
55
  get "/syscheck/#{agent_id}/last_scan"
56
56
  end
57
57
 
58
- # Returns the syscheck files of an agent.
59
- #
60
- # @param [String] agent_id
61
- # ID to agent
62
- # @option options [offset] :offset
63
- # First element to return in the collection.
64
- # @option options [limit] :limit
65
- # Maximum number of elements to return.
66
- # @option options [sort] :sort
67
- # Sorts the collection by a field or fields (separated by comma). Use +/- at the beginning to list in ascending or descending order.
68
- # @option options [search] :search
69
- # Looks for elements with the specified string.
70
- # @option options [file] :file
71
- # Filters file by filename.
72
- # @option options [type] :type
73
- # Selects type of file. Allowed values: file, registry
74
- # @option options [summary] :summary
75
- # Returns a summary grouping by filename. Allowed values: yes, no
76
- # @option options [select] :select
77
- # List of selected fields separated by commas.
78
- # @option options [md5] :md5
79
- # Returns the files with the specified md5 hash.
80
- # @option options [sha1] :sha1
81
- # Returns the files with the specified sha1 hash.
82
- # @option options [sha256] :sha256
83
- # Returns the files with the specified sha256 hash.
84
- # @option options [hash] :hash
85
- # Returns the files with the specified hash (md5, sha1 or sha256).
86
- # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#get-syscheck-files
87
- def syscheck_files(agent_id, options)
88
- get "/syscheck/#{agent_id}", options
89
- end
90
-
91
58
  # Runs syscheck and rootcheck on all agents (Wazuh launches both processes simultaneously).
92
59
  #
93
60
  # @see https://documentation.wazuh.com/3.10/user-manual/api/reference.html#run-syscheck-scan-in-all-agents
data/lib/wazuh/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Wazuh
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module WazuhRubyClient
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wazuh-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mrtc0
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-03 00:00:00.000000000 Z
11
+ date: 2020-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler