cfn-nag 0.5.27 → 0.5.28

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: f7661d4fd465896a67ff7b8a2faa3df9bd5c432f8875333e56c9f22425ea24fe
4
- data.tar.gz: 12a7a44a1010f5842a97e7f91b312264c799dcc1a096039eaf5cca52ba294903
3
+ metadata.gz: 3c4a52da85cbdeefb7d7283f69fc753bad3123fc3a24794c1b6be64711491f0b
4
+ data.tar.gz: ff67b04edb5444d1c1686ec1db1873cfd0938259f2bebf7c3b8c9a1a38e4ef7e
5
5
  SHA512:
6
- metadata.gz: 400e1ba497ef38dd8888722f227b7ae6437645ac8a3b843eb5d30c5763459baee525c4dad8a3c0ae1026831d93640f48027013dee9522a2203f19942097c3d16
7
- data.tar.gz: 5d72fc2ea9a23cf1d8611b63162967f318c74bba3757c13cfbd105b2bcd001ba44a366f0d1b7ff15aad631303c20984d848e9ee2a1ab64df2deff1dcef46e953
6
+ metadata.gz: ee1342976006ea4fddf47a9154961540e5d59160721e28de1ba4b0dcb0743bb177f9fbe15494cd158f403d06c17208649809a2d836d40d5b37d81a8da9c64421
7
+ data.tar.gz: c5bc544b1dc4b8a18c89317395a5ca3fde8e8e081b167cf065bb231055de243fb0d938228edae44528188718075f439ab3a335130172c738e6f947dafda5064f
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'base'
5
+
6
+ class ApiGatewayDeploymentUsagePlanRule < BaseRule
7
+ def rule_text
8
+ 'AWS::ApiGateway::Deployment 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
+ 'W68'
17
+ end
18
+
19
+ def audit_impl(cfn_model)
20
+ violating_api_deployments = cfn_model.resources_by_type('AWS::ApiGateway::Deployment').select do |deployment|
21
+ deployment.usage_plan_ids.empty?
22
+ end
23
+
24
+ violating_api_deployments.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.27
4
+ version: 0.5.28
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.22
75
+ version: 0.4.23
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.22
82
+ version: 0.4.23
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: logging
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -181,6 +181,7 @@ files:
181
181
  - lib/cfn-nag/custom_rules/AmplifyAppOauthTokenRule.rb
182
182
  - lib/cfn-nag/custom_rules/AmplifyBranchBasicAuthConfigPasswordRule.rb
183
183
  - lib/cfn-nag/custom_rules/ApiGatewayAccessLoggingRule.rb
184
+ - lib/cfn-nag/custom_rules/ApiGatewayDeploymentUsagePlanRule.rb
184
185
  - lib/cfn-nag/custom_rules/ApiGatewayMethodAuthorizationTypeRule.rb
185
186
  - lib/cfn-nag/custom_rules/ApiGatewaySecurityPolicyRule.rb
186
187
  - lib/cfn-nag/custom_rules/ApiGatewayStageUsagePlanRule.rb