-
Notifications
You must be signed in to change notification settings - Fork 185
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
Put private key into separate file instead of main config #78
Comments
Ref: #18 (comment) Why didn’t you go for this approach back then? |
Well... Being able to show someone a config file doesn't really justify PR to move the private key out of the WireGuard config TBH. 😉 That totally depends on your point of view. If you talk to one of the cloud native guys and tell him that you ssh into a VM/container/pod/whatever to show someone a config file that contains a secret he/she will jump straight out of the window. 😄 I mean that's the WireGuard config, right? I personally would absolutely expect that there is a secret in it. You need to store it somewhere. Other enterprise people will tell you "you're absolutely crazy" because secrets belong into Hashicorp's Vault and what not. But even then sooner or later you need to store that key somewhere. It's the same with OpenVPN, PeerVPN, and so on. And using a regex to extract some information from a file is perfectly valid IMHO. The config file and the secret are entities that belongs together. And regarding your previous comment: This role is a few years old already. Different people have different needs. So various PRs were introduced that where useful at that point of time. You can always ask why did you that, why this... If I merged something in the past then it was either useful or needed or I just liked the idea at THAT point of time. That being said now shortly regarding #80: Why an external dependency to |
Thanks for the input. I think the why question is relevant in the case when the reasons back in the day are still valid today. So that I could reevaluate your decision making process so that I have the full context. That is why I asked. I consider this still experimental. I am working on a full POC including PSK support to see how difficult it is (which will then probably target DebOps too much for you to consider merging it). Even I am not yet fully convinced that this change is the right approach. That is why I opened the issue. The advantages just look too interesting for me to ignore them just because they might be difficult. Also consider my direction in #65 and that I now see it as unavoidable to fork the role in the near future. The cloud people, that is a different story :) I think the shoulder surfing aspect is also relevant here, but maybe in a more automated/less obvious way where machines see things they should not see. Consider cloud native people running their daily config drift checks with Ansible and Sure, the secrets need to be stored somewhere. I am not of those manager smartypants who says we need to "magically" encrypt it all (but I do know Hashicorp's Vault). Some secrets need to be accessible to hosts, one way or the other.
I updated the pro arguments in my initial comment. |
TBH I really think it makes sense for you to fork this project. That way you can really change it to your needs. Your way of thinking is totally the DebOps way and this doesn't really fit to this role. While DebOps tries to be the "one thing for everything" - at least that's my impression - this role is the exact opposite 😉 I really want to solve exactly one thing and only that one thing with least dependencies as possible. And my impression is that that's also true for most of the people who currently use this role. DebOps users are probably completely different and that's perfectly okay. Users should have choices and take the solution that fits their needs best. In DebOps you've the concept of a controller if I get that right. While this concept doesn't really fit for this role I'm pretty sure some people out there run this role on a Jenkins server or other kind of continuous delivery software which you can also consider kinda controller. Normally this entity is considered a trusted resource and therefore also suited to store private keys IMHO. People can also use |
Works for me. My idea is just to make less invasive changes first so that you can also profit from them directly. And I think that worked with #67. I guess now come the more opinionated parts :) (I already work on DebOps specific stuff in https://github.com/ypid/ansible-wireguard/tree/prepare-for-debops) I will report back how my little experiment goes. |
You got me thinking. As I need proper support to also cover PSKs and WireGuard seems to fall short here, I am looking into supporting this in |
Slightly OT but the In
|
That is an idea. Have you tested if this causes a new handshake? This is my reason I want to stick with About the OT. The issue is till open here. We can move to https://github.com/ypid/ansible-wireguard/issues if @githubixx prefers that. |
Verified that. So the thing is that you need to load the private key again after
And yes, that does trigger a handshake. |
We probably don’t need to care about reload triggering a handshake, right. But depending on how many peers you have, the |
It could be useful to offer two possible value types in a wg0.conf for PrivateKey or PublicKey.
or
Although maybe that gets into not having a single .conf for all peers/interfaces but a directory for each section and something that just assembles all the conf files into one. Might be more value in just writing a tutorial on how to automate that instead. |
Reasons:
wg set
subcommand only accepts files. When we already have files, we can manipulate wg interfaces easier.Example:
PostUp = wg set %i private-key /etc/wireguard/%i.privkey
Downsides:
What do you think?
The same should then be done for PSKs, although I have no file naming schema yet.
The text was updated successfully, but these errors were encountered: