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

Add generic age plugin support (including YubiKeys) #134

Closed
wants to merge 1 commit into from

Conversation

oddlama
Copy link
Contributor

@oddlama oddlama commented Jan 25, 2023

This commit adds general support for age plugins by exposing a new option. This also cover's yubikey support. This also closes #102 and in my opinion supersedes #46.

Example

To enable YubiKey support all you need to do is to add the corresponding plugin to the plugin list:

{
  age.plugins = [pkgs.age-plugin-yubikey];
}

If anything else is required before this can be merged, let me know.

@ryantm
Copy link
Owner

ryantm commented Jan 25, 2023

What's the use case?

@oddlama
Copy link
Contributor Author

oddlama commented Jan 25, 2023

I'm not sure I fully understand, do you want justification for this change?

Personally, I only care about the yubikey plugin, but it seems like there's demand for general plugin support (#102). There seemed to be no obvious way to get the yubikey plugin to work with upstream agenix, so I quickly implemented a fix. I've also looked at the PR's and noticed #46, which has been stale for over a year.

I figured a simple change could fix both issues without adding a forced dependency on the yubikey plugin.

@ryantm
Copy link
Owner

ryantm commented Jan 26, 2023

You want to use a yubikey to decrypt the secrets at activation time? Like on boot? Or, is it necessary to have the plugin present even when the identity is not used for decryption?

@oddlama
Copy link
Contributor Author

oddlama commented Jan 26, 2023

Now I get what you mean. Indeed, boot time (i.e. activation time) secret support would just be disk encryption with extra steps, and that's not practical at all using a yubikey.

What I actually want is:

  • Store secrets in the repository encrypted using a yubikey identity
  • On build-time decrypt the secrets and immediately re-encrypt them using a key available to the host (currently the ssh host key is used)
  • On activation time, agenix decrypts secrets as usual by using the host's ssh key.

For that no changes to agenix should be necessary. Sorry for the confusion, I might post a short update later when I have it working.

@oddlama oddlama closed this Jan 26, 2023
@oddlama
Copy link
Contributor Author

oddlama commented Feb 3, 2023

@ryantm In case you or anyone else is interested in the solution, I've published an extension on top of agenix which automates rekeying and removes the need to manually keep track of secrets. Works great with a Yubikey. And sorry for my rushed initial proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin support
2 participants