-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
objstore: add experimental encryption wrapper #46
base: main
Are you sure you want to change the base?
objstore: add experimental encryption wrapper #46
Conversation
129a4cc
to
dde5f47
Compare
60868e9
to
dbf50f1
Compare
|
375a48d
to
573a56d
Compare
b59025d
to
89368db
Compare
0306227
to
d773f93
Compare
Idk what block storage you are using but cortex has s3 with sse... maybe is worth looking at it: https://github.com/cortexproject/cortex/blob/master/pkg/storage/bucket/sse_bucket_client.go |
I wanted to add client side encryption for situations where server side encryption is not an option though |
objstore.go
Outdated
if err != nil { | ||
return nil, errors.Wrap(err, "unable to fetch salt") | ||
} | ||
defer saltReader.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that we also need to exhaust the reader so that keep-alive connections would be properly maintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
objstore.go
Outdated
if err != nil { | ||
return 0, err | ||
} | ||
defer rc.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
d773f93
to
d79d0af
Compare
Signed-off-by: Michael Hoffmann <[email protected]>
d79d0af
to
30eccd1
Compare
if err != nil { | ||
return nil, errors.Wrap(err, "unable to fetch salt") | ||
} | ||
defer metaReader.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(key) != 32 { | ||
return nil, errors.New("decoded key must have size 32") | ||
} | ||
bucket = objstore.BucketWithEncryption(bucket, key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pass the logger here so that we could log a message in case Close() and/or exhaustion fails.
This PR attempts to add an encryption wrapper that defers to
github.com/minio/sio
for encryption and decryption. This is useful when attempting to use Thanos in environments that need PCI DSS compliance.Changes
Verification