cfn-nag 0.4.71 → 0.4.72

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: 8aac032953583895153e90c0c12415050b835ff4d220df996979b4ec8d769a82
4
- data.tar.gz: 6ebf25a6c6a86e76e11081c7016bbad1148a5af529cc85db608d84b9bbcf7836
3
+ metadata.gz: 2070e9e1e8036793323aa8e4660a547f62be5f007500d2c779aaa58da83940e1
4
+ data.tar.gz: 204d19593a97fc5af6fef830b314f3310c45f7240da90f8142a032c038fb84d5
5
5
  SHA512:
6
- metadata.gz: 90b0d3a36532be603b08bbf78c8c5f28df13bf3164cd5cf0c9ed06ff56093445dc42a27540b0e09a2c8f1606d1e5b28bfdec4cb8d4a742c09e972bdcab34cf29
7
- data.tar.gz: f798dd0079bb6448ee8bd130d13f053e9c2c282a7c2b7e06976850962ecb166437ccb158634cb8859c23b496a33c17ce9199aa9a309dd1b521c8abf48814c4f3
6
+ metadata.gz: 3ce1b777c7d6b62d3ea8dc221e8c2cbc6bf60a891b3120dd6245f1f7768b7a5e38aee421cc32cad3003d08877b78ce549055e4f7d938b671b066428faf5191c8
7
+ data.tar.gz: 31027d63b7eacf0133ddd1e8738670be3d6c1e2d5ab4f3509823071e2201a78fd56209c7af75d8f9be6a599aaa6ac91899d85ca0fc9cff84f5919698b21b2976
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'password_base_rule'
5
+
6
+ class CodePipelineWebhookAuthenticationConfigurationSecretTokenRule < PasswordBaseRule
7
+ def rule_text
8
+ 'CodePipeline Webhook AuthenticationConfiguration SecretToken must not be ' \
9
+ 'a plaintext string or a Ref to a NoEcho Parameter with a Default value.'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::FAILING_VIOLATION
14
+ end
15
+
16
+ def rule_id
17
+ 'F69'
18
+ end
19
+
20
+ def resource_type
21
+ 'AWS::CodePipeline::Webhook'
22
+ end
23
+
24
+ def password_property
25
+ :authenticationConfiguration
26
+ end
27
+
28
+ def sub_property_name
29
+ 'SecretToken'
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'password_base_rule'
5
+
6
+ class DocDBDBClusterMasterUserPasswordRule < PasswordBaseRule
7
+ def rule_text
8
+ 'DocDB DB Cluster master user password must not be a plaintext string ' \
9
+ 'or a Ref to a NoEcho Parameter with a Default value.'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::FAILING_VIOLATION
14
+ end
15
+
16
+ def rule_id
17
+ 'F70'
18
+ end
19
+
20
+ def resource_type
21
+ 'AWS::DocDB::DBCluster'
22
+ end
23
+
24
+ def password_property
25
+ :masterUserPassword
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'password_base_rule'
5
+
6
+ class ElastiCacheReplicationGroupAuthTokenRule < PasswordBaseRule
7
+ def rule_text
8
+ 'ElastiCache ReplicationGroup AuthToken must not be a plaintext string ' \
9
+ 'or a Ref to a NoEcho Parameter with a Default value.'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::FAILING_VIOLATION
14
+ end
15
+
16
+ def rule_id
17
+ 'F44'
18
+ end
19
+
20
+ def resource_type
21
+ 'AWS::ElastiCache::ReplicationGroup'
22
+ end
23
+
24
+ def password_property
25
+ :authToken
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require_relative 'password_base_rule'
5
+
6
+ class LambdaPermissionEventSourceTokenRule < PasswordBaseRule
7
+ def rule_text
8
+ 'Lambda Permission EventSourceToken must not be a plaintext string ' \
9
+ 'or a Ref to a NoEcho Parameter with a Default value.'
10
+ end
11
+
12
+ def rule_type
13
+ Violation::FAILING_VIOLATION
14
+ end
15
+
16
+ def rule_id
17
+ 'F45'
18
+ end
19
+
20
+ def resource_type
21
+ 'AWS::Lambda::Permission'
22
+ end
23
+
24
+ def password_property
25
+ :eventSourceToken
26
+ end
27
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-nag/violation'
4
+ require 'cfn-nag/util/enforce_reference_parameter'
5
+ require 'cfn-nag/util/enforce_string_or_dynamic_reference'
6
+ require_relative 'base'
7
+
8
+ class ManagedBlockchainMemberMemberFabricConfigurationAdminPasswordRule < BaseRule
9
+ def rule_text
10
+ 'ManagedBlockchain Member MemberFabricConfiguration AdminPasswordRule must ' \
11
+ 'not be a plaintext string or a Ref to a NoEcho Parameter with a Default value.'
12
+ end
13
+
14
+ def rule_type
15
+ Violation::FAILING_VIOLATION
16
+ end
17
+
18
+ def rule_id
19
+ 'F71'
20
+ end
21
+
22
+ def audit_impl(cfn_model)
23
+ managed_blockchain_members = cfn_model.resources_by_type('AWS::ManagedBlockchain::Member')
24
+ violating_managed_blockchains = managed_blockchain_members.select do |member|
25
+ if password_property_does_not_exist(member)
26
+ false
27
+ else
28
+ pw = member.memberConfiguration['MemberFrameworkConfiguration']['MemberFabricConfiguration']['AdminPassword']
29
+ insecure_parameter?(cfn_model, pw) ||
30
+ insecure_string_or_dynamic_reference?(cfn_model, pw)
31
+ end
32
+ end
33
+
34
+ violating_managed_blockchains.map(&:logical_resource_id)
35
+ end
36
+
37
+ private
38
+
39
+ # Checks to see if these properties are present as they are optional
40
+ # properties for the 'AWS::ManagedBlockchain::Member' resource:
41
+ # 'MemberFrameworkConfiguration'
42
+ # 'MemberFabricConfiguration'
43
+ # 'AdminPassword'
44
+ def password_property_does_not_exist(member)
45
+ if member.memberConfiguration['MemberFrameworkConfiguration'].nil?
46
+ true
47
+ elsif member.memberConfiguration['MemberFrameworkConfiguration']['MemberFabricConfiguration'].nil?
48
+ true
49
+ elsif member.memberConfiguration['MemberFrameworkConfiguration']['MemberFabricConfiguration']['AdminPassword'].nil?
50
+ true
51
+ else
52
+ false
53
+ end
54
+ end
55
+ 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.4.71
4
+ version: 0.4.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kascic
@@ -171,10 +171,12 @@ files:
171
171
  - lib/cfn-nag/custom_rules/CloudFormationAuthenticationRule.rb
172
172
  - lib/cfn-nag/custom_rules/CloudFrontDistributionAccessLoggingRule.rb
173
173
  - lib/cfn-nag/custom_rules/CodeBuildEncryptionKeyRule.rb
174
+ - lib/cfn-nag/custom_rules/CodePipelineWebhookAuthenticationConfigurationSecretTokenRule.rb
174
175
  - lib/cfn-nag/custom_rules/DMSEndpointMongoDbSettingsPasswordRule.rb
175
176
  - lib/cfn-nag/custom_rules/DMSEndpointPasswordRule.rb
176
177
  - lib/cfn-nag/custom_rules/DirectoryServiceMicrosoftADPasswordRule.rb
177
178
  - lib/cfn-nag/custom_rules/DirectoryServiceSimpleADPasswordRule.rb
179
+ - lib/cfn-nag/custom_rules/DocDBDBClusterMasterUserPasswordRule.rb
178
180
  - lib/cfn-nag/custom_rules/EC2SubnetMapPublicIpOnLaunchRule.rb
179
181
  - lib/cfn-nag/custom_rules/EFSFileSystemEncryptedRule.rb
180
182
  - lib/cfn-nag/custom_rules/EMRClusterKerberosAttributesADDomainJoinPasswordRule.rb
@@ -183,6 +185,7 @@ files:
183
185
  - lib/cfn-nag/custom_rules/EbsVolumeEncryptionKeyRule.rb
184
186
  - lib/cfn-nag/custom_rules/EbsVolumeHasSseRule.rb
185
187
  - lib/cfn-nag/custom_rules/ElastiCacheReplicationGroupAtRestEncryptionRule.rb
188
+ - lib/cfn-nag/custom_rules/ElastiCacheReplicationGroupAuthTokenRule.rb
186
189
  - lib/cfn-nag/custom_rules/ElastiCacheReplicationGroupTransitEncryptionRule.rb
187
190
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerAccessLoggingRule.rb
188
191
  - lib/cfn-nag/custom_rules/ElasticLoadBalancerV2AccessLoggingRule.rb
@@ -216,8 +219,10 @@ files:
216
219
  - lib/cfn-nag/custom_rules/KinesisFirehoseDeliveryStreamRedshiftDestinationConfigurationPasswordRule.rb
217
220
  - lib/cfn-nag/custom_rules/KinesisFirehoseDeliveryStreamSplunkDestinationConfigurationHECTokenRule.rb
218
221
  - lib/cfn-nag/custom_rules/KinesisStreamStreamEncryptionRule.rb
222
+ - lib/cfn-nag/custom_rules/LambdaPermissionEventSourceTokenRule.rb
219
223
  - lib/cfn-nag/custom_rules/LambdaPermissionInvokeFunctionActionRule.rb
220
224
  - lib/cfn-nag/custom_rules/LambdaPermissionWildcardPrincipalRule.rb
225
+ - lib/cfn-nag/custom_rules/ManagedBlockchainMemberMemberFabricConfigurationAdminPasswordRule.rb
221
226
  - lib/cfn-nag/custom_rules/ManagedPolicyOnUserRule.rb
222
227
  - lib/cfn-nag/custom_rules/MissingBucketPolicyRule.rb
223
228
  - lib/cfn-nag/custom_rules/NeptuneDBClusterStorageEncryptedRule.rb