cfn-nag 0.7.6 → 0.7.11

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: 59c999774eab0a7ebd00d06aa55d9080218683d60a8a6a0eed160ffe5171617b
4
- data.tar.gz: 4eb14549c72fe44b27941a90793c8a52271f5fcf4a9c7799b29c0800be2fd815
3
+ metadata.gz: 5e26fcc50c0e47513f3539dadfa072f4888ed2bd776e8388966a7648b9fb3286
4
+ data.tar.gz: dec97316b7808511cad74995edf289bb6669325503362991dd237296d8ac63a0
5
5
  SHA512:
6
- metadata.gz: ff895bb892baaae4b1143daeac5c1dde170635e7c627ec3cd09249b28bfdc7b1eb37c71da271306552b03cfae080e4cf272d006536441531328a40c98f73f10c
7
- data.tar.gz: 56289bf3957389c76477eb1b9fb32d44262b1bf98d711812f8f44bd078b93e5efe6d216cc519711a0a0303bc88bd90526f9e244a76f3e752af24d60ac8dee805
6
+ metadata.gz: 2c7490492ca3676096d36e9280a88ca9cef7ce28873920eb49e2e99982d5b3d2cfe88c9331feef1e8c01249d6955579f4e8e7b4aba53343a5de6db2d5101a76f
7
+ data.tar.gz: d7316a5e3eef79703043f5e3e4af7a4ab777fbe6de389d3ce5f0cfed40db2f72fac32b64e8bc123081861d63d751a4bf3f5209ec7d5f9475cbe332f50deb9ae8
@@ -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,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'base'
5
+
6
+ class ElasticsearchDomainInsideVPCRule < BaseRule
7
+ def rule_text
8
+ 'ElasticsearchcDomain should be inside vpc, should specify VPCOptions'
9
+ end
10
+
11
+ def rule_type
12
+ Violation::WARNING
13
+ end
14
+
15
+ def rule_id
16
+ 'W90'
17
+ end
18
+
19
+ def audit_impl(cfn_model)
20
+ violating_domains = cfn_model.resources_by_type('AWS::Elasticsearch::Domain').select do |domain|
21
+ domain.vPCOptions.nil?
22
+ end
23
+
24
+ violating_domains.map(&:logical_resource_id)
25
+ end
26
+ 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.6
4
+ version: 0.7.11
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-05 00:00:00.000000000 Z
11
+ date: 2021-04-12 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
@@ -247,6 +248,7 @@ files:
247
248
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerProtocolRule.rb
248
249
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerSslPolicyRule.rb
249
250
  - lib/cfn-nag/custom_rules/ElasticsearchDomainEncryptionAtRestOptionsRule.rb
251
+ - lib/cfn-nag/custom_rules/ElasticsearchDomainInsideVPCRule.rb
250
252
  - lib/cfn-nag/custom_rules/ElasticsearchDomainNodeToNodeEncryptionOptionsRule.rb
251
253
  - lib/cfn-nag/custom_rules/GameLiftFleetInboundPortRangeRule.rb
252
254
  - lib/cfn-nag/custom_rules/IAMUserLoginProfilePasswordRule.rb
@@ -282,6 +284,7 @@ files:
282
284
  - lib/cfn-nag/custom_rules/KinesisStreamStreamEncryptionRule.rb
283
285
  - lib/cfn-nag/custom_rules/LambdaFunctionCloudWatchLogsRule.rb
284
286
  - lib/cfn-nag/custom_rules/LambdaFunctionInsideVPCRule.rb
287
+ - lib/cfn-nag/custom_rules/LambdaFunctionReservedConcurrentExecutionsRule.rb
285
288
  - lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
286
289
  - lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
287
290
  - lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb