cfn-nag 0.7.8 → 0.7.13

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: 687faf1b1a2510a790d5c225ea91dcaa18d3384bfc053279e6b4df606a21172a
4
- data.tar.gz: 99cb292f48d8c2cada20d5fae525a7f23491903bfd79cffe2aeaf43326cbfd70
3
+ metadata.gz: 7468bb8ad4896224af85b81f45d0cd975f94a4e1632e97138428a3af5a81efd0
4
+ data.tar.gz: 436c593b203699a02bd01bd0a83e3e46b2464eed99d8773779e823c068ebb891
5
5
  SHA512:
6
- metadata.gz: e3700d6df829ab53c3255499d4487badba2fba8ce83cd7af6c1455b6025aaca5156b1ae90c2e663eefad2ea2fb16d544e4dadd8b03443aa674185492a8be5d47
7
- data.tar.gz: ee20bb214f2dbe6f97ea275cb07a6b5352c0c61bc9c1050e39a6c5c93f4e932103cbe9d103d8cb633513d71403a8863061a2689574e72b1466be32e35bffde1e
6
+ metadata.gz: 5c788cd8722129a28ef8c1bbfe0fd3ff284f69890dd2e120609ba434ecca8b7364eb5a57f423cac157f9f7ada1c08cef9decf2be6d5302fbece4466352b267cf
7
+ data.tar.gz: 05d4491602e8c7b7f645f4255827f6665086b2ff1d2cab6a7f99d2f1dc7ba8315b969a9d78d9e9831b3eb1deb11a5b2bc730c2b86316a10c176cc0056e4b3ecb
@@ -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.8
4
+ version: 0.7.13
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-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -284,6 +284,7 @@ files:
284
284
  - lib/cfn-nag/custom_rules/KinesisStreamStreamEncryptionRule.rb
285
285
  - lib/cfn-nag/custom_rules/LambdaFunctionCloudWatchLogsRule.rb
286
286
  - lib/cfn-nag/custom_rules/LambdaFunctionInsideVPCRule.rb
287
+ - lib/cfn-nag/custom_rules/LambdaFunctionReservedConcurrentExecutionsRule.rb
287
288
  - lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
288
289
  - lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
289
290
  - lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb