cfn-nag 0.4.45 → 0.4.46
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/MissingBucketPolicyRule.rb +2 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06424c7a5a122e657fed17725db62a08995fcc1e2c76712aaecf7e8bd497197b
|
|
4
|
+
data.tar.gz: 9ebf99790c3f55e0c4ab5c0a238b61a15967d30fda295181818b89d788d29c78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e99fbd30cae8153a8adf531a879e6531ed2498c0d88f9873526b69cd0aabd19b77877d9b10b1a95dd491603e82e99bc9171d560278ab6dd438ca72e33b2a3f6d
|
|
7
|
+
data.tar.gz: bbde7f2577f0a0aa061bd672206e5348fd0bb604cfd07e2b9653e078deb3d4196296c6a53900fe0de96e8e8ff8a453a84586d3c611b99a547a6ab447a529c2d1
|
|
@@ -28,12 +28,10 @@ class MissingBucketPolicyRule < BaseRule
|
|
|
28
28
|
|
|
29
29
|
def policy_for_bucket(cfn_model, bucket)
|
|
30
30
|
cfn_model.resources_by_type('AWS::S3::BucketPolicy').find do |bucket_policy|
|
|
31
|
-
if bucket_policy.bucket.is_a?
|
|
32
|
-
bucket.bucketName == bucket_policy.bucket
|
|
33
|
-
elsif bucket_policy.bucket.is_a? Hash
|
|
31
|
+
if bucket_policy.bucket.is_a?(Hash) && bucket_policy.bucket.has_key?('Ref')
|
|
34
32
|
bucket_policy.bucket['Ref'] == bucket.logical_resource_id
|
|
35
33
|
else
|
|
36
|
-
|
|
34
|
+
bucket.bucketName == bucket_policy.bucket
|
|
37
35
|
end
|
|
38
36
|
end
|
|
39
37
|
end
|