I honestly do not understand why you need a deploy account with sudo access. I much prefer a deploy accound which DOES NOT have sudo access. I add firewall rules transparently redirecting 80/443 to non-privileged ports that the webapp is actually listening to. Hence no need to be root / sudo'ed for the deploy account. You then could get a bit fancier and set the login shell for the deploy account to /bin/false or som…
> I'd also say that during the first five minutes you should set the default firewalling rules to REJECT anything and then only whitelist what is actually allowed. At which point your 'net connection blips and suddenly you wish you'd paid extra for console access.
How I spend my first 5 minutes on a server
271–280 of 355 posts
Re: How I spend my first 5 minutes on a server
#272> No secure server is complete without a firewall. Comments like those are why I normally point people to actual security expects (like, say, Schneier), and why I recommend that new admins should ignore as much as possible the practices chanted by the industry. A secure server does not need a firewall. A firewall can be used to secure a server against a specific threat, but that's it. The days of ping of death are be…
The days of ping of death are behind us.
Packet of death. Hmm.Re: How I spend my first 5 minutes on a server
#273> No secure server is complete without a firewall. Comments like those are why I normally point people to actual security expects (like, say, Schneier), and why I recommend that new admins should ignore as much as possible the practices chanted by the industry. A secure server does not need a firewall. A firewall can be used to secure a server against a specific threat, but that's it. The days of ping of death are be…
The days of ping of death are behind us. Packet of death. Hmm. http://www.kriskinc.com/intel-pod
Re: How I spend my first 5 minutes on a server
#274Earlier quoted context omitted.
SSH keys also never expire and are easy to copy/steal. Key-based auth is officially discouraged at the day job (for laptop-to-desktop type things) for exactly this reason.
We throw an OTP (One time Password) into the mix using Yubikeys: http://www.yubico.com/products/yubikey-hardware/yubikey/
I've also been using Duo Security as my new 2FA solution and I like it a lot (it also has support for using Yubikeys to provide your OTP.)
Re: How I spend my first 5 minutes on a server
#275Re: How I spend my first 5 minutes on a server
#276Beginner or not, you should probably use visudo [1] instead of vim /etc/sudoers for the sanity checks that it provides, if nothing else. A botched edit of /etc/sudoers that locks you (along with every other user) out of administrative access is an unpleasant way to learn this. [1] http://linux.die.net/man/8/visudo
On debian or ubuntu you can also include a user on the sudo group: usermod -a -G sudo username
$ sudo adduser username sudo
Re: How I spend my first 5 minutes on a server
#277> No secure server is complete without a firewall. Comments like those are why I normally point people to actual security expects (like, say, Schneier), and why I recommend that new admins should ignore as much as possible the practices chanted by the industry. A secure server does not need a firewall. A firewall can be used to secure a server against a specific threat, but that's it. The days of ping of death are be…
The days of ping of death are behind us. Packet of death. Hmm. http://www.kriskinc.com/intel-pod
Flashback quite a few years. I was working in IT and my coworker asked me if my WinXP (IIRC) machine was up to date. I said "yes". Next thing I know, it crashed hard. Oops, my buddy just hit me with a ping of death.
Re: How I spend my first 5 minutes on a server
#278> No secure server is complete without a firewall. Comments like those are why I normally point people to actual security expects (like, say, Schneier), and why I recommend that new admins should ignore as much as possible the practices chanted by the industry. A secure server does not need a firewall. A firewall can be used to secure a server against a specific threat, but that's it. The days of ping of death are be…
You are correct that a firewall will not magically solve all your problems, but it does help to protect against programs that open ports you didn't know about.
Recommending against them doesn't make sense, and implying that they are only useful to prevent TCP/IP zero day vulnerabilities is silly (especially since the firewall likely wouldn't protect against that anyway).
Re: How I spend my first 5 minutes on a server
#279Having a _shared_ account, with sudo privileges and a common password doesn't look smart.
Also, you're forcing devs to copy their public keys around.
I think you underestimate the benefits brought in by a centralized system, like LDAP, which would also allow you to manage the permissions with some more granularity
Re: How I spend my first 5 minutes on a server
#280It'd sure be nice for those of us who are not security experts to read alternative approaches rather than, paraphrasing and not picking on anyone, "using a firewall is dumb" or "blocking ssh is pointless".
I like isolated ideas such as using a script to completely automate the provisioning of new boxes. Kind of a no-brainer if you ask me. The problem is that such recommendations are not followed by something like "Here's the script I use on Ubuntu 12.04 LTS".
How about it guys? Would you care to attempt to produce a canonical HN "How to harden your server" reference?
Maybe one of the security experts on HN can start a repository on Github to evolve a canonical script. I'm pretty much 100% Ubuntu 12.04 LTS, so it is my hope that this is one of the platforms that is addressed.
I did some looking around and this is what I found (I am in no position to evaluate the merits of any of these at anything beyond an intermediate level):
https://github.com/bluedragonz/server-shield
https://github.com/eglimi/linux_hardening
http://www.cyberciti.biz/tips/linux-security.html
http://ubuntuforums.org/showthread.php?t=1002167
http://www.thefanclub.co.za/how-to/how-secure-ubuntu-1204-lt...
http://www.andrewault.net/2010/05/17/securing-an-ubuntu-serv...
http://ubuntuforums.org/showthread.php?t=1919111
https://help.ubuntu.com/12.04/serverguide/security.html
http://www.sans.org/score/checklists/linuxchecklist.pdf
http://nvd.nist.gov/scap/content/stylesheet/scap-rhel5-docum...
http://blogs.csoonline.com/ubuntu_lts_vulnerability_scrub_ag...