Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Encrypt with (r)age #37

Closed
blaggacao opened this issue Dec 24, 2020 · 16 comments
Closed

Encrypt with (r)age #37

blaggacao opened this issue Dec 24, 2020 · 16 comments
Labels
enhancement New feature or request security features that improve or bugs that impede

Comments

@blaggacao
Copy link
Contributor

blaggacao commented Dec 24, 2020

Is your feature request related to a problem? Please describe.
I finally want to use age / rage.

Describe the solution you'd like

Something around those lines... (not well thought through)

secrets/** filter=crypt
[filter "crypt"]
	clean = rage -r $(cat ~/.ssh/id_ed25519.pub)
	smudge = rage --decrypt -i ~/.ssh/id_ed25519
	required

Describe alternatives you've considered
none / sops, but sops has ugly configmgt domain overlap with nix.

Additional context

https://git-scm.com/docs/gitattributes


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@nrdxp
Copy link
Collaborator

nrdxp commented Dec 25, 2020

I've been exploring possibly integrating agenix support, so that we can store encrypted secrets properly. More experimentation is needed.

@adrian-gierakowski
Copy link

ugly configmgt domain overlap with nix

@blaggacao I’m curious what you meant by this. Would you be able to elaborate? Thanks!

@blaggacao
Copy link
Contributor Author

blaggacao commented Dec 27, 2020

Sure. Its direct manifestation is that sops has a separate yaml config file. I really like the agenix since it keeps the configuration domain within the (power of the) nix language entirely.

@FlorianFranzen for practical reasons, I'll probably using git-crypt as provided currently by this repo, too. But I think agenix is really a very good idea for those inclined to try stuff out. I feel it has real chances to become the better alternative...

@nrdxp
Copy link
Collaborator

nrdxp commented Dec 28, 2020

Personally, I'd just like to have secrets that aren't world readable when deployed. I'll still probably keep git-crypt available even if we do add support for agenix since they address separate concerns, i.e:

git-crypt -> protects secrets stored in the repo
agenix -> protects secrets deployed to nix-store

Of course, I still have to experiment with agenix to see how well it delivers on this promise.

@blaggacao
Copy link
Contributor Author

I researched a little. I seems at least conceivable in principle that agenix can extend its scope to support the git crypt use case in an unified way.

@blaggacao
Copy link
Contributor Author

ryantm/agenix#12

@blaggacao
Copy link
Contributor Author

blaggacao commented Dec 29, 2020

please, if anyone feels (more) competent / confident (than me), take over: ryantm/agenix#14

@blaggacao
Copy link
Contributor Author

blaggacao commented Dec 29, 2020

There has been made an important argument here:

Unless we can come up with some better plan for how to import the files into the NixOS configuration, they need to be encrypted at rest.

meaning git.filter.agenix.smudge and git.filter.agenix.clean are vetoed for the time being (agenix has agenix --edit <file> for the remainder of the use case), leaving us with git.diff.agenix.textconv — yaay!

@nrdxp nrdxp added the enhancement New feature or request label Dec 30, 2020
@ymarkus
Copy link
Contributor

ymarkus commented Jan 31, 2021

Is there any progress with secrets? I don't really care how it's done, but I would really like a solution integrated in this template. I've thought about doing something like sops-nix or something with pass?

@nrdxp
Copy link
Collaborator

nrdxp commented Feb 2, 2021

@ymarkus, unfortunately not, but it's on the agenda. After reviewing the options, my prefered solution would use gopass, but I've yet to work out all the details. I'll have more time this month than last, so hopefully we can get this knocked out soon.

@nrdxp nrdxp mentioned this issue Feb 15, 2021
17 tasks
@nrdxp nrdxp added the security features that improve or bugs that impede label Feb 17, 2021
@codygman
Copy link
Contributor

codygman commented Mar 1, 2021

I don't quite understand this statement:

sops has ugly configmgt domain overlap with nix.

I was just investigating sops-nix after having lots of issues with git-crypt (maybe because I'm using an ed25519 gpg key) and it seemed like the most convenient option here.

I'm not sure how a gopass based solution might work though.

@Pacman99
Copy link
Member

Pacman99 commented Mar 1, 2021

Personal opinion: devos shouldn't include secrets management, outside of git-crypt - just to protect new users.

secrets management is a very wide concern and everyone has different requirements. And with the extern folder, its really easy to set up stuff yourself. I was able to use agenix with my server, by just adding the input then the module in extern. Then I just followed agenix instructions with creating a secrets.nix file in the secrets folder.

What could be useful is maybe adding documentation on how to integrate different secrets management tools with devos.

@blaggacao
Copy link
Contributor Author

blaggacao commented Mar 1, 2021

I don't quite understand this statement:

sops has ugly configmgt domain overlap with nix.

This question actually came up before. Expanding on my previous reply...

From the asciinema animation on the github repo:

SOPS encrypts the values of a yaml or json file not the keys.

Hence, the tool was designed to do work on and as a function of an authoritative yaml/json file.

I think divnix/devos tries to put all (core) configuration management under the domain of the nix (later maybe nickel) language. Insofar sops appears (to me) a bit incompatible with this repository's goals and philosophy, and agenix seems like the better option.

@nrdxp
Copy link
Collaborator

nrdxp commented Mar 1, 2021

@blaggacao, I agree. I looked at sops and it didn't seem appealing for this project. Honestly, none of the options are absolutely ideal, and I keep wondering why Nix hasn't solved this problem by now, as it was one of the earliest issues opened on the GitHub tracker, some 9 years ago: NixOS/nix#8. I must be missing something important, because changing permissions inside the nix store, or perhaps having a separate nix/secret-store with secure permissions doesn't seem like it should be all that difficult.

Alas...

@blaggacao
Copy link
Contributor Author

https://github.com/FiloSottile/age/releases/tag/v1.0.0-rc.1 (breaking news 😸 )

@blaggacao
Copy link
Contributor Author

blaggacao commented Mar 14, 2021

Thought fodder:

After reading through this blog post, one realizes, this issue perfectly meats with #163 to shoot two birds with one shot.

/cc @Xe

Pacman99 added a commit that referenced this issue Feb 26, 2022
use self.inputs instead of inputs

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request security features that improve or bugs that impede
Projects
None yet
Development

No branches or pull requests

6 participants