Live data from Hacker News

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

github.com

11–20 of 25 posts

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

#11
post #5

"Secure \n\n The generated private key is passwordless by default." That's a bit concerning to me. One would hope that the default behavior would be to put a passphrase on the key.

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.

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

#12
Fair warning: Firefox specifically won't accept a certificate for an IP address at all ever. It will treat the "domain" like it is mismatching the CN even when they're identical.

It will work fine for self-signed otherwise, you just have to install the root CA into the Firefox trusted store (it doesn't share the operating system's store like other browsers do).

There are a few bugs open about the issue, but they often date back over five years so don't expect this to get fixed. They claim it is a security "feature."

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

#13
post #4

Earlier quoted context omitted.

For example, in this case any cert you blindly create with the example will have you located in Paris, France, which may not be accurate. So, never blindly pipe the web into your bash, kids.

You know, I've struggled with this concept. I agree that we shouldn't pipe a URL into a bash script without knowing what it is. But an unsigned software repository that calls post install scripts seems just as absolutely easy to modify, and we see those regularly. My software is most easily installed with a piped bash script. In the script contents, I try to explain what's going on. I also at the top indicate that yo…

People who are serious about their security run something like Debian and only install from the official repositories, where all packages are signed with GPG and all package maintainers must be part of the web of trust (i.e. have had their identity vouched for by at least one other Debian maintainer).

Of course you have to make sure the original install is trustworthy; all you can really do for that is compare the .iso checksum on several different machines. If all those machines are compromised (or there's a hardware-level compromise of your machine) then you're doomed, but that at least makes attacking a lot more costly than it would otherwise be.

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

#14
post #5

"Secure \n\n The generated private key is passwordless by default." That's a bit concerning to me. One would hope that the default behavior would be to put a passphrase on the key.

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.

I agree, I find passwords on certificates useful in some circumstances and bothersome in others.

I think putting a password on a root CA certificate is just a bother without any REAL security advantages. First off you'll need to enter it on every restart, secondary the raw private key will need to be in memory after that (which is trivial to extract), and lastly if the machine is completely owned anyway, this seems like "rearrange the deck chairs on the Titanic."

Now putting a password on your SSH keys? Heck yeah. Otherwise if you forget to lock your machine just once, someone can sit down, open your SSH client of choice and have access to a remote session as "you" without the need for a single password. It might not be unbreakable but it is a nice extra layer of security that buys you time if your laptop gets stolen or similar.

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

#15
post #5

"Secure \n\n The generated private key is passwordless by default." That's a bit concerning to me. One would hope that the default behavior would be to put a passphrase on the key.

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.

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

#16

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.

I agree, I find passwords on certificates useful in some circumstances and bothersome in others. I think putting a password on a root CA certificate is just a bother without any REAL security advantages. First off you'll need to enter it on every restart, secondary the raw private key will need to be in memory after that (which is trivial to extract), and lastly if the machine is completely owned anyway, this seems l…

if you use that CA to issue a leaf certificate for your server then you don't need the root CA's password or decrypted private key to be in memory all the time, but then of course you make generating self-signed certs more complicate (generate self-signed root CA protected with password, and use that to issue a passworddless leaf certificate).

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

#17
post #13

Earlier quoted context omitted.

You know, I've struggled with this concept. I agree that we shouldn't pipe a URL into a bash script without knowing what it is. But an unsigned software repository that calls post install scripts seems just as absolutely easy to modify, and we see those regularly. My software is most easily installed with a piped bash script. In the script contents, I try to explain what's going on. I also at the top indicate that yo…

People who are serious about their security run something like Debian and only install from the official repositories, where all packages are signed with GPG and all package maintainers must be part of the web of trust (i.e. have had their identity vouched for by at least one other Debian maintainer). Of course you have to make sure the original install is trustworthy; all you can really do for that is compare the .i…

Well, latest SSH vulnerabilities came from the official repos as well. Sure, those were bugs not evil modifications, but still.

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

#18
post #13

Earlier quoted context omitted.

People who are serious about their security run something like Debian and only install from the official repositories, where all packages are signed with GPG and all package maintainers must be part of the web of trust (i.e. have had their identity vouched for by at least one other Debian maintainer). Of course you have to make sure the original install is trustworthy; all you can really do for that is compare the .i…

Well, latest SSH vulnerabilities came from the official repos as well. Sure, those were bugs not evil modifications, but still.

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.

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

#19
post #4

Earlier quoted context omitted.

For example, in this case any cert you blindly create with the example will have you located in Paris, France, which may not be accurate. So, never blindly pipe the web into your bash, kids.

You know, I've struggled with this concept. I agree that we shouldn't pipe a URL into a bash script without knowing what it is. But an unsigned software repository that calls post install scripts seems just as absolutely easy to modify, and we see those regularly. My software is most easily installed with a piped bash script. In the script contents, I try to explain what's going on. I also at the top indicate that yo…

Checkout docker-notary [0] a tool for checking signatures that you can pipe in between the download and execution of the script.

[0] https://github.com/docker/notary

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

#20
post #18

Earlier quoted context omitted.

Well, latest SSH vulnerabilities came from the official repos as well. Sure, those were bugs not evil modifications, but still.

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?
Post reply on HN