cfn-nag 0.5.45 → 0.5.46
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/DynamoDBBillingModeRule.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: e6828a4f1f52ac8203d0e83cec62ffb5ee9a5f7c333fde951ca927ba5c6fa07a
|
4
|
+
data.tar.gz: d7ff4d84a96bd4ecfb2f28f5d69f35b5d90ee65bbd935b7795862131ef68981f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08f2016e27b793a893c7311e521be0e0c982f4a74c439dff4fbb99fb0bb6e0813b5db0d4b7397f30a78cbd5bc0e247e4221f422e55393270052c7f40e7a889c0'
|
7
|
+
data.tar.gz: c9703b34980ba772d9259d6c1208dd099acd0a3e2c5aaed50d925859bf29613b03c67cde22ac1dfbf337f5e2206479355fa82f6e4474e286218d9f31fb6abb2e
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
class DynamoDBBillingModeRule < BaseRule
|
7
|
+
def rule_text
|
8
|
+
'DynamoDB table should have billing mode set to either PAY_PER_REQUEST or PROVISIONED'
|
9
|
+
end
|
10
|
+
|
11
|
+
def rule_type
|
12
|
+
Violation::WARNING
|
13
|
+
end
|
14
|
+
|
15
|
+
def rule_id
|
16
|
+
'W73'
|
17
|
+
end
|
18
|
+
|
19
|
+
def audit_impl(cfn_model)
|
20
|
+
violating_ddb_tables = cfn_model.resources_by_type('AWS::DynamoDB::Table').select do |table|
|
21
|
+
table.billingMode.nil? || (table.billingMode != 'PAY_PER_REQUEST' && table.billingMode != 'PROVISIONED')
|
22
|
+
end
|
23
|
+
|
24
|
+
violating_ddb_tables.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.5.
|
4
|
+
version: 0.5.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- lib/cfn-nag/custom_rules/DirectoryServiceMicrosoftADPasswordRule.rb
|
202
202
|
- lib/cfn-nag/custom_rules/DirectoryServiceSimpleADPasswordRule.rb
|
203
203
|
- lib/cfn-nag/custom_rules/DocDBDBClusterMasterUserPasswordRule.rb
|
204
|
+
- lib/cfn-nag/custom_rules/DynamoDBBillingModeRule.rb
|
204
205
|
- lib/cfn-nag/custom_rules/EC2NetworkAclEntryDuplicateRule.rb
|
205
206
|
- lib/cfn-nag/custom_rules/EC2NetworkAclEntryIneffectiveDenyRule.rb
|
206
207
|
- lib/cfn-nag/custom_rules/EC2NetworkAclEntryOverlappingPortsRule.rb
|