Amazon_S3_20
When we interact with sensitive data that is a crucial thing, so always implement server-side encryption in order to protect it from attackers or unauthorized personnel. Amazon S3 encrypts an object before saving it to disk in its data centers and decrypts it when you download the objects.
Perform the following steps to enable server-side encryption :
{ "Version": "2012-10-17", "Id": "PutObjPolicy", "Statement": [ { "Sid": "DenyIncorrectEncryptionHeader", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::abc-bucket-name/*", "Condition": { "StringNotEquals": { "s3:x-amz-server-side-encryption": "AES256" } } }, { "Sid": "DenyUnEncryptedObjectUploads", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::abc-bucket-name/*", "Condition": { "Null": { "s3:x-amz-server-side-encryption": "true" } } } ]}{ "Sid": "DenyIncorrectEncryptionHeader", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::abc-bucket-name/*", "Condition": { "StringNotEquals": { "s3:x-amz-server-side-encryption": "AES256" } } }, { "Sid": "DenyUnEncryptedObjectUploads", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::abc-bucket-name/*", "Condition": { "Null": { "s3:x-amz-server-side-encryption": "true" } }