From a8cb2a7f242f55385ac12cc0fc697220a1e3ab74 Mon Sep 17 00:00:00 2001 From: Joe Flasher Date: Mon, 12 Mar 2018 15:47:32 -0400 Subject: [PATCH 1/2] Remove public permissions on S3 bucket --- 1-KnowYourDevice/3-HotDogNotHotDog/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/1-KnowYourDevice/3-HotDogNotHotDog/README.md b/1-KnowYourDevice/3-HotDogNotHotDog/README.md index f9a4466..6fa7339 100644 --- a/1-KnowYourDevice/3-HotDogNotHotDog/README.md +++ b/1-KnowYourDevice/3-HotDogNotHotDog/README.md @@ -14,12 +14,11 @@ In this exercise, you will learn to: ### Create a bucket in S3 1. Visit https://s3.console.aws.amazon.com/s3/home?region=us-east-1# to access Amazon S3 console. -2. Make sure you are on the US East (N.Virginia) region. (This can be selected in the top, right-hand corner of the screen.) -3. Click on "Create bucket". -4. Name the bucket deeplens-sagemaker-your-full-name (Please note: It is important that is prefixed with deeplens-sagemaker prefix, else these services cannot access. Click "Next" twice. -5. In the "Manage public permissions" section, choose "Grant public read access", and click "Next". -6. Click "Create bucket". -7. After you create the bucket, click on that bucket in your S3 bucket list, and create a folder named "test" in the bucket. +1. Make sure you are on the US East (N.Virginia) region. (This can be selected in the top, right-hand corner of the screen.) +1. Click on "Create bucket". +1. Name the bucket deeplens-sagemaker-your-full-name (Please note: It is important that the bucket is prefixed with deeplens-sagemaker prefix, else SageMaker cannot access the bucket. Click "Next" twice. +1. Click "Create bucket". +1. After you create the bucket, click on that bucket in your S3 bucket list, and create a folder named "test" in the bucket. ### Amazon SageMaker Console From 2d0396606a22db51e934d490df6ee65b2e341afa Mon Sep 17 00:00:00 2001 From: Joe Flasher Date: Mon, 12 Mar 2018 15:49:47 -0400 Subject: [PATCH 2/2] Remove public-read ACL on object Since SageMaker has access to the bucket, I don't believe the `public-read` ACL is needed on the object here. --- 2-FaceDetectionAndVerification/1-FaceDetection/iottos3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-FaceDetectionAndVerification/1-FaceDetection/iottos3.py b/2-FaceDetectionAndVerification/1-FaceDetection/iottos3.py index aba7be2..c8d8ca1 100644 --- a/2-FaceDetectionAndVerification/1-FaceDetection/iottos3.py +++ b/2-FaceDetectionAndVerification/1-FaceDetection/iottos3.py @@ -12,7 +12,7 @@ def lambda_handler(event, context): file_name = 'image-'+time.strftime("%Y%m%d-%H%M%S")+'.jpg' - response = s3.put_object(ACL='public-read', Body=face,Bucket=bucket,Key=file_name) + response = s3.put_object(Body=face,Bucket=bucket,Key=file_name) file_url = 'https://s3.amazonaws.com/' + bucket + '/' + file_name