cfn-nag 0.6.11 → 0.6.16

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: 229fb6aa9f19b9ff2f1783c3d9d91e88b2593e5380dfd586b8e58279aaef53ab
4
- data.tar.gz: d82856356866d14df36bf54256c3585d6a609f13958b452d0f4d4478cff129f7
3
+ metadata.gz: 215b03a8fda38b89cf524f415b3f1be170d3d5685e53cd60a0ed3f3344aaaf1f
4
+ data.tar.gz: a8e8f3f21fd037e78cc52ed127a3b93fb67fd3a57427a3ff7139ab339e37cc60
5
5
  SHA512:
6
- metadata.gz: b238a58a2c6c6cb59b4b046486218f2189479bfcaeef85fd4db992b71b8f34c79eee30775de19f02354d33ec72fd57ef89bc8f77d238daca689e17f1d4698cfd
7
- data.tar.gz: 8657b44ef778be5032384e9a84416e974545dad68e4170b13f42cc445a5693552d1d20148e8becfa45eee4fd98bae8ad962b1bc9dcef839cb43326725d816dfd
6
+ metadata.gz: 93ab380b1c708698da719adee2a7f66140034802712b1e83ccb09c7f34b249f6c38264869ffa228caf233ba90ae360d855c0ef79929b758827c284356a3d5dd1
7
+ data.tar.gz: 78dac29ca0b9da7c2cd5352bc49094ccb39900d66ebab74b42d1a97b0f36535a378930db87bb0c8b847c79305c63aab1a6c1eaa5a0387b81a0adc2730a7b8797
@@ -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 DynamoDBBackupRule < BaseRule
8
+ def rule_text
9
+ 'DynamoDB table should have backup enabled, should be set using PointInTimeRecoveryEnabled'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::WARNING
14
+ end
15
+
16
+ def rule_id
17
+ 'W78'
18
+ end
19
+
20
+ def audit_impl(cfn_model)
21
+ violating_ddb_tables = cfn_model.resources_by_type('AWS::DynamoDB::Table').select do |table|
22
+ table.pointInTimeRecoverySpecification.nil? ||
23
+ !truthy?(table.pointInTimeRecoverySpecification['PointInTimeRecoveryEnabled'].to_s)
24
+ end
25
+
26
+ violating_ddb_tables.map(&:logical_resource_id)
27
+ end
28
+ 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 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.11
4
+ version: 0.6.16
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-05 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
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.5.2
75
+ version: 0.5.4
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.5.2
82
+ version: 0.5.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: logging
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -203,6 +203,7 @@ files:
203
203
  - lib/cfn-nag/custom_rules/DirectoryServiceMicrosoftADPasswordRule.rb
204
204
  - lib/cfn-nag/custom_rules/DirectoryServiceSimpleADPasswordRule.rb
205
205
  - lib/cfn-nag/custom_rules/DocDBDBClusterMasterUserPasswordRule.rb
206
+ - lib/cfn-nag/custom_rules/DynamoDBBackupRule.rb
206
207
  - lib/cfn-nag/custom_rules/DynamoDBBillingModeRule.rb
207
208
  - lib/cfn-nag/custom_rules/DynamoDBEncryptionRule.rb
208
209
  - lib/cfn-nag/custom_rules/EC2NetworkAclEntryDuplicateRule.rb
@@ -211,6 +212,7 @@ files:
211
212
  - lib/cfn-nag/custom_rules/EC2NetworkAclEntryPortRangeRule.rb
212
213
  - lib/cfn-nag/custom_rules/EC2NetworkAclEntryProtocolRule.rb
213
214
  - lib/cfn-nag/custom_rules/EC2SubnetMapPublicIpOnLaunchRule.rb
215
+ - lib/cfn-nag/custom_rules/ECRRepositoryScanOnPushRule.rb
214
216
  - lib/cfn-nag/custom_rules/EFSFileSystemEncryptedRule.rb
215
217
  - lib/cfn-nag/custom_rules/EMRClusterKerberosAttributesADDomainJoinPasswordRule.rb
216
218
  - lib/cfn-nag/custom_rules/EMRClusterKerberosAttributesCrossRealmTrustPrincipalPasswordRule.rb
@@ -227,6 +229,7 @@ files:
227
229
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerProtocolRule.rb
228
230
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2ListenerSslPolicyRule.rb
229
231
  - lib/cfn-nag/custom_rules/ElasticsearchDomainEncryptionAtRestOptionsRule.rb
232
+ - lib/cfn-nag/custom_rules/ElasticsearchDomainNodeToNodeEncryptionOptionsRule.rb
230
233
  - lib/cfn-nag/custom_rules/GameLiftFleetInboundPortRangeRule.rb
231
234
  - lib/cfn-nag/custom_rules/IAMUserLoginProfilePasswordRule.rb
232
235
  - lib/cfn-nag/custom_rules/IamManagedPolicyNotActionRule.rb
@@ -261,6 +264,7 @@ files:
261
264
  - lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
262
265
  - lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
263
266
  - lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb
267
+ - lib/cfn-nag/custom_rules/LogsLogGroupRetentionRule.rb
264
268
  - lib/cfn-nag/custom_rules/ManagedBlockchainMemberMemberFabricConfigurationAdminPasswordRule.rb
265
269
  - lib/cfn-nag/custom_rules/ManagedPolicyOnUserRule.rb
266
270
  - lib/cfn-nag/custom_rules/MissingBucketPolicyRule.rb
@@ -381,7 +385,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
385
  - !ruby/object:Gem::Version
382
386
  version: '0'
383
387
  requirements: []
384
- rubygems_version: 3.1.4
388
+ rubyforge_project:
389
+ rubygems_version: 2.7.6
385
390
  signing_key:
386
391
  specification_version: 4
387
392
  summary: cfn-nag