controls 1.7.3 → 1.7.4
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 +4 -4
- data/apiary.apib +13 -11
- data/lib/controls/objects/configuration.rb +16 -0
- data/lib/controls/objects/coverage_information.rb +16 -0
- data/lib/controls/objects/security_control_coverage.rb +27 -0
- data/lib/controls/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065fa99a2640d1220a1ff42cc3e5cce250bb4b50
|
4
|
+
data.tar.gz: 54b996ced517d7709a9a0462e7407bc39e31c379
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 674bcfba75b727fac6740e128171ea14603855725bf1f5e7c8d3fce2abf67d3924fc54ef2e9d084e6e9d84751340e9112f13390c378ebeb1b32aab8fcaba3208
|
7
|
+
data.tar.gz: d0d18bd18e12f54ab6f32cca5c8726da967d255202905e4c668080dbafca77a0d95d05de93dd8c219f7d28329f12fdb84029fbdf6c12049172e0df595ee807ab
|
data/apiary.apib
CHANGED
@@ -29,16 +29,18 @@ Notes API is a *short texts saving* service similar to its physical paper presen
|
|
29
29
|
|
30
30
|
+ Response 200 (application/json)
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
[
|
33
|
+
{
|
34
|
+
"id": 1,
|
35
|
+
"assessing": false,
|
36
|
+
"highRiskAssetCount": 0,
|
37
|
+
"mediumRiskAssetCount": 24,
|
38
|
+
"lowRiskAssetCount": 0,
|
39
|
+
"totalAssetCount": 24,
|
40
|
+
"overallRiskScore": 4.004146038088617,
|
41
|
+
"timestamp": 1393184605912
|
42
|
+
}
|
43
|
+
]
|
42
44
|
|
43
45
|
# Group Search
|
44
46
|
## Assets [/assets/search?query={query}]
|
@@ -57,4 +59,4 @@ Notes API is a *short texts saving* service similar to its physical paper presen
|
|
57
59
|
"hostName": "CMMNCTR2K7R2-U",
|
58
60
|
"ipaddress": "10.4.19.25"
|
59
61
|
}
|
60
|
-
]
|
62
|
+
]
|
@@ -3,9 +3,25 @@ require 'controls/objects/coverage_information'
|
|
3
3
|
module Controls
|
4
4
|
# A representation of the Configuration resource w/ coverage information
|
5
5
|
class Configuration < Dish::Plate
|
6
|
+
include Comparable
|
7
|
+
|
6
8
|
coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
|
7
9
|
coerce :coverage, Controls::CoverageInformation
|
8
10
|
|
11
|
+
def <=>(other)
|
12
|
+
return unless other.respond_to? :coverage
|
13
|
+
coverage.percent_covered <=> other.coverage.percent_covered
|
14
|
+
end
|
15
|
+
|
16
|
+
# [review] - define this in Dish?
|
17
|
+
def respond_to?(method_name, *)
|
18
|
+
if method_name.eql? :coverage
|
19
|
+
true
|
20
|
+
else
|
21
|
+
super
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
9
25
|
# The title of the configuration
|
10
26
|
#
|
11
27
|
# @return [String]
|
@@ -2,6 +2,22 @@ module Controls
|
|
2
2
|
# A representation of the CoverageInformation for SecurityControl or
|
3
3
|
# Configuration coverage
|
4
4
|
class CoverageInformation < Dish::Plate
|
5
|
+
include Comparable
|
6
|
+
|
7
|
+
def <=>(other)
|
8
|
+
return unless other.respond_to? :percent_covered
|
9
|
+
percent_covered <=> other.percent_covered
|
10
|
+
end
|
11
|
+
|
12
|
+
# [review] - define this in Dish?
|
13
|
+
def respond_to?(method_name, *)
|
14
|
+
if method_name.eql? :percent_covered
|
15
|
+
true
|
16
|
+
else
|
17
|
+
super
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
5
21
|
alias_method :to_s, :inspect
|
6
22
|
end
|
7
23
|
end
|
@@ -2,9 +2,36 @@ require 'controls/objects/coverage_information'
|
|
2
2
|
|
3
3
|
module Controls
|
4
4
|
class SecurityControlCoverage < Dish::Plate
|
5
|
+
include Comparable
|
6
|
+
|
7
|
+
|
5
8
|
coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
|
6
9
|
coerce :coverage, Controls::CoverageInformation
|
7
10
|
|
11
|
+
def <=>(other)
|
12
|
+
return unless other.respond_to? :coverage
|
13
|
+
coverage.percent_covered <=> other.coverage.percent_covered
|
14
|
+
end
|
15
|
+
|
16
|
+
# [review] - define this in Dish?
|
17
|
+
def respond_to?(method_name, *)
|
18
|
+
if method_name.eql? :coverage
|
19
|
+
true
|
20
|
+
else
|
21
|
+
super
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def without_coverage
|
26
|
+
Controls::SecurityControl.new(enabled: enabled, name: name)
|
27
|
+
end
|
28
|
+
|
29
|
+
def without_coverage!
|
30
|
+
@_original_hash.delete_if do |key, _value|
|
31
|
+
not %w[enabled name].include?(key)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
8
35
|
def to_s
|
9
36
|
title
|
10
37
|
end
|
data/lib/controls/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: controls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erran Carey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dish
|