cfn-nag 0.7.5 → 0.7.6
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/LambdaFunctionInsideVPCRule.rb +27 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59c999774eab0a7ebd00d06aa55d9080218683d60a8a6a0eed160ffe5171617b
|
|
4
|
+
data.tar.gz: 4eb14549c72fe44b27941a90793c8a52271f5fcf4a9c7799b29c0800be2fd815
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff895bb892baaae4b1143daeac5c1dde170635e7c627ec3cd09249b28bfdc7b1eb37c71da271306552b03cfae080e4cf272d006536441531328a40c98f73f10c
|
|
7
|
+
data.tar.gz: 56289bf3957389c76477eb1b9fb32d44262b1bf98d711812f8f44bd078b93e5efe6d216cc519711a0a0303bc88bd90526f9e244a76f3e752af24d60ac8dee805
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'cfn-nag/violation'
|
|
4
|
+
require_relative 'base'
|
|
5
|
+
|
|
6
|
+
class LambdaFunctionInsideVPCRule < BaseRule
|
|
7
|
+
def rule_text
|
|
8
|
+
'Lambda functions should be deployed inside a VPC'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def rule_type
|
|
12
|
+
Violation::WARNING
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def rule_id
|
|
16
|
+
'W89'
|
|
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.vpcConfig.nil?
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
violating_lambda_functions.map(&:logical_resource_id)
|
|
26
|
+
end
|
|
27
|
+
end
|
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.6
|
|
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-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -281,6 +281,7 @@ files:
|
|
|
281
281
|
- lib/cfn-nag/custom_rules/KinesisFirehoseDeliveryStreamSplunkDestinationConfigurationHECTokenRule.rb
|
|
282
282
|
- lib/cfn-nag/custom_rules/KinesisStreamStreamEncryptionRule.rb
|
|
283
283
|
- lib/cfn-nag/custom_rules/LambdaFunctionCloudWatchLogsRule.rb
|
|
284
|
+
- lib/cfn-nag/custom_rules/LambdaFunctionInsideVPCRule.rb
|
|
284
285
|
- lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
|
|
285
286
|
- lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
|
|
286
287
|
- lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb
|