+{"platform":{"name":"aws","release":"aws-sdk-v2.11.162"},"profiles":[{"name":"aws-s3-baseline","version":"1.0.0","sha256":"0f445e0d5880b7c8b52c641a9719d5f1f172c29bf9d56c352f9de56ba4be566d","title":"AWS S3 Public Buckets and Objects Benchmark","maintainer":"MITRE InSpec Team","summary":"An example baseline to test if you have any public s3 buckets or objects","license":"Apache-2.0","copyright":"MITRE, 2018","copyright_email":"inspec@mitre.org","supports":[{"platform":"aws"}],"attributes":[],"groups":[{"id":"controls/aws_s3_bucket.rb","controls":["s3-buckets-no-public-access"]},{"id":"controls/aws_s3_bucket_objects.rb","controls":["s3-objects-no-public-access"]}],"controls":[{"id":"s3-buckets-no-public-access","title":"Ensure there are no publicly accessible S3 buckets","desc":"Ensure there are no publicly accessible S3 buckets","descriptions":[{"label":"default","data":"Ensure there are no publicly accessible S3 buckets"}],"impact":0.7,"refs":[],"tags":{"nist":["AC-6","Rev_4"],"severity":"high","check":"Review your AWS console and note if any S3 buckets are set to\n 'Public'. If any buckets are listed as 'Public', then this is\n a finding.","fix":"Log into your AWS console and select the S3 buckets section. Select\n the buckets found in your review. Select the permisssions tab for\n the bucket and remove the Public access permission."},"code":"control \"s3-buckets-no-public-access\" do\n impact 0.7\n title \"Ensure there are no publicly accessible S3 buckets\"\n desc \"Ensure there are no publicly accessible S3 buckets\"\n\n tag \"nist\": [\"AC-6\", \"Rev_4\"]\n tag \"severity\": \"high\"\n\n tag \"check\": \"Review your AWS console and note if any S3 buckets are set to\n 'Public'. If any buckets are listed as 'Public', then this is\n a finding.\"\n\n tag \"fix\": \"Log into your AWS console and select the S3 buckets section. Select\n the buckets found in your review. Select the permisssions tab for\n the bucket and remove the Public access permission.\"\n\n aws_s3_buckets.bucket_names.each do |bucket|\n describe aws_s3_bucket(bucket) do\n it { should_not be_public }\n end\n end\n\n if aws_s3_buckets.bucket_names.empty?\n impact 0.0\n desc \"This control is Non Applicable since no S3 buckets were found.\"\n end\nend","source_location":{"line":1,"ref":"./controls/aws_s3_bucket.rb"},"results":[{"status":"passed","code_desc":"S3 Bucket s3-demo-bucket-with-public-objects should not be public","run_time":0.130646,"start_time":"2018-11-18T21:02:51-05:00"},{"status":"passed","code_desc":"S3 Bucket s3-demo-private-bucket should not be public","run_time":0.123863,"start_time":"2018-11-18T21:02:51-05:00"},{"status":"failed","code_desc":"S3 Bucket s3-demo-public-bucket should not be public","run_time":0.091162,"start_time":"2018-11-18T21:02:51-05:00","message":"expected `S3 Bucket s3-demo-public-bucket.public?` to return false, got true"}]},{"id":"s3-objects-no-public-access","title":"Ensure there are no publicly accessible S3 objects","desc":"Ensure there are no publicly accessible S3 objects","descriptions":[{"label":"default","data":"Ensure there are no publicly accessible S3 objects"}],"impact":0.7,"refs":[],"tags":{"nist":["AC-6","Rev_4"],"severity":"high","check":"Review your AWS console and note if any S3 bucket objects are set to\n 'Public'. If any objects are listed as 'Public', then this is\n a finding.","fix":"Log into your AWS console and select the S3 buckets section. Select\n the buckets found in your review. For each object in the bucket\n select the permissions tab for the object and remove\n the Public Access permission."},"code":"control \"s3-objects-no-public-access\" do\n impact 0.7\n title \"Ensure there are no publicly accessible S3 objects\"\n desc \"Ensure there are no publicly accessible S3 objects\"\n tag \"nist\": [\"AC-6\", \"Rev_4\"]\n tag \"severity\": \"high\"\n\n tag \"check\": \"Review your AWS console and note if any S3 bucket objects are set to\n 'Public'. If any objects are listed as 'Public', then this is\n a finding.\"\n\n tag \"fix\": \"Log into your AWS console and select the S3 buckets section. Select\n the buckets found in your review. For each object in the bucket\n select the permissions tab for the object and remove\n the Public Access permission.\"\n\n\n if aws_s3_buckets.bucket_names.empty?\n impact 0.0\n desc \"This control is Non Applicable since no S3 buckets were found.\"\n else\n aws_s3_buckets.bucket_names.each do |bucket|\n describe \"Public objects in Bucket: #{bucket}\" do\n subject { aws_s3_bucket_objects(bucket).where{ public }.keys }\n it { should cmp [] } \n end\n end\n end\nend\n","source_location":{"line":2,"ref":"./controls/aws_s3_bucket_objects.rb"},"results":[{"status":"failed","code_desc":"Public objects in Bucket: s3-demo-bucket-with-public-objects should cmp == []","run_time":0.3765,"start_time":"2018-11-18T21:02:51-05:00","message":"\nexpected: []\n got: [\"folder/public-pic.jpg\", \"public-pic.jpg\"]\n\n(compared using `cmp` matcher)\n"},{"status":"passed","code_desc":"Public objects in Bucket: s3-demo-private-bucket should cmp == []","run_time":0.021941,"start_time":"2018-11-18T21:02:52-05:00"},{"status":"passed","code_desc":"Public objects in Bucket: s3-demo-public-bucket should cmp == []","run_time":0.025541,"start_time":"2018-11-18T21:02:52-05:00"}]}],"status":"loaded"}],"statistics":{"duration":0.774471},"version":"3.0.46"}
0 commit comments