Skip to content

Commit

Permalink
fixed object reporting to be cleaner
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
aaronlippold committed Apr 29, 2022
1 parent ffee1a0 commit dcd3d1f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions controls/aws_s3_bucket_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
impact 0.7
title 'Ensure there are no publicly accessible S3 objects'
desc 'Ensure there are no publicly accessible S3 objects'
tag "nist": %w[AC-6 Rev_4]
tag "nist": %w[AC-6]
tag "severity": 'high'

tag "check": "Review your AWS console and note if any S3 bucket objects are set to
Expand All @@ -26,9 +26,12 @@
else
aws_s3_buckets.bucket_names.each do |bucket|
next if exception_bucket_list.include?(bucket)
describe "Public objects in Bucket: #{bucket}" do
aws_s3_bucket_objects(bucket_name: bucket).contents_keys.each do |key|
describe aws_s3_bucket_object(bucket_name: bucket, key: key) do

my_items = aws_s3_bucket_objects(bucket_name: bucket).contents_keys
describe "#{bucket} object" do
my_items.each do |key|
describe key.to_s do
subject { aws_s3_bucket_object(bucket_name: bucket, key: key) }
it { should_not be_public }
end
end
Expand Down

0 comments on commit dcd3d1f

Please sign in to comment.