cfn-nag 0.5.19 → 0.5.20
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/ApiGatewayStageUsagePlanRule.rb +26 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb18fe6da93dfbb59608ad93490cda7ac41bd3038c1b615ac7fb288012902f2b
|
4
|
+
data.tar.gz: f984cff2742bc4bbc9df04a6ce6adade332e3072be80c9a6e321ae8ca7a32aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1187bb3ab3160c721567f1e79b6a3fd840ad646046163f3ae2b38bd8178f1fbe089fabe990c5d9790a54b1f4cab4c9800e566ae8abb31256634fe0b6b4d745f9
|
7
|
+
data.tar.gz: efc2872b9319caab26f6d8cdddaec1e3b0352fc15979534209845f0981e51c3d1298f40c6e34184699bef654d6e731320e081680d5c7c5827ab615bdec434053
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
class ApiGatewayStageUsagePlanRule < BaseRule
|
7
|
+
def rule_text
|
8
|
+
'AWS::ApiGateway::Stage resources should be associated with an AWS::ApiGateway::UsagePlan. '
|
9
|
+
end
|
10
|
+
|
11
|
+
def rule_type
|
12
|
+
Violation::WARNING
|
13
|
+
end
|
14
|
+
|
15
|
+
def rule_id
|
16
|
+
'W64'
|
17
|
+
end
|
18
|
+
|
19
|
+
def audit_impl(cfn_model)
|
20
|
+
violating_api_gateway_stages = cfn_model.resources_by_type('AWS::ApiGateway::Stage').select do |api_stage|
|
21
|
+
api_stage.usage_plan_ids.empty?
|
22
|
+
end
|
23
|
+
|
24
|
+
violating_api_gateway_stages.map(&:logical_resource_id)
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn-nag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.4.
|
75
|
+
version: 0.4.21
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.4.
|
82
|
+
version: 0.4.21
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: logging
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- lib/cfn-nag/custom_rules/ApiGatewayAccessLoggingRule.rb
|
184
184
|
- lib/cfn-nag/custom_rules/ApiGatewayMethodAuthorizationTypeRule.rb
|
185
185
|
- lib/cfn-nag/custom_rules/ApiGatewaySecurityPolicyRule.rb
|
186
|
+
- lib/cfn-nag/custom_rules/ApiGatewayStageUsagePlanRule.rb
|
186
187
|
- lib/cfn-nag/custom_rules/ApiGatewayV2AccessLoggingRule.rb
|
187
188
|
- lib/cfn-nag/custom_rules/AppStreamDirectoryConfigServiceAccountCredentialsAccountPasswordRule.rb
|
188
189
|
- lib/cfn-nag/custom_rules/BatchJobDefinitionContainerPropertiesPrivilegedRule.rb
|