Skip to content
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

Use secure enclave for ephemeral key storage #355

Open
jalseth opened this issue Jul 22, 2023 · 4 comments
Open

Use secure enclave for ephemeral key storage #355

jalseth opened this issue Jul 22, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@jalseth
Copy link

jalseth commented Jul 22, 2023

Description

Where possible (depending on OS/platform) gitsign should use hardware backed secure enclaves for private key generation and/or storage. Where this is not possible, gitsign should use a software enclave which uses OS features to protect the memory for the private key from other processes such as https://github.com/awnumar/memguard. This should also be true for the gitsign-credential-cache binary.

I'm happy to work on this if this sounds reasonable.

@jalseth jalseth added the bug Something isn't working label Jul 22, 2023
@wlynch
Copy link
Member

wlynch commented Jul 24, 2023

💯 All for this!

There's already been some work done on the cosign side for hardware tokens - https://docs.sigstore.dev/cosign/hardware-based-tokens it's likely that we'll be able to leverage this in gitsign as well, since there's already a good amount of overlap between the 2 tools.

@jalseth
Copy link
Author

jalseth commented Jul 24, 2023

Sounds good, but I think we should create a central module to house this logic rather than having each project re-implement it. If that SGTY I can start a repo under my namespace and we can migrate to the sigstore project ownership.

@wlynch
Copy link
Member

wlynch commented Jul 26, 2023

👍 https://github.com/sigstore/sigstore is probably the right place for any shared behavior between gitsign/cosign.

@iavael
Copy link
Contributor

iavael commented Nov 7, 2023

As for software enclaves: I think it's better to utilize OS-provided tools like keyrings in linux (kernel ones, not those like gnome-keyring), rather than yet another userspace in-memory storage. Because libraries like https://github.com/awnumar/memguard cannot help against elephant in the room: someone using debugger to dump secrets that in gitsign case would still be stored in userspace memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants