controls 1.6.2 → 1.7.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/controls/client.rb +4 -2
- data/lib/controls/client/findings.rb +19 -0
- data/lib/controls/objects/asset.rb +4 -1
- data/lib/controls/objects/configuration_finding.rb +1 -3
- data/lib/controls/objects/security_control_finding.rb +2 -2
- data/lib/controls/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa017f4f3585d9259d937543ea48e9491d59954d
|
4
|
+
data.tar.gz: abe2acf9f7704682b07cef385dba35e3e59aaeae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42d0bc45400ab1278e705ff15b097dc0106e139c5eb3e855bf8250809f6bde5d250618d07a5d903a7a73908794aaa24574ba767eb112e346414bd655be041010
|
7
|
+
data.tar.gz: 2793dcd70a0dab72a895485694245356a6eeaf5b6ab37edc84e6f7ff27fa8d6cf51f2a97b835cdc21e71e0cf737030a4a8c8f13f006d5744e75fb3251cd8650f
|
data/lib/controls/client.rb
CHANGED
@@ -5,9 +5,10 @@ require 'controls/authentication'
|
|
5
5
|
require 'controls/configurable'
|
6
6
|
require 'controls/client/assessments'
|
7
7
|
require 'controls/client/assets'
|
8
|
-
require 'controls/client/events'
|
9
8
|
require 'controls/client/coverage'
|
10
9
|
require 'controls/client/configurations'
|
10
|
+
require 'controls/client/events'
|
11
|
+
require 'controls/client/findings'
|
11
12
|
require 'controls/client/guidance'
|
12
13
|
require 'controls/client/prioritized_guidance'
|
13
14
|
require 'controls/client/security_controls'
|
@@ -23,9 +24,10 @@ module Controls
|
|
23
24
|
include Controls::Configurable
|
24
25
|
include Controls::Client::Assessments
|
25
26
|
include Controls::Client::Assets
|
26
|
-
include Controls::Client::Events
|
27
27
|
include Controls::Client::Coverage
|
28
28
|
include Controls::Client::Configurations
|
29
|
+
include Controls::Client::Events
|
30
|
+
include Controls::Client::Findings
|
29
31
|
include Controls::Client::Guidance
|
30
32
|
include Controls::Client::PrioritizedGuidance
|
31
33
|
include Controls::Client::SecurityControls
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Controls
|
2
|
+
class Client
|
3
|
+
# A module to encapsulate API methods related to assets
|
4
|
+
# @since API v1.0
|
5
|
+
# @version v1.0.0
|
6
|
+
module Findings
|
7
|
+
# @!group Security Control/Configuration Findings Methods
|
8
|
+
|
9
|
+
# @param [String] uuid the UUID of the asset to retrieve findings for
|
10
|
+
# @raise [Controls::NotFound] if the uuid didn't match any assets
|
11
|
+
# @return [Hash] a hash representing the matching asset
|
12
|
+
def findings_by_asset_uuid(uuid, params = {})
|
13
|
+
get "/assets/#{uuid}/findings", params
|
14
|
+
end
|
15
|
+
|
16
|
+
# @!endgroup
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -3,7 +3,10 @@ require 'controls/objects/security_control_finding'
|
|
3
3
|
module Controls
|
4
4
|
class Asset < Dish::Plate
|
5
5
|
coerce :discoveredAt, ->(value) { Time.at(value / 1000) if value }
|
6
|
-
|
6
|
+
|
7
|
+
def findings
|
8
|
+
Controls.client.findings_by_asset_uuid(uuid)
|
9
|
+
end
|
7
10
|
|
8
11
|
def to_s
|
9
12
|
%(#{host_name} (#{ipaddress}) - #{operating_system})
|
@@ -3,10 +3,10 @@ require 'controls/objects/configuration_finding'
|
|
3
3
|
module Controls
|
4
4
|
class SecurityControlFinding < Dish::Plate
|
5
5
|
coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
|
6
|
-
coerce :
|
6
|
+
coerce :findings, Controls::ConfigurationFinding
|
7
7
|
|
8
8
|
def to_s
|
9
|
-
"#{
|
9
|
+
"#{name}: #{findings.map { |finding| "\n #{finding}" }.join}"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/controls/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: controls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erran Carey
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/controls/client/configurations.rb
|
106
106
|
- lib/controls/client/coverage.rb
|
107
107
|
- lib/controls/client/events.rb
|
108
|
+
- lib/controls/client/findings.rb
|
108
109
|
- lib/controls/client/guidance.rb
|
109
110
|
- lib/controls/client/prioritized_guidance.rb
|
110
111
|
- lib/controls/client/security_controls.rb
|
@@ -152,9 +153,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
153
|
version: '0'
|
153
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
155
|
requirements:
|
155
|
-
- - "
|
156
|
+
- - ">"
|
156
157
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
158
|
+
version: 1.3.1
|
158
159
|
requirements: []
|
159
160
|
rubyforge_project:
|
160
161
|
rubygems_version: 2.2.0
|