@mentallurg So, to argue a solution is "more secure" you have to explain all of the security features which are being used to provide that increase in security. Simply saying "I put a self-signed CA cert in a file" achieves nothing, because how do you know what's in there is trustworthy? What could cause some other solution -- say, just using SSH and verifying manually that the SSH crypto is correct -- to be less secure? You've not done that.
@JulieinAustin: Do you mean applications on both servers should use SSH to exchange the public key?
But to use SSH, you would need to provide each server with credentials for another server. And as public key authentication.
For this authentication, you would need first to put corresponding public keys on each server.
Thus, to enable both server to trust each other you would first put there public keys to .ssh dir of each one.
In my opinion, this is similar task as asked in the OP, but done once more on another level
Thus this makes the solution x2 complex.
Now suppose you have mutually shared their public keys for SSH. Now you need to implement the logic in the application to talk to each other via SSH. I find it pretty hard task.
Suppose application A puts via SSH the data that need to be exchanged with application B on another server (OP wants to exchange public key). But how will B know that there is some data to pick up? B will have to implement kind of polling. Then how will A know that B has received the data? B should send some response. To read it, A will have to do polling.
I find it VERY complex.
Compare it to a communication via HTTP (REST service, Servlet or similar): A call service on B and posts needed data (public key). B receives it and reacts correspondingly. Also B immediately returns a response. Standard communication via HTTP. No need to invent any exchange protocols.
One more aspect: For SSH (or SCP) each server will contain credentials needed to login on another server. If you control both servers, the risk of misuse will be low, but still not zero. But if you don't use SSH, this risk is zero. Why should one use an approach that has higher risk?
@mentallurg No one said security was easy. At the end of the day you should be able to explain why something is secure, not just say one way was easier than another way.
But I suppose many people have similar understanding to mine and similar assumptions that I implicitly have done and that you actually named and made them explicit :)
@mentallurg The question I asked originally: How do you know, in a security-sense, that the certificate on the server is the certificate which you self-signed in the first place? What's the chain of trust? How do you verify that back to something?
Yeah, the reason CAs are such a powerful concept is you can hard-code things like certificate signatures in applications. This got sort of funky with storing certs in files which are potentially mutable, without making sure they weren't mutated.
there are crypto algorithms where N of M people are needed -- if you get that far into your career look into them. people die. don't bet the company on people not dying. they'll disappoint.
people can be lulled into a false sense of security. my approach would be similar as yours, but I'd had a cert which had a well-known signature, then ensure that signature was in the chain.
the key is to make implicit assumptions explicit -- what is the threat environment? what attacks aren't defended against? i jumped in because if it had been me, in a reasonably secure hardware environment, i'd have just used SSH and made a self-signed CA cert, signed a server cert, and been done.
correct, and what Ken Thompson was saying is that we really don't have a way of knowing. if you don't recognize the name, he was an inventor of UNIX, along with Dennis Ritchie and Brian Kernigahn. that was Ken's Turing Award paper. it's required reading where your career will likely take you.
"made a self-signed CA cert, signed a server cert, and been done" - this part is exactly as I suggested
I think the author did not realized that CA certificates of Comodo, VerySign & Co are also self-signed certifcates.
... and that actually - technically - there is not difference between our self-signed certificates and thos of VerySign
the only difference ist that their certificates are preinstalled everywhere and thus trusted by everyone, where as our (yours, mine) are rtusted only locally
yes, but if it mattered i'd have also made sure the certificate wasn't modified, or i'd have been explicit. remember the original question -- "Without a trust root of some sort which can be externally verified, "just copy the files" achieves nothing. Because now what you have is "How do I copy my certificates with someone who didn't just do all that and replace yours with theirs?""
one of the key concepts is ways to bootstrap from a small piece of information -- say, a very big secure hash -- to an assurance that the entire system is presently functioning in a "secure state", however that "secure state" has been defined.
yes, but a lot of people don't grasp that "trust" is actual a negative -- we're "critical dependent" on that thing. we can't just go "Oh, Julie is smart, I trust her." i used to work for 1Password, and i wrote the section on one of their white papers on why we could trust their DBA not to steal things. so, i liked the guy, and i hope to see him again some day, but in that "security" sense, i don't trust him.
yes - that's critical. understanding the fragility of it all. because it's a house of cards, as we learned through variation "Secure Hash Algorithms" not being all that secure
3DES isn't bad but you have to actually use 3DES. it's also not really 3 * 64 bits, as some think, and that's the other important thing to understand.
i was at IBM when AES was being developed and it was fun to watch the process.
if you want a really nice dive into how a secure product was designed, this is a good read -- 1password.com/security/#security-white-paper. i don't know if anything i wrote is still in there. if you want to go further in security, they are a great company to work for, if you can handle working remote, which i couldn't.
to 1password - thanks. I don't use any web based solutions. and if I need to transfer via Intenet; I encrypt it with my own hands :) Same question - to trust or not to trust :) I don't trust
I liked it it , too. thanks. to ping - I would be glad. and to be honest, I don't promise it happens soon :) may be I will see your answer or discussion somewhere