cfn-nag 0.5.48 → 0.5.49

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: '08220755ff105b0beb2227a6f10ac84286f56b9110db4a6168212ff6d39f6e49'
4
- data.tar.gz: 9bb91dc2a76bc69853988dad4ce5fec319883a4a4a3c778b99f24f70ef879514
3
+ metadata.gz: bc69e9ae75126fd6ddfc0215515c073b1ce8d4f5b191e755b4687cddc0278637
4
+ data.tar.gz: af7c29a1d164ef38d78a9edd60d06805e853582056ebb29194d393e06d21344a
5
5
  SHA512:
6
- metadata.gz: '005169dde876c4285fee9fde7a94247cfd431346a26ae67d0ebd58dfc2cfe821024a6e40f292f9d106b0162550293c1f585dc2e8cad3219fc689813b11da5126'
7
- data.tar.gz: 831ce0b71288c357ca99d9b3becaf41b335ccd45c4399577ff006ca5d6271dcc584259ad7f27682db6bf711d12c1425a68d1de6dc403609d15b5e9d0a685b815
6
+ metadata.gz: 982570bb083e1817aef943a861155262321d427f98d8a0f70dbad84ef2b73d89eeec7a5ca4457c518dead0eef3c1f956a5d08dc1a1382f491649c6bb795e6518
7
+ data.tar.gz: f674c23f317c5ef344f5c355d887661ef3133142f2a7fe3805df7eaab51a3a72957267f24b43c4abf007e8b841d880958c3ac4d99a911dc4643d6841c3af5856
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'cfn-nag/violation'
4
+ require 'cfn-nag/util/truthy'
4
5
  require_relative 'base'
5
6
 
6
7
  class ElasticLoadBalancerV2AccessLoggingRule < BaseRule
@@ -29,14 +30,14 @@ class ElasticLoadBalancerV2AccessLoggingRule < BaseRule
29
30
 
30
31
  def access_logging_is_false?(load_balancer)
31
32
  false_access_log_attribute = load_balancer.loadBalancerAttributes.find do |load_balancer_attribute|
32
- load_balancer_attribute['Key'] == 'access_logs.s3.enabled' && load_balancer_attribute['Value'].casecmp?('false')
33
+ load_balancer_attribute['Key'] == 'access_logs.s3.enabled' && not_truthy?(load_balancer_attribute['Value'])
33
34
  end
34
35
  false_access_log_attribute
35
36
  end
36
37
 
37
38
  def missing_access_logs?(load_balancer)
38
39
  access_log_attribute = load_balancer.loadBalancerAttributes.find do |load_balancer_attribute|
39
- load_balancer_attribute['Key'] == 'access_logs.s3.enabled'
40
+ load_balancer_attribute['Key'] == 'access_logs.s3.enabled'
40
41
  end
41
42
  access_log_attribute.nil?
42
43
  end
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cfn-nag/util/truthy'
3
4
  require 'cfn-nag/violation'
5
+ require 'cfn-nag/util/truthy'
4
6
  require_relative 'base'
5
7
 
6
8
  class ElasticsearchDomainEncryptionAtRestOptionsRule < BaseRule
@@ -18,15 +20,9 @@ class ElasticsearchDomainEncryptionAtRestOptionsRule < BaseRule
18
20
 
19
21
  def audit_impl(cfn_model)
20
22
  violating_domains = cfn_model.resources_by_type('AWS::Elasticsearch::Domain').select do |domain|
21
- domain.encryptionAtRestOptions.nil? || encryption_not_enabled?(domain.encryptionAtRestOptions)
23
+ domain.encryptionAtRestOptions.nil? || not_truthy?(domain.encryptionAtRestOptions['Enabled'])
22
24
  end
23
25
 
24
26
  violating_domains.map(&:logical_resource_id)
25
27
  end
26
-
27
- private
28
-
29
- def encryption_not_enabled?(encryption_at_rest_options)
30
- encryption_at_rest_options['Enabled'].nil? || encryption_at_rest_options['Enabled'].to_s.casecmp?('false')
31
- end
32
28
  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.48
4
+ version: 0.5.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kascic