cfn-nag 0.6.13 → 0.6.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfn-nag/custom_rules/DAXClusterEncryptionRule.rb +27 -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: 8a3fc1115d0e9a1739ac2a1fdddbd6ee693450fbf292f512e2554570293cbb01
|
4
|
+
data.tar.gz: 21fcfbd6d9deba76d3764b5170d382a1642d79a0322d49eb71805c7b15c41ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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:
|
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
|
-
|
390
|
+
rubyforge_project:
|
391
|
+
rubygems_version: 2.7.6
|
386
392
|
signing_key:
|
387
393
|
specification_version: 4
|
388
394
|
summary: cfn-nag
|