cfn-nag 0.0.7 → 0.0.8
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/lib/cfn_nag.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 898a03235a0e5f60db7d512e532421d8f3b13c8d
|
4
|
+
data.tar.gz: db5914055e86cb2e84cf050465c07a5ddc24b024
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc90748561f981c22c07090c8fb6f544939a2d94dc6e1bfcecfe86a808448b35e663eecf8d29c00d9e3331ecd805f2cfd0c237275da00b32a1f1d91c43956df
|
7
|
+
data.tar.gz: 3a38d26c0124022075ff41869bb77a948b74d2fbb115dfd602e91009689b44b695c0624ff01c2c60846d36573f16bdd1a19238c3898c68cd99beb3831d393f20
|
data/lib/cfn_nag.rb
CHANGED
@@ -40,11 +40,17 @@ class CfnNag
|
|
40
40
|
private
|
41
41
|
|
42
42
|
def audit_file(input_json_path:)
|
43
|
-
fail 'not even legit JSON' unless legal_json?(input_json_path)
|
44
43
|
@stop_processing = false
|
45
44
|
@violations = []
|
46
45
|
|
47
|
-
|
46
|
+
unless legal_json?(input_json_path)
|
47
|
+
@violations << Violation.new(type: Violation::FAILING_VIOLATION,
|
48
|
+
message: 'not even legit JSON',
|
49
|
+
violating_code: IO.read(input_json_path))
|
50
|
+
@stop_processing = true
|
51
|
+
end
|
52
|
+
|
53
|
+
generic_json_rules input_json_path unless @stop_processing == true
|
48
54
|
|
49
55
|
custom_rules input_json_path unless @stop_processing == true
|
50
56
|
|
@@ -58,7 +64,7 @@ class CfnNag
|
|
58
64
|
if ::File.directory? input_json_path
|
59
65
|
templates = find_templates_in_directory(directory: input_json_path)
|
60
66
|
elsif ::File.file? input_json_path
|
61
|
-
templates = [input_json_path]
|
67
|
+
templates = [input_json_path.path]
|
62
68
|
else
|
63
69
|
fail "#{input_json_path} is not a proper path"
|
64
70
|
end
|