sops icon indicating copy to clipboard operation
sops copied to clipboard

Add YC KMS provider support

Open kuzaxak opened this issue 3 years ago • 29 comments

SDK documentation was found here. Service implemented in the same way as GCP KMS.

THis PR adding support for YC KMS as an encryption provider.

Resolves issue https://github.com/mozilla/sops/issues/1052

kuzaxak avatar Jul 26 '22 12:07 kuzaxak

@hiddeco Could you review pls? What else should be added \ updated?

kuzaxak avatar Jul 29 '22 14:07 kuzaxak

Have put this on my review list but it might take some time before I can take a proper look at it, as I am not too familiar with the YC KMS client.

hiddeco avatar Jul 29 '22 14:07 hiddeco

Have put this on my review list but it might take some time before I can take a proper look at it, as I am not too familiar with the YC KMS client.

Thank you!

kuzaxak avatar Jul 29 '22 15:07 kuzaxak

One of the things I can see by quickly scanning this is that it seems to lack a way to overwrite the credentials being used, as was made possible by all my rewritten implementations.

This has proven to be of importance when you want to integrate SOPS in another Go application while not relying on runtime environment variables, you can probably get an idea of what I am aiming at by looking at e.g. https://github.com/mozilla/sops/blob/develop/azkv/keysource.go#L97-L111 (or any of the other key source implementations).

In addition: generally speaking, every time a request is made the key is reconstructed for that specific request anyway (as can be seen in keyservice/server.go). So there is little benefit to embedding the client into the key for re-usage purposes (other than maybe ensuring that the HTTP transport continues to be reused).

hiddeco avatar Jul 29 '22 15:07 hiddeco

This has proven to be of importance when you want to integrate SOPS in another Go application while not relying on runtime environment variables, you can probably get an idea of what I am aiming at by looking at e.g. https://github.com/mozilla/sops/blob/develop/azkv/keysource.go#L97-L111 (or any of the other key source implementations).

Thank you for detailed feedback. I didn't understand that part and decided to skip it.

I think it is easy to fix and we will do that.

In addition: generally speaking, every time a request is made the key is reconstructed for that specific request anyway (as can be seen in keyservice/server.go). So there is little benefit to embedding the client into the key for re-usage purposes (other than maybe ensuring that the HTTP transport continues to be reused).

Does it mean that we should move client out of the Key structure?

@astreter cc

kuzaxak avatar Aug 03 '22 15:08 kuzaxak

Does it mean that we should move client out of the Key structure?

Yes, I think it would be best to move the client out and replace it with authentication configuration.

hiddeco avatar Aug 03 '22 15:08 hiddeco

@hiddeco Implemented ability to pass credentials programmatically and cleaned up tests a bit.

Client instance is created every time as you suggested. To implement tests properly I used GCP approach with passing grpcConn directly.

kuzaxak avatar Aug 09 '22 18:08 kuzaxak

@hiddeco Hey. Small ping :) We fixed your comments and it will awesome if you could check them.

kuzaxak avatar Aug 22 '22 09:08 kuzaxak

Hi, @ajvb I know you are busy, but could you please have a look at PR? I see that @hiddeco is busy, and maybe you have time for it :)

kuzaxak avatar Aug 31 '22 07:08 kuzaxak

@hiddeco @ajvb

Hi, we implemented fixes that you requested and it would be great if you can make a review.

kuzaxak avatar Oct 25 '22 08:10 kuzaxak

@hiddeco @ajvb

Could you please have a look?

kuzaxak avatar Mar 04 '23 08:03 kuzaxak

Have no rights to merge at present, which means my review wouldn't mean much until this is resolved. Which is something I am actively working on together with others.

hiddeco avatar Mar 04 '23 09:03 hiddeco

Unfortunately, I think that all PRs are frozen until the issue is resolved.

Sebor avatar Mar 07 '23 13:03 Sebor

any news here?

sharovmerk avatar Jul 24 '23 16:07 sharovmerk