controls 1.6.2 → 1.7.0.beta.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
  SHA1:
3
- metadata.gz: 8b1c93eb63aeddc68b6c3e57e8fcf7ff1dab140e
4
- data.tar.gz: 0fb1ceed1c6803e3db982e71b6588a8d507d2d43
3
+ metadata.gz: aa017f4f3585d9259d937543ea48e9491d59954d
4
+ data.tar.gz: abe2acf9f7704682b07cef385dba35e3e59aaeae
5
5
  SHA512:
6
- metadata.gz: c77f122347f6e0055d4ab1c9bd3f9452264ded8070aa3614d0ab129e8abe87e870a853d24f794068786e33b131eb76ad64ee22e90ab9cfe777b4bd695c1394db
7
- data.tar.gz: 6b486869dc0e58225ab8f7527facdd302630308cbc99b26ab1efe9a20c11cd3131e7dba7c3ac9f01c28fd336e3e4dad5f5c767270ed45c8aba36dc292de5fdf0
6
+ metadata.gz: 42d0bc45400ab1278e705ff15b097dc0106e139c5eb3e855bf8250809f6bde5d250618d07a5d903a7a73908794aaa24574ba767eb112e346414bd655be041010
7
+ data.tar.gz: 2793dcd70a0dab72a895485694245356a6eeaf5b6ab37edc84e6f7ff27fa8d6cf51f2a97b835cdc21e71e0cf737030a4a8c8f13f006d5744e75fb3251cd8650f
@@ -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
- coerce :securityControlFindings, Controls::SecurityControlFinding
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})
@@ -1,9 +1,7 @@
1
1
  module Controls
2
2
  class ConfigurationFinding < Dish::Plate
3
- coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
4
-
5
3
  def to_s
6
- "#{state}: #{reason.strip}"
4
+ "#{name}: state: #{state} reason: #{reason.strip}"
7
5
  end
8
6
  end
9
7
  end
@@ -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 :configurationFindings, Controls::ConfigurationFinding
6
+ coerce :findings, Controls::ConfigurationFinding
7
7
 
8
8
  def to_s
9
- "#{security_control_name}: #{configuration_findings.map { |finding| "\n #{finding}" }.join}"
9
+ "#{name}: #{findings.map { |finding| "\n #{finding}" }.join}"
10
10
  end
11
11
  end
12
12
  end
@@ -1,4 +1,4 @@
1
1
  module Controls
2
2
  # The version of the Controls gem
3
- VERSION = '1.6.2'
3
+ VERSION = '1.7.0.beta.1'
4
4
  end
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.6.2
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: '0'
158
+ version: 1.3.1
158
159
  requirements: []
159
160
  rubyforge_project:
160
161
  rubygems_version: 2.2.0