cfn-nag 0.4.76 → 0.4.77
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfn-nag/base_rule.rb +29 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3d59fc5867e4366cd00b37eae68a69769d7af34a70fb2943105adb7a26350cf
|
4
|
+
data.tar.gz: fe4be7d1cfc4b6541ca2d7aaba3bd5ad982ff308035645ab72e6856abce237ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c502124b35231428e618c5153dd7d6c56e98876b687f5cf89a05e4d6efbaa51c1ad5bedfd7992b5bcca92eaf1708c0a38d97a29e0f9ba0aef529f77427f21486
|
7
|
+
data.tar.gz: d494b760537c900a3b1b9bb020ecf601b481346c3fb39da665759c23c98a64aab520e607446a9da432998e1bee97625238ad0f25715a41fb68842ff4c3087426
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
|
5
|
+
# Base class all Rules should subclass
|
6
|
+
class CfnNag
|
7
|
+
class BaseRule
|
8
|
+
##
|
9
|
+
# Returns a collection of logical resource ids
|
10
|
+
#
|
11
|
+
def audit_impl(_cfn_model)
|
12
|
+
raise 'must implement in subclass'
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# Returns nil when there are no violations
|
17
|
+
# Returns a Violation object otherwise
|
18
|
+
#
|
19
|
+
def audit(cfn_model)
|
20
|
+
logical_resource_ids = audit_impl(cfn_model)
|
21
|
+
return if logical_resource_ids.empty?
|
22
|
+
|
23
|
+
Violation.new(id: rule_id,
|
24
|
+
type: rule_type,
|
25
|
+
message: rule_text,
|
26
|
+
logical_resource_ids: logical_resource_ids)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn-nag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.77
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- bin/cfn_nag_rules
|
150
150
|
- bin/cfn_nag_scan
|
151
151
|
- lib/cfn-nag.rb
|
152
|
+
- lib/cfn-nag/base_rule.rb
|
152
153
|
- lib/cfn-nag/blacklist_loader.rb
|
153
154
|
- lib/cfn-nag/cfn_nag.rb
|
154
155
|
- lib/cfn-nag/cfn_nag_config.rb
|