Live data from Hacker News

Generate self-signed x509 certificates valid for multiple URLs/IPs

github.com

21–25 of 25 posts

Re: Generate self-signed x509 certificates valid for multiple URLs/IPs

#21
post #2

While helper scripts for OpenSSLs arcane syntax are highly appreciated, running some .sh file downloaded from the Internet is not the wisest of security ideas. The author (or somebody from GitHub) could just replace this script with one that actually uploads your freshly-generated private key to somewhere.

How does this differ from any other software? Either you trust the author, or you don't. I assume you haven't reviewed your entire stack to prevent it from including evil code?

Re: Generate self-signed x509 certificates valid for multiple URLs/IPs

#22
post #15

Earlier quoted context omitted.

If an attacker can get access to your (encrypted) private key file, you have other things to worry about. And the passphrase doesn't help against memory-based attacks (e.g. Heartbleed) anyway. A passphrase is mostly a hassle; someone will have to enter it after maintenance or (worse) a power outage.

The fact that you make several valid points doesn't mean keys shouldn't default to having passphrases. Yes, there are attack vectors which having a passphrase doesn't protect against. Yes, passphrases require additional considerations when starting services. No, this doesn't mean they're "mostly a hassle". No, you probably shouldn't default to passphraseless keys.

In at least 99.9% of cases, the an RSA private key used by a service will be stored unencrypted.

Would having a default that's the opposite of what nearly all users want be sensible?

Re: Generate self-signed x509 certificates valid for multiple URLs/IPs

#23
post #8

This can be a one-liner in openssl: openssl req -new -sha256 -x509 -days 365 -newkey RSA:4096 -nodes -keyout domain.key -subj "/CN=example.com" -reqexts SAN -config For a CSR, the same technique can be used: openssl req -new -sha256 -newkey RSA:4096 -nodes -keyout domain.key -subj "/CN=example.com" -reqexts SAN -config

It works too thanks.

We should also notify the differences : I have compared both and have noticed your oneliner generates a CA certificate (which may not be what we want). Also the oneliner rely on the /etc/ssl/openssl.conf file which can change over the time, so the generated certificate may be affected too

Re: Generate self-signed x509 certificates valid for multiple URLs/IPs

#24
post #23
post #8

This can be a one-liner in openssl: openssl req -new -sha256 -x509 -days 365 -newkey RSA:4096 -nodes -keyout domain.key -subj "/CN=example.com" -reqexts SAN -config For a CSR, the same technique can be used: openssl req -new -sha256 -newkey RSA:4096 -nodes -keyout domain.key -subj "/CN=example.com" -reqexts SAN -config

It works too thanks. We should also notify the differences : I have compared both and have noticed your oneliner generates a CA certificate (which may not be what we want). Also the oneliner rely on the /etc/ssl/openssl.conf file which can change over the time, so the generated certificate may be affected too

Also, looking at the gencert.sh file (https://github.com/frntn/x509-san/blob/686f0468/gencert.sh) we can see it also uses a oneliner with process substitution. (may be unrelevant but that kind of nice too)

Re: Generate self-signed x509 certificates valid for multiple URLs/IPs

#25
post #20
post #18

Earlier quoted context omitted.

Yeah, I know. That was awful and should have resulted in policy changes; it hasn't, and I don't use Debian any more. But it makes a good example of the right approach to package infrastructure.

Is there a distro with a stronger policy than Debian? what are you using now?

I wouldn't think stronger than Debian, but there are plenty of distros with equivalent policies. At the moment I'm running FreeBSD (not especially for security reasons).
Post reply on HN