Live data from Hacker News

How to Secure a Linux Server

github.com

51–60 of 108 posts

Re: How to Secure a Linux Server

#51

> 2FA for ssh Correct me if I'm wrong, but isn't this what password-protected private key encryption is?

What I feel like all the responses missed is that while you're right in that a password-protected private key provides a second factor... what is typically meant by 2FA is two factors checked by the server. The server has no way to know you're using a password-protected key so it shouldn't really be regarded as a factor.

Re: How to Secure a Linux Server

#52
post #47
post #46

Earlier quoted context omitted.

Sorry for being so ignorant but can someone explain why this is so wrong?

The fact you have the private key permits access, not possession of the public key even though the public key is the one you add to the file on the server side (asymmetric cryptography). The "secure way" may also suggest that you have to keep your public key secret which is not true.

I believe the statement is most charitably interpreted as the channel must be secure against modifications so that when you are attempting to put the public key in the file that some other contents aren't inserted instead.

Re: How to Secure a Linux Server

#53

> 2FA for ssh Correct me if I'm wrong, but isn't this what password-protected private key encryption is?

If the private key cannot be read by anyone and the user must authenticate to get the device to sign the authentication request, then it could be considered 2 factor by some interpretations.

Re: How to Secure a Linux Server

#54
post #52
post #47

Earlier quoted context omitted.

The fact you have the private key permits access, not possession of the public key even though the public key is the one you add to the file on the server side (asymmetric cryptography). The "secure way" may also suggest that you have to keep your public key secret which is not true.

I believe the statement is most charitably interpreted as the channel must be secure against modifications so that when you are attempting to put the public key in the file that some other contents aren't inserted instead.

On the other hand, SSH gives you just that if you verify the fingerprint which is not mentioned in the guide. MITM-proof channel is needed if one gains any kind of shell access because then public key substitution can happen in various ways, even without the user him/herself explicitly editing the file. Furthermore, if one allows MITM when accessing shell, substituting the public key is just one of very serious security problems.

Re: How to Secure a Linux Server

#55
post #54
post #52

Earlier quoted context omitted.

I believe the statement is most charitably interpreted as the channel must be secure against modifications so that when you are attempting to put the public key in the file that some other contents aren't inserted instead.

On the other hand, SSH gives you just that if you verify the fingerprint which is not mentioned in the guide. MITM-proof channel is needed if one gains any kind of shell access because then public key substitution can happen in various ways, even without the user him/herself explicitly editing the file. Furthermore, if one allows MITM when accessing shell, substituting the public key is just one of very serious secur…

Certainly many other operations require a tamper-proof channel, and many more things can go wrong without one but I believe the author was trying to indicate the specific requirement here rather than making a specifically incorrect statement.

Re: How to Secure a Linux Server

#56
post #39

Earlier quoted context omitted.

Meh, QSAs check boxes. In my experience they are not very technically capable. Some are, of course. Most are not.

Sure but the point still stands. Why should anyone trust that you, or your company, is any good at security compared to say CIS? If you have homegrown security and can show your QSA your detailed policy document and that it's a superset of CIS, STIG, NIST, etc. with documented exceptions then it'll be no problem. I avoid homegrown whenever possible because it's a rabbit hole that never ends. If you instead say CIS le…

Because, checked boxes don’t mean much. CIS level 2 = a lot of checked boxes. Using cyber security frameworks is great, but some of the most compliant and “advanced” organizations have the worst legacy cruft you can imagine. We work with orgs all the time and organizations that use these frameworks with expert guidance can easily secure their most critical assets while only implementing the right parts of a framework. And the best frameworks have risk based targeting for maturity levels (NIST Cybersecurity) of various activities. These frameworks can end up being a bit of security theatre if you are just implementing it for the sake of “having security”. Guess I am just jaded after breaking software and networks for over a decade. Some of the most secure organizations have very adaptive security practices that focus on application security. Some of the worst are ISO, CIS, STIG policy template hardened blah blah blah. Just don’t put these frameworks and policies on a pedastal. The real security work happens in the margins.

Re: How to Secure a Linux Server

#57
Securing ssh, 2FA for ssh, using key authentication...

Yes but first and foremost you don't expose ssh to all internet, it should be allowed only from known IP addresses and you should VPN to have connect to that known addresses. Section about firewall config just tells to open ssh...

Re: How to Secure a Linux Server

#58
post #37

Earlier quoted context omitted.

And for the masochists: https://iase.disa.mil/stigs/Pages/a-z.aspx

Crikey, look at that mess: Upgrade the version of the browser to an approved version by obtaining software from the vendor or other trusted source. Method 1: View the following registry key: HKLM\Software\Mozilla\Mozilla Firefox\CurrentVersion Method 2: Search for the firefox.exe file using the search feature of the operating system. Examine the files properties for the product version (not the file version. For Wind…

As someone who has had to implement STIG, that is not a realistic method. This stuff is implemented via automation over hundreds of nodes at a time, and having to click through anything in automation is slow and error prone.

STIG itself is just a fancy check-list. Ideally, real world implementation is automated via something like OpenSCAP.

Re: How to Secure a Linux Server

#59
post #57

Securing ssh, 2FA for ssh, using key authentication... Yes but first and foremost you don't expose ssh to all internet, it should be allowed only from known IP addresses and you should VPN to have connect to that known addresses. Section about firewall config just tells to open ssh...

Do you have any resources on how to allow ssh access from certain IP ranges? I can't find anything useful on this topic.
Post reply on HN