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

nixos/stunnel: Options for client certificates #96401

Closed
wants to merge 2 commits into from

Conversation

chkno
Copy link
Member

@chkno chkno commented Aug 26, 2020

Motivation for this change

Don't stand in the way of folks trying to use this stunnel feature. (This module has no extraConfig option that would otherwise allow this through.)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ajs124
Copy link
Member

ajs124 commented Sep 12, 2020

Doesn't this put the client's private key into the nix store?

…ix store

With type.path, both of these usages are permitted:

    key = ./foo-client-key.pem;           # Bad!  Puts secret in store.
    key = "/var/lib/foo/client-key.pem";  # OK

Disallow the bad usage using types.strMatching "/.*" instead of types.path.

The server version of this probably ought to be changed also, but that
would be a breaking change.  We can change the client key type because
this commit and the commit that introduces the client key option are
in the same PR and will be merged atomically.  We keep this a separate
commit to provide a succinct concrete example of the problems described
in NixOS#24288 .
@chkno
Copy link
Member Author

chkno commented Sep 21, 2020

Doesn't this put the client's private key into the nix store?

Good point.

It does if you use a path: key = ./foo-client-key.pem
It does not if you use a string: key = "/var/lib/foo/client-key.pem"

Experienced Nix users will know to use a path-in-a-string to avoid this problem, but you're right: There's no reason to leave this sharp edge here. I changed types.path to types.strMatching "/.*".

Thanks.

@stale
Copy link

stale bot commented Mar 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 21, 2021
@chkno chkno mentioned this pull request Dec 25, 2021
13 tasks
@chkno
Copy link
Member Author

chkno commented Dec 25, 2021

Superseded by PR #152065.

@chkno chkno closed this Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants