161 points · by samber · 10y ago · 61 comments
However, some pieces of advice in the article could prove catastrophic:
"You need to distribute ca.pub to your entire fleet. Remember, this is meant to be public, so complete access lockdown isn't the goal."
Complete access lockdown is vital. You need to prevent the CA's public key from being altered, corrupted or deleted across your fleet. When distributing the CA's public key, you definitely need to use a secure transport. The CA's public key is what your system of trust is built on. You need to make sure you are trusting the right thing.
"Copy the latter to the CA server and get it signed. Because this is public information, the transport isn't important. You can copy and paste, or fax it"
When copying the user's public key to the server, the transport is still important, otherwise a MITM could swap the public key and your CA would happily sign the wrong thing.
If the laptop doesn't have an SSH private key, how do you SSH to the bastion host?
> In your .ssh/ directory, you'll see id_ecdsa and id_ecdsa.pub. Copy the latter to the CA server and get it signed. Because this is public information, the transport isn't important. You can copy and paste, or fax it; just don't copy id_ecdsa anywhere.
The transfer of id_ecdsa.pub doesn't need secrecy, but it does need integrity. You don't want to accidentally sign an attacker's public key.
These hosts use centralized LDAP and Kerberos installations to share account information, and they require two-factor authentication to protect against password leakage
It appears that you use your password + some unspecified second factor.
HA LDAP is pretty much a solved problem as well. Say what you want about various Microsoft server products, Active Directory is second to none in this regard, and is a highly flexible and extremely robust service.
Am I missing something specific about Facebook that makes this not an option?
Essentially the answer is that there's less immediate reliance on moving parts, which makes sense when you get to a certain level of scale and risk aversion -- a scale much greater than the one I work at, for sure.
Could be that you would want to have a more generic interface for your containers, and not have to integrate too tightly with your container framework?
There are plenty of ways to mitigate the risk of LDAP server unavailability. Besides, the document said that the bastion server uses it, so why isn't what's good for the bastion good enough for the rest of the fleet?
Adding extra brittle moving parts like LDAP and linux clustering to a greenfield deployment just doesn't seem attractive when a CA is so easy to run, and you should already have one if you're doing config management sanely.
mfdutra's comment that you replied to said: If things go south really really bad, we can just get the private key and sign certificates by hand.
That's obviously an incomplete answer - it doesn't explain how you connect to the server if you can't get onto the bastion due to a directory failure - but the basic premise is that the core system is isolated & contains everything it needs to handle the authentication process.
How many engineers have access/a copy of you global CA; if i get a copy of your global CA can I create a cert allowing me to log into any of the machines?
There are some significant advantages to working that way.
That said, if it's that isolated how are you connecting to it in the first place :)
I agree with you though, we just use AD and SSSD, with the additional step of having extended our AD schema to store pubkeys and sudo roles for the Linux part of our infra.
Granted you only have the configurable cache time out in which to solve your problem, but that's usually on the matter of days. If your authentication infrastructure is down for longer than that you have bigger fish to fry.
The approach of using certificates over a cache like sssd is just shifting the issue from cache expiration over to certificate expiration. With certificates, you are likely to set some period where the user certificates expire, and if u have an expired certificate and CA is down u still cannot log in. If you dont expire your certificates u have a security risk.
With FreeIPA you can also map public keys to specific users and have sshd pull authorized_keys from SSSD instead of the actual file. So if a user leaves the system, his keys get removed. So no need to worry about old keys lingering on your servers.
As somebody already mentioned, LDAP (which FreeIPA uses as backend) has a battle-proven HA capability. With some sane configurations of the underlying servers (separate physical equipment, networking, etc), you don't need to worry about your backend mysteriously going down.
These two operations are often abbreviated "authn" (for autheNtication) and "authz" (for authoriZation) in security frameworks.
(or should I say 'confuzing'? :p )
I've seen a few SSH CA projects for signing user certs, but not for the server side certificates.
When you're running containers, if they're spawned frequently, that can mean a significant amount of known_hosts file churning. It sounds like everyone funnels through a small set of bastions, so you'd only need to update them there, but I'm wondering if anyone else uses an SSH CA to solve that side of the equation?
All the ingredients needed are in `ssh-keygen`, but that doesn't feel super awesome to me.
Solving server identity is why I built https://github.com/square/sharkey
It's HostCertificate in sshd_config. Then in known_hosts:
@cert-authority *.example.com ssh-rsa AAAAB…
https://www.digitalocean.com/community/tutorials/how-to-crea...
Edit: Oh, you mean for making them more short lived.
Short-lived is one solution to limiting their lifetime: the other is to use a CRL format.
Either way, you need software to manage the issuance and later revocation.
I suppose you could build this into your host imaging profile, or use config management software. I'm just interested in what people do.
[1] HN discussion at https://news.ycombinator.com/item?id=11746425