cfn-nag 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb +34 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d145d8825a2b75a15637c38316311f3a81e34d4c0e4a0da762bb8736d8f92bbd
|
4
|
+
data.tar.gz: 0f86a5e05e4661ee957576eb00c82835917bd9d05ed130ecac583aa8591e98c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1db97cdbc8e20ad8b4600668f13a80271aaa315cdff7c72881467e951f815e32e6929bd00edc4f28fd3b7b96fcd3163889d62a0f35bcc1f39d94d80733331fb9
|
7
|
+
data.tar.gz: 6640df3fcaf9f3745252975c1a62e3bfb499f7fdbb8d3f7c8e3c4f035a02ea70a1e0152686b6ec3555dda7fed3c8779b11068ef55bbef40eabfc059171ad93c5
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
class ApiGatewayCacheEncryptedRule < BaseRule
|
7
|
+
def rule_text
|
8
|
+
'ApiGateway Deployment should have cache data encryption enabled when caching is enabled' \
|
9
|
+
' in StageDescription properties'
|
10
|
+
end
|
11
|
+
|
12
|
+
def rule_type
|
13
|
+
Violation::WARNING
|
14
|
+
end
|
15
|
+
|
16
|
+
def rule_id
|
17
|
+
'W87'
|
18
|
+
end
|
19
|
+
|
20
|
+
def audit_impl(cfn_model)
|
21
|
+
violating_deployments = cfn_model.resources_by_type('AWS::ApiGateway::Deployment').select do |deployment|
|
22
|
+
violating_deployment?(deployment)
|
23
|
+
end
|
24
|
+
|
25
|
+
violating_deployments.map(&:logical_resource_id)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def violating_deployment?(deployment)
|
31
|
+
!deployment.stageDescription.nil? && truthy?(deployment.stageDescription['CachingEnabled']) \
|
32
|
+
&& !truthy?(deployment.stageDescription['CacheDataEncrypted'])
|
33
|
+
end
|
34
|
+
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
description: Auditing tool for CloudFormation templates
|
168
|
-
email:
|
168
|
+
email:
|
169
169
|
executables:
|
170
170
|
- cfn_nag
|
171
171
|
- cfn_nag_rules
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- lib/cfn-nag/custom_rules/AmplifyAppOauthTokenRule.rb
|
198
198
|
- lib/cfn-nag/custom_rules/AmplifyBranchBasicAuthConfigPasswordRule.rb
|
199
199
|
- lib/cfn-nag/custom_rules/ApiGatewayAccessLoggingRule.rb
|
200
|
+
- lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb
|
200
201
|
- lib/cfn-nag/custom_rules/ApiGatewayDeploymentUsagePlanRule.rb
|
201
202
|
- lib/cfn-nag/custom_rules/ApiGatewayMethodAuthorizationTypeRule.rb
|
202
203
|
- lib/cfn-nag/custom_rules/ApiGatewaySecurityPolicyRule.rb
|
@@ -389,7 +390,7 @@ homepage: https://github.com/stelligent/cfn_nag
|
|
389
390
|
licenses:
|
390
391
|
- MIT
|
391
392
|
metadata: {}
|
392
|
-
post_install_message:
|
393
|
+
post_install_message:
|
393
394
|
rdoc_options: []
|
394
395
|
require_paths:
|
395
396
|
- lib
|
@@ -405,9 +406,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
405
406
|
- !ruby/object:Gem::Version
|
406
407
|
version: '0'
|
407
408
|
requirements: []
|
408
|
-
|
409
|
-
|
410
|
-
signing_key:
|
409
|
+
rubygems_version: 3.1.2
|
410
|
+
signing_key:
|
411
411
|
specification_version: 4
|
412
412
|
summary: cfn-nag
|
413
413
|
test_files: []
|