cfn-nag 0.6.12 → 0.6.17
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 +4 -4
- data/lib/cfn-nag/custom_rules/DynamoDBBackupRule.rb +28 -0
- data/lib/cfn-nag/custom_rules/ECRRepositoryScanOnPushRule.rb +28 -0
- data/lib/cfn-nag/custom_rules/ElasticsearchDomainNodeToNodeEncryptionOptionsRule.rb +27 -0
- data/lib/cfn-nag/custom_rules/LogsLogGroupEncryptedRule.rb +27 -0
- data/lib/cfn-nag/custom_rules/LogsLogGroupRetentionRule.rb +27 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a66afcd6ab5d1bdc31dc4e8fa97ba37c076bdf34a50d5142a060439998871c4
|
4
|
+
data.tar.gz: 31342a9596c899f8c6a6eecd112a9c9d3abf7a159e748c3ffa7ab6830d67330d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc28b0a404b8c110ce83379e4306ec3ad70beb26f5d379e92eb97764003b157072ce0a0a5a165ad31ab310276929aa551668ae915fc279d2b5ec829050867dee
|
7
|
+
data.tar.gz: e9d0bc21b3abef53cd32c36142266418d13d7b61f715db8e2a92e43fcbc48a71147f3645cf3c3b8cd050198eb3f2ef92632c8ef97b0860a5a26672ef266b581f
|
@@ -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 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.
|
4
|
+
version: 0.6.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kascic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -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,8 @@ 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/LogsLogGroupEncryptedRule.rb
|
268
|
+
- lib/cfn-nag/custom_rules/LogsLogGroupRetentionRule.rb
|
264
269
|
- lib/cfn-nag/custom_rules/ManagedBlockchainMemberMemberFabricConfigurationAdminPasswordRule.rb
|
265
270
|
- lib/cfn-nag/custom_rules/ManagedPolicyOnUserRule.rb
|
266
271
|
- lib/cfn-nag/custom_rules/MissingBucketPolicyRule.rb
|
@@ -381,7 +386,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
381
386
|
- !ruby/object:Gem::Version
|
382
387
|
version: '0'
|
383
388
|
requirements: []
|
384
|
-
|
389
|
+
rubyforge_project:
|
390
|
+
rubygems_version: 2.7.6
|
385
391
|
signing_key:
|
386
392
|
specification_version: 4
|
387
393
|
summary: cfn-nag
|