cfn-nag 0.6.13 → 0.6.18

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: 9b5274ea37c43e66281bd7e21513c650ca7dac661c5ce943e5fce39dad25506c
4
- data.tar.gz: 22355ae1a48c603a4f4672d7887134f5087973aab0fda5eda92bcb794f975fbe
3
+ metadata.gz: 8a3fc1115d0e9a1739ac2a1fdddbd6ee693450fbf292f512e2554570293cbb01
4
+ data.tar.gz: 21fcfbd6d9deba76d3764b5170d382a1642d79a0322d49eb71805c7b15c41ae5
5
5
  SHA512:
6
- metadata.gz: c8d30927728b0b9ea80774a83c937629ede960143b02b69e51ad6a55ce770e15805e6b8adb733d5c461a346d66b4c11c6fc19fd59f90bf0ee614718375c1ac22
7
- data.tar.gz: 4043b47cd7b3b9c19a5d1259134346768febabd2418a96c160a27f644e09cdb7a630f57013828e0d5d8bd1d49f3b19b414b6893bd1082e8ad9cfd4f9e27c6bcd
6
+ metadata.gz: 6c18afb97fcb0df30296eb6660e6c07bdb4e7e241148529edb68e11bd0ef8bd3dbb5bbf065be4d6ff554eb025059a7da5f53185481bcca75d0540447703838da
7
+ data.tar.gz: c42ed45e2cc5177e8e26acd0f503682b6deb6f0f172c31214753654ac31425e609f17b0cbf60050002fa40a628fd53f7048ab7831b5f211b2cf4908e5a17f8b0
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require 'cfn-nag/util/truthy'
5
+ require_relative 'base'
6
+
7
+ class DAXClusterEncryptionRule < BaseRule
8
+ def rule_text
9
+ 'DynamoDB Accelerator (DAX) Cluster should have encryption enabled'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::WARNING
14
+ end
15
+
16
+ def rule_id
17
+ 'W83'
18
+ end
19
+
20
+ def audit_impl(cfn_model)
21
+ violating_clusters = cfn_model.resources_by_type('AWS::DAX::Cluster').select do |cluster|
22
+ cluster.sSESpecification.nil? || !truthy?(cluster.sSESpecification['SSEEnabled'].to_s)
23
+ end
24
+
25
+ violating_clusters.map(&:logical_resource_id)
26
+ end
27
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require 'cfn-nag/util/truthy'
5
+ require_relative 'base'
6
+
7
+ class ECRRepositoryScanOnPushRule < BaseRule
8
+ def rule_text
9
+ 'ECR Repository should have scanOnPush enabled'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::WARNING
14
+ end
15
+
16
+ def rule_id
17
+ 'W79'
18
+ end
19
+
20
+ def audit_impl(cfn_model)
21
+ violating_ecr_registries = cfn_model.resources_by_type('AWS::ECR::Repository').select do |registry|
22
+ registry.imageScanningConfiguration.nil? ||
23
+ !truthy?(registry.imageScanningConfiguration['scanOnPush'].to_s)
24
+ end
25
+
26
+ violating_ecr_registries.map(&:logical_resource_id)
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/util/truthy'
4
+ require 'cfn-nag/violation'
5
+ require_relative 'base'
6
+
7
+ class ElasticsearchDomainNodeToNodeEncryptionOptionsRule < BaseRule
8
+ def rule_text
9
+ 'ElasticsearchcDomain should have NodeToNodeEncryptionOptions enabled'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::WARNING
14
+ end
15
+
16
+ def rule_id
17
+ 'W85'
18
+ end
19
+
20
+ def audit_impl(cfn_model)
21
+ violating_domains = cfn_model.resources_by_type('AWS::Elasticsearch::Domain').select do |domain|
22
+ domain.nodeToNodeEncryptionOptions.nil? || not_truthy?(domain.nodeToNodeEncryptionOptions['Enabled'])
23
+ end
24
+
25
+ violating_domains.map(&:logical_resource_id)
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require 'cfn-nag/util/truthy'
5
+ require_relative 'base'
6
+
7
+ class LogsLogGroupEncryptedRule < BaseRule
8
+ def rule_text
9
+ 'CloudWatchLogs LogGroup should specify a KMS Key Id to encrypt the log data'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::WARNING
14
+ end
15
+
16
+ def rule_id
17
+ 'W84'
18
+ end
19
+
20
+ def audit_impl(cfn_model)
21
+ violating_groups = cfn_model.resources_by_type('AWS::Logs::LogGroup').select do |group|
22
+ group.kmsKeyId.nil?
23
+ end
24
+
25
+ violating_groups.map(&:logical_resource_id)
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require 'cfn-nag/util/truthy'
5
+ require_relative 'base'
6
+
7
+ class LogsLogGroupRetentionRule < BaseRule
8
+ def rule_text
9
+ 'CloudWatchLogs LogGroup should specify RetentionInDays to expire the log data'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::WARNING
14
+ end
15
+
16
+ def rule_id
17
+ 'W86'
18
+ end
19
+
20
+ def audit_impl(cfn_model)
21
+ violating_groups = cfn_model.resources_by_type('AWS::Logs::LogGroup').select do |group|
22
+ group.retentionInDays.nil?
23
+ end
24
+
25
+ violating_groups.map(&:logical_resource_id)
26
+ end
27
+ 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.6.13
4
+ version: 0.6.18
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-11-25 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -198,6 +198,7 @@ files:
198
198
  - lib/cfn-nag/custom_rules/CodePipelineWebhookAuthenticationConfigurationSecretTokenRule.rb
