News for hackers. Stuff that matters.
Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by regecks on Monday January 07, 2019 @12:53AM (#18843096)
I don't understand why you made the CA private key user-readable.

On my system, modifying the trust anchors requires root privileges.

mkcert undoes this boundary by opening a "shortcut" where any code on the machine can mint trusted certificates for any domain (like internet banking).

Why not make the CA private key only readable as root, and the issuance of new leaf certificates a privileged operation?

I would also expect that if/when you add ACME, that the CA key material is locked away in a different user to the one in the DE.

Maybe not every platform you support actually has this boundary, but I would expect that mkcert doesn't remove the boundary on platforms where it does exist.

Fan of your work since your Heartbleed scanner!

Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by FiloSottile on Monday January 07, 2019 @06:36AM (#18844416)
That is a fair argument, but it is already possible to get the behavior you want: the root key is generated with permissions 0400, so if your first run of mkcert is with root, all following invocations will also require root.

My reason for not making it a first class feature (with its complexity cost) is that in the vast majority of cases, an attacker with the ability to read local files can also directly attack the browser. (At least in mkcert’s use case, which is development not deployment.)

Also, I don’t really see how to maintain that boundary once ACME gives certificates to anything that can connect to a local port (without sending headers suggesting it’s a tricked browser).

Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by Natanael_L on Monday January 07, 2019 @09:25AM (#18845304)
How about instead adding an alert when not running it as root?
Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by morpheuskafka on Monday January 07, 2019 @09:57AM (#18845582)
It's similar to the approach used by Telerik Fiddler, you only have to be admin once to install the CA and it autogenerates certificates as needed for the HTTPS mitm proxy. However, it's ca is labelled "DO NOT TRUST" so it's easy to notice in the certificate info window.
Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by amelius on Monday January 07, 2019 @04:35AM (#18843942)
I don't like the idea of the root requirement. Sometimes you are logged into a system maintained by someone else, and you want to do things as a normal user.
Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by regecks on Monday January 07, 2019 @05:18AM (#18844100)
There's already a root requirement so that `mkcert -install` can deploy to the trust store. The problem is that after this point, the trust store is totally undermined, because the new CA's private key sits around unprotected.

I feel like this is a similar pitfall to how if you add a user to the `docker` group for convenience, you (perhaps unknowingly) gave that user root access to the host.

With this minor change, mkcert still retains its full function and convenience. Just type your password once in a blue moon when you need a certificate for a new fake real domain.

Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by grahamedgecombe on Monday January 07, 2019 @06:00AM (#18844279)
I don't think `mkcert -install` requires root in all cases. The NSS trust store is stored in ~/.pki/nssdb/ and can be written to without root.
Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by vectorEQ on Monday January 07, 2019 @08:46AM (#18844994)
can you create/use a local CA as non-root too?
Re:Show HN: Mkcert – Valid HTTPS certificates for localhost by SomeHacker44 on Tuesday January 08, 2019 @08:13AM (#18855270)
Is there no passphrase on these private keys? Especially the local CA?