Add AWS KMS key encryption/decryption for S3 buckets

Description

Hi!

We use AWS KMS keys internally to encrypt S3 buckets and we would like to use this feature on Percona Backup for MongoDB.

From what I could see, this is not implemented yet: 

https://github.com/percona/percona-backup-mongodb/blob/457bc0eaf861c8c15c997333ce1d8108a138874b/pbm/backup/dst.go#L67-L74

Do you think this could be implemented?

Thanks!

Environment

None

Smart Checklist

Activity

Show:

andrew.pogrebnoi September 18, 2020 at 9:49 AM

Config format

Akira Kurogane August 31, 2020 at 6:13 AM

Linking to because both this and that ticket concern extra S3 options.

Akira Kurogane February 25, 2020 at 1:56 PM

Hi Pedro.

OK, that's going into the roadmap. It's not related to anything else so far, so it will just be another feature in the next major version (tentatively called 2.0). That will be implementing as the main thing though so it's not going to be complete so quick.

Akira

Pedro Albuquerque February 24, 2020 at 11:29 AM

Hi Akira!

This sounds right and it is exactly what we are looking for  

Thanks a lot for your help on this!

Akira Kurogane February 24, 2020 at 5:28 AM

Hi Pedro. OK, I've done a little reading now.

In the context of PBM, which uses the AWS golang SDK, I take to this to mean:

  • PBM user would set a "storage.s3.serverSideEncryption" subsection in the PBM config. (Exact section name T.B.D.)

  • That 'serverSideEncryption' YAML/JSON section would have properties such as SSEAlgorithm and KMSMasterKeyID (equivalents to the --sse and --sse-kms-key-id used by the CLI example above).

  • If the 'serverSideEncryption' section is found with those two properties then s3 session will add the encryption for the bucket as a default by code similar to https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/go/example_code/s3/s3_set_default_encryption.go.

  • OR: The ServerSideEncryption and SSEKMSKeyId values are set in every PutObjectInput() or GetObjectInput() wherever they occur in PBM code

Do you think that sounds right?

Regards,

Akira

Done

Details

Assignee

Reporter

Needs QA

Yes

Needs Doc

Yes

Time tracking

2d 5h 25m logged

Components

Fix versions

Affects versions

Priority

Smart Checklist

Created February 20, 2020 at 3:42 PM
Updated February 4, 2025 at 11:25 AM
Resolved October 12, 2020 at 5:43 AM