199
199
  - lib/cfn-nag/custom_rules/CognitoIdentityPoolAllowUnauthenticatedIdentitiesRule.rb
200
200
  - lib/cfn-nag/custom_rules/CognitoUserPoolMfaConfigurationOnorOptionalRule.rb
201
+ - lib/cfn-nag/custom_rules/DAXClusterEncryptionRule.rb
201
202
  - lib/cfn-nag/custom_rules/DMSEndpointMongoDbSettingsPasswordRule.rb
202
203
  - lib/cfn-nag/custom_rules/DMSEndpointPasswordRule.rb
203
204
  - lib/cfn-nag/custom_rules/DirectoryServiceMicrosoftADPasswordRule.rb
@@ -212,6 +213,7 @@ files:
212
213
  - lib/cfn-nag/custom_rules/EC2NetworkAclEntryPortRangeRule.rb
213
214
  - lib/cfn-nag/custom_rules/EC2NetworkAclEntryProtocolRule.rb
214
215
  - lib/cfn-nag/custom_rules/EC2SubnetMapPublicIpOnLaunchRule.rb
216
+ - lib/cfn-nag/custom_rules/ECRRepositoryScanOnPushRule.rb
215
217
  - lib/cfn-nag/custom_rules/EFSFileSystemEncryptedRule.rb
216
218
  - lib/cfn-nag/custom_rules/EMRClusterKerberosAttributesADDomainJoinPasswordRule.rb
217
219
  - lib/cfn-nag/custom_rules/EMRClusterKerberosAttributesCrossRealmTrustPrincipalPasswordRule.rb
@@ -228,6 +230,7 @@ files:
228
230
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerProtocolRule.rb
229
231
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerSslPolicyRule.rb
230
232
  - lib/cfn-nag/custom_rules/ElasticsearchDomainEncryptionAtRestOptionsRule.rb
233
+ - lib/cfn-nag/custom_rules/ElasticsearchDomainNodeToNodeEncryptionOptionsRule.rb
231
234
  - lib/cfn-nag/custom_rules/GameLiftFleetInboundPortRangeRule.rb
232
235
  - lib/cfn-nag/custom_rules/IAMUserLoginProfilePasswordRule.rb
233
236
  - lib/cfn-nag/custom_rules/IamManagedPolicyNotActionRule.rb
@@ -262,6 +265,8 @@ files:
262
265
  - lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
263
266
  - lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
264
267
  - lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb
268
+ - lib/cfn-nag/custom_rules/LogsLogGroupEncryptedRule.rb
269
+ - lib/cfn-nag/custom_rules/LogsLogGroupRetentionRule.rb
265
270
  - lib/cfn-nag/custom_rules/ManagedBlockchainMemberMemberFabricConfigurationAdminPasswordRule.rb
266
271
  - lib/cfn-nag/custom_rules/ManagedPolicyOnUserRule.rb
267
272
  - lib/cfn-nag/custom_rules/MissingBucketPolicyRule.rb
@@ -382,7 +387,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
382
387
  - !ruby/object:Gem::Version
383
388
  version: '0'
384
389
  requirements: []
385
- rubygems_version: 3.1.4
390
+ rubyforge_project:
391
+ rubygems_version: 2.7.6
386
392
  signing_key:
387
393
  specification_version: 4
388
394
  summary: cfn-nag