Reputation: 111
I have created a S3 bucket.I want to encrypt a objects inside a specific folder in S3 bucket.How can I do that?
Upvotes: 3
Views: 3193
Reputation: 2355
Use Server-Side Encryption with Customer-Provided Keys (SSE-C)
Protecting Data Using Server-Side Encryption (SSE-S3)
You can set the policy on the specific bucket to only allow encrypted data in for all the objects inside that bucket aws doc
Note in your case for S3 policy would be like this assuming this as the bucket structure outbound/globalscape/dlearn
.
Go on to the aws console--> click on outbound folder --> and then on permissions --> bucket policy --> and paste the below policy and save
S3 policy for the bucket
{
"Version": "2012-10-17",
"Id": "PutObjPolicy",
"Statement": [
{
"Sid": "DenyIncorrectEncryptionHeader",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::outbound/globalscape/dlearn/*",
"Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "AES256"
}
}
},
{
"Sid": "DenyUnEncryptedObjectUploads",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::outbound/globalscape/dlearn/*",
"Condition": {
"Null": {
"s3:x-amz-server-side-encryption": "true"
}
}
}
]
}
"s3:x-amz-server-side-encryption": "AES256"
"Resource": "arn:aws:s3:::outbound/globalscape/dlearn/*"
object in the image attached again has to be your bucket arn:aws:s3:::outbound/globalscape/dlearn/
.AES256
and once keeping it blank.Upvotes: 1
Reputation: 68715
Encrypting a folder using the Amazon S3 console
Open the Amazon S3 console.
Navigate to the folder that you want to encrypt.
Select the folder, and then choose Actions.
Choose Change encryption.
For Change encryption, select AWS-KMS.
For Select a key, select the AWS KMS key that you want to encrypt the folder with.
Choose Save.
Upvotes: 1