cfn-nag 0.7.7 → 0.7.12
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 695bb4f8d17329899b73fe3eef82245d3ac06e0bb9009f9b4ee02315db15248e
|
4
|
+
data.tar.gz: a66a14206f6f3bdb9e480b285c10fc57c18c7ec2d0627a5e801c5e121568f6ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d5a7bb8621be7687cb67636f11d2a7a0716cdb1542c5ff914603b278ed3b37bb302da2fef557afbd5e94e5bc9ac6e990c878e3bfa76eed17dd1b9f0bf94968
|
7
|
+
data.tar.gz: 1c6a0d7c60b3f5c6ca2e8824a03a49f2a00615ed4a1bedf6f810dc627030eb64d2211a433a84e09972cde1b847f0f9faae3405c4698c42b4882cbe82a1e9770a
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/util/truthy'
|
4
|
+
require 'cfn-nag/violation'
|
5
|
+
require_relative 'base'
|
6
|
+
|
7
|
+
class DMSReplicationInstanceNotPublicRule < BaseRule
|
8
|
+
def rule_text
|
9
|
+
'Database Migration Service replication instances are public, property PubliclyAccessible should be set to false'
|
10
|
+
end
|
11
|
+
|
12
|
+
def rule_type
|
13
|
+
Violation::WARNING
|
14
|
+
end
|
15
|
+
|
16
|
+
def rule_id
|
17
|
+
'W91'
|
18
|
+
end
|
19
|
+
|
20
|
+
def audit_impl(cfn_model)
|
21
|
+
violating_replications = cfn_model.resources_by_type('AWS::DMS::ReplicationInstance').select do |replication|
|
22
|
+
replication.publiclyAccessible.nil? || truthy?(replication.publiclyAccessible)
|
23
|
+
end
|
24
|
+
|
25
|
+
violating_replications.map(&:logical_resource_id)
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
class LambdaFunctionReservedConcurrentExecutionsRule < BaseRule
|
7
|
+
def rule_text
|
8
|
+
'Lambda functions should define ReservedConcurrentExecutions to reserve simultaneous executions'
|
9
|
+
end
|
10
|
+
|
11
|
+
def rule_type
|
12
|
+
Violation::WARNING
|
13
|
+
end
|
14
|
+
|
15
|
+
def rule_id
|
16
|
+
'W92'
|
17
|
+
end
|
18
|
+
|
19
|
+
def audit_impl(cfn_model)
|
20
|
+
lambda_functions = cfn_model.resources_by_type('AWS::Lambda::Function')
|
21
|
+
violating_lambda_functions = lambda_functions.select do |lambda_function|
|
22
|
+
lambda_function.reservedConcurrentExecutions.nil?
|
23
|
+
end
|
24
|
+
|
25
|
+
violating_lambda_functions.map(&:logical_resource_id)
|
26
|
+
end
|
27
|
+
end
|
@@ -52,7 +52,7 @@ class FileBasedRuleRepo
|
|
52
52
|
|
53
53
|
rule_filenames = discover_rule_filenames(rule_directory)
|
54
54
|
rule_filenames.each do |rule_filename|
|
55
|
-
require(rule_filename)
|
55
|
+
require(File.absolute_path(rule_filename))
|
56
56
|
rule_classname = File.basename(rule_filename, '.rb')
|
57
57
|
|
58
58
|
rule_classes << Object.const_get(rule_classname)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn-nag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- lib/cfn-nag/custom_rules/DLMLifecyclePolicyCrossRegionCopyEncryptionRule.rb
|
218
218
|
- lib/cfn-nag/custom_rules/DMSEndpointMongoDbSettingsPasswordRule.rb
|
219
219
|
- lib/cfn-nag/custom_rules/DMSEndpointPasswordRule.rb
|
220
|
+
- lib/cfn-nag/custom_rules/DMSReplicationInstanceNotPublicRule.rb
|
220
221
|
- lib/cfn-nag/custom_rules/DirectoryServiceMicrosoftADPasswordRule.rb
|
221
222
|
- lib/cfn-nag/custom_rules/DirectoryServiceSimpleADPasswordRule.rb
|
222
223
|
- lib/cfn-nag/custom_rules/DocDBDBClusterMasterUserPasswordRule.rb
|
@@ -283,6 +284,7 @@ files:
|
|
283
284
|
- lib/cfn-nag/custom_rules/KinesisStreamStreamEncryptionRule.rb
|
284
285
|
- lib/cfn-nag/custom_rules/LambdaFunctionCloudWatchLogsRule.rb
|
285
286
|
- lib/cfn-nag/custom_rules/LambdaFunctionInsideVPCRule.rb
|
287
|
+
- lib/cfn-nag/custom_rules/LambdaFunctionReservedConcurrentExecutionsRule.rb
|
286
288
|
- lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
|
287
289
|
- lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
|
288
290
|
- lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb
|