cfn-nag 0.4.52 → 0.4.53
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/custom_rules/SnsTopicKmsMasterKeyIdRule.rb +26 -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: a5879a914647027a3279e16ee24ce3a86c0aca1a92d7e045c9b839377477d8a4
|
|
4
|
+
data.tar.gz: 94ff330f8d6fc5f2e55732ed62b9b80881643a868cae1b73a5a34703b14467fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 360fa59f6f6cf013063a4f4283f6d5ed0ea72d6ccb45a1acfb90a5ad9b47d3fea2f5966bf2188dc02ff7c6aba600abdee6e640eddcb21472047165ce88f95163
|
|
7
|
+
data.tar.gz: 7a316065ca4413be9b11c868d9588177d7e2c273f083e030590ba2ef22a9881aa90bebf3ace78affddd124d26e716cc9dc017af7cdd5b3a3c2b40912cf8b1f16
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'cfn-nag/violation'
|
|
4
|
+
require_relative 'base'
|
|
5
|
+
|
|
6
|
+
class SnsTopicKmsMasterKeyIdRule < BaseRule
|
|
7
|
+
def rule_text
|
|
8
|
+
'SNS Topic should specify KmsMasterKeyId property'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def rule_type
|
|
12
|
+
Violation::WARNING
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def rule_id
|
|
16
|
+
'W47'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def audit_impl(cfn_model)
|
|
20
|
+
violating_sns_topics = cfn_model.resources_by_type('AWS::SNS::Topic').select do |topic|
|
|
21
|
+
topic.kmsMasterKeyId.nil?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
violating_sns_topics.map(&:logical_resource_id)
|
|
25
|
+
end
|
|
26
|
+
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.53
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Kascic
|
|
@@ -233,6 +233,7 @@ files:
|
|
|
233
233
|
- lib/cfn-nag/custom_rules/SecurityGroupIngressPortRangeRule.rb
|
|
234
234
|
- lib/cfn-nag/custom_rules/SecurityGroupMissingEgressRule.rb
|
|
235
235
|
- lib/cfn-nag/custom_rules/SecurityGroupRuleDescriptionRule.rb
|
|
236
|
+
- lib/cfn-nag/custom_rules/SnsTopicKmsMasterKeyIdRule.rb
|
|
236
237
|
- lib/cfn-nag/custom_rules/SnsTopicPolicyNotActionRule.rb
|
|
237
238
|
- lib/cfn-nag/custom_rules/SnsTopicPolicyNotPrincipalRule.rb
|
|
238
239
|
- lib/cfn-nag/custom_rules/SnsTopicPolicyWildcardPrincipalRule.rb
|