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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c92064a9d6c14b799b8845927912b5e9da2018ea586dfee6c1574f59c7b39c0
|
4
|
+
data.tar.gz: d6f30de67f4876246d5f6c1b762f47a3b156590adc8e18b83fc299447d8dd2a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|