cfn-nag 0.4.81 → 0.4.82
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da96aa37c7198a301552e939d2013246b2fe285c36719cb5e3cb44cc5e757ddf
|
4
|
+
data.tar.gz: 4cdca4308db2101e4f7ae1e2403eb4944715912b6403b1e5e21629d392148e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38e89b36905cb8573192787400cec3f43255637f1a9285bd4a72e63f55bc978bacdff0c59bbb6ce4d0f5fd222319e95076e1fe95153dcfc23527a8a8e6edaf56
|
7
|
+
data.tar.gz: 621c466546551f7157be0a0008205d558f3c61094b066b5375b5186829ef59ce964e61190134217dceaa0a46c810554a60bab935fdfe4edc218c96cdb07df43e
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
class ElasticLoadBalancerV2ListenerProtocolRule < BaseRule
|
7
|
+
def rule_text
|
8
|
+
'Elastic Load Balancer V2 Listener Protocol should use HTTPS for ALBs'
|
9
|
+
end
|
10
|
+
|
11
|
+
def rule_type
|
12
|
+
Violation::WARNING
|
13
|
+
end
|
14
|
+
|
15
|
+
def rule_id
|
16
|
+
'W56'
|
17
|
+
end
|
18
|
+
|
19
|
+
def audit_impl(cfn_model)
|
20
|
+
violating_listeners = cfn_model.resources_by_type('AWS::ElasticLoadBalancingV2::Listener')
|
21
|
+
.select do |listener|
|
22
|
+
listener.protocol == 'HTTP'
|
23
|
+
end
|
24
|
+
|
25
|
+
violating_listeners.map(&:logical_resource_id)
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cfn-nag/violation'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
class ElasticLoadBalancerV2ListenerSslPolicyRule < BaseRule
|
7
|
+
def rule_text
|
8
|
+
'Elastic Load Balancer V2 Listener SslPolicy should use TLS 1.2'
|
9
|
+
end
|
10
|
+
|
11
|
+
def rule_type
|
12
|
+
Violation::WARNING
|
13
|
+
end
|
14
|
+
|
15
|
+
def rule_id
|
16
|
+
'W55'
|
17
|
+
end
|
18
|
+
|
19
|
+
def audit_impl(cfn_model)
|
20
|
+
violating_listeners = cfn_model.resources_by_type('AWS::ElasticLoadBalancingV2::Listener')
|
21
|
+
.select do |listener|
|
22
|
+
violating_listeners?(listener)
|
23
|
+
end
|
24
|
+
|
25
|
+
violating_listeners.map(&:logical_resource_id)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def violating_listeners?(listener)
|
31
|
+
if %w[HTTPS TLS].include?(listener.protocol)
|
32
|
+
listener.sSLPolicy.nil? ||
|
33
|
+
%w[ELBSecurityPolicy-2016-08 ELBSecurityPolicy-TLS-1-0-2015-04
|
34
|
+
ELBSecurityPolicy-TLS-1-1-2017-01 ELBSecurityPolicy-FS-2018-06
|
35
|
+
ELBSecurityPolicy-FS-1-1-2019-08 ELBSecurityPolicy-2015]
|
36
|
+
.include?(listener.sSLPolicy)
|
37
|
+
else
|
38
|
+
false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
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.4.
|
4
|
+
version: 0.4.82
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -190,6 +190,8 @@ files:
|
|
190
190
|
- lib/cfn-nag/custom_rules/ElastiCacheReplicationGroupTransitEncryptionRule.rb
|
191
191
|
- lib/cfn-nag/custom_rules/ElasticLoadBalancerAccessLoggingRule.rb
|
192
192
|
- lib/cfn-nag/custom_rules/ElasticLoadBalancerV2AccessLoggingRule.rb
|
193
|
+
- lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerProtocolRule.rb
|
194
|
+
- lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerSslPolicyRule.rb
|
193
195
|
- lib/cfn-nag/custom_rules/ElasticsearchDomainEncryptionAtRestOptionsRule.rb
|
194
196
|
- lib/cfn-nag/custom_rules/IAMUserLoginProfilePasswordRule.rb
|
195
197
|
- lib/cfn-nag/custom_rules/IamManagedPolicyNotActionRule.rb
|