cfn-nag 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49056f7c35d518daf6ffea04c5bad7627b40252c24d1e59a7ee5daece6e23235
4
- data.tar.gz: bf127e2ce2d316de7a15731042f882b441f03087207bdc267e7c2fb42ede44b1
3
+ metadata.gz: 1c92064a9d6c14b799b8845927912b5e9da2018ea586dfee6c1574f59c7b39c0
4
+ data.tar.gz: d6f30de67f4876246d5f6c1b762f47a3b156590adc8e18b83fc299447d8dd2a3
5
5
  SHA512:
6
- metadata.gz: 2dd96572fa02263506f8a82cd737ca5d1ce5d14ae17679245952594a74b3a715a45697f744a3eb0a0445191c69c7b520b89e5dc55e4051a8d3f110fefd604e1e
7
- data.tar.gz: 5b5aaadb45c63d28b28230021edaf1672bad5211a423a6e93d97ebcce68bc2354e222397492f490784a0a112ec7a21c7cb039ce3f695c41c81b56ebabe8ee2d5
6
+ metadata.gz: f0c0044110327dfb23994f7d07eecf80b5b931f9dda3c1c8e2ce80ebe85e11916b6cd2d4fdf1a2bc99da7259c22f7eff3e3846caeb3e00c055a78885928776a9
7
+ data.tar.gz: 36096f45dd3ec9cf7af1da93a0fbfef71a5e4d167da339d668a27ad476589a1864b5080ca1968057f3569725fdd57f887c290dbb6f7e93feb152f53ca708c511
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'base'
5
+
6
+ class ApiGatewayMethodAuthorizationTypeRule < BaseRule
7
+ def rule_text
8
+ "AWS::ApiGateway::Method should not have AuthorizationType set to 'NONE'. "
9
+ end
10
+
11
+ def rule_type
12
+ Violation::WARNING
13
+ end
14
+
15
+ def rule_id
16
+ 'W59'
17
+ end
18
+
19
+ def audit_impl(cfn_model)
20
+ violating_deployments = cfn_model.resources_by_type('AWS::ApiGateway::Method').select do |method|
21
+ method.authorizationType.nil? || method.authorizationType.to_s.casecmp('none').zero?
22
+ end
23
+
24
+ violating_deployments.map(&:logical_resource_id)
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'base'
5
+
6
+ class ApiGatewaySecurityPolicyRule < BaseRule
7
+ def rule_text
8
+ 'ApiGateway SecurityPolicy should use TLS 1.2'
9
+ end
10
+
11
+ def rule_type
12
+ Violation::WARNING
13
+ end
14
+
15
+ def rule_id
16
+ 'W62'
17
+ end
18
+
19
+ def audit_impl(cfn_model)
20
+ violating_domains = cfn_model.resources_by_type('AWS::ApiGateway::DomainName').select do |domain|
21
+ domain.securityPolicy.nil? || domain.securityPolicy == 'TLS_1_0'
22
+ end
23
+
24
+ violating_domains.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.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kascic
@@ -181,6 +181,8 @@ 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/ApiGatewayMethodAuthorizationTypeRule.rb
185
+ - lib/cfn-nag/custom_rules/ApiGatewaySecurityPolicyRule.rb
184
186
  - lib/cfn-nag/custom_rules/ApiGatewayV2AccessLoggingRule.rb
185
187
  - lib/cfn-nag/custom_rules/AppStreamDirectoryConfigServiceAccountCredentialsAccountPasswordRule.rb
186
188
  - lib/cfn-nag/custom_rules/BatchJobDefinitionContainerPropertiesPrivilegedRule.rb