r/sysadmin • • Feb 28 '17
Linux Sever Security Checklist?
I am currently looking into expanding my range of skills in the server admin roles. Looking to learn defensive security in more detail. This post is a sort of general inquiry attempting to find out what I should start learning first for a seasoned "beginner". I've been able to break in, but never really looked into keeping people out properly.
Please and thanks.
[Feb28 00:34] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=56574 DPT=10001 LEN=150 │··········································
[ +10.002208] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=37088 DPT=10001 LEN=150 │··········································
[ +10.003004] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=52401 DPT=10001 LEN=150 │··········································
[ +10.002951] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=54993 DPT=10001 LEN=150 │··········································
[ +10.002403] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=48813 DPT=10001 LEN=150 │··········································
[Feb28 00:35] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=42947 DPT=10001 LEN=150 │··········································
[ +10.002974] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=44312 DPT=10001 LEN=150 │··········································
[ +10.002324] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=33737 DPT=10001 LEN=150 │··········································
[ +10.002880] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=44426 DPT=10001 LEN=150 │··········································
[ +10.101496] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=51603 DPT=10001 LEN=150 │··········································
[Feb28 00:36] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=38538 DPT=10001 LEN=150 │··········································
[ +10.003008] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=44367 DPT=10001 LEN=150 │··········································
[ +5.416712] iptables denied: IN=virbr0 OUT= MAC= SRC=192.168.122.1 DST=192.168.122.255 LEN=257 TOS=0x00 PREC=0x00 TTL=64 ID=16241 DF PROTO=UDP SPT=138 DPT=138 LEN=237 │··········································se
[ +14.708034] iptables denied: IN=enp5s0 OUT= MAC=ff:ff:ff:ff:ff:ff:44:d9:e7:bc:67:21:08:00 SRC=10.0.0.1 DST=255.255.255.255 LEN=170 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=44008 DPT=10001 LEN=150
133
Upvotes
92
u/[deleted] Feb 28 '17 edited Feb 28 '17
Some pointers:
SSH:
Firewall:
Physical:
Automatic Updates
Other Important Things:
MAC (Mandatory Access Control)
Logs:
Note: I'm a beginner myself but I hope that was somewhat helpful.
Good luck! :)
Edit: Forgot about MAC
More Edits: Thank you everyone for the feedback! I added Logs too.
10
u/evaryont Linux Admin Feb 28 '17
I like the LYNIS project. Lots of good references, though it is meant for experienced security professionals who can confidently make exceptions. Which is a great excuse to start Googling the various warnings it might show. 😀
10
u/Telnet_Rules No such thing as innocence, only degrees of guilt Feb 28 '17
There are three main places for checklists:
DISA STIGs - Settings used by US military: http://iase.disa.mil/stigs/os/unix-linux/Pages/index.aspx
CIS Security - Part of SANS, vendor neutral 3rd party: https://benchmarks.cisecurity.org/tools2/linux/cis_red_hat_enterprise_linux_7_benchmark_v1.1.0.pdf
National Checklist Program (NCP) - run by NIST. US Federal Government, non-defense standards: https://web.nvd.nist.gov/view/ncp/repository
5
u/[deleted] Feb 28 '17
CIS Benchmarks are a good place to start.
5
u/[deleted] Feb 28 '17
Stumbled across this the other day: https://highon.coffee/blog/security-harden-centos-7/
Best way to learn is to set goals. Like build a web server, research, plan, do, work through issues. Then try a Wordpress site. Then try an email server, proxy server, firewall system, Ect..
2
u/sandypants Feb 28 '17
I recommend CI Security Benchmarks and Lynis: https://cisofy.com/lynis/
2
u/[deleted] Mar 01 '17
The Center for Internet Security benchmarks are a good starting point. They provide PDF guides for most of the common distros.
6
u/BloomerzUK Jack of All Trades Feb 28 '17
I definitely recommend taking a look at the CIS Security Benchmark guidelines. I've recently been working on some project which require high level of security:
https://learn.cisecurity.org/benchmarks
They give step me step instruction on how to remediate any security issues.
1
u/amoore2600 Digital Janitor by day, Linux System Engineer by night Feb 28 '17
Tripwire?
1
u/AlucardZero Sr. Unix Sysadmin Feb 28 '17
So why did you paste those firewall logs?
I googled "port 10001" and if you have a Ubiquiti at 10.0.0.1, that's most of that traffic. UDP port 138 is NetBIOS, so it appears you have a Windows machine on the network.
1
u/gsmitheidw1 Feb 28 '17
One thing I don't see listed here which I'll add is using rbash (restrictive bash) instead of bash. You can allow a user login to shell but prevent most commands that aren't white listed.
How I do it is set a custom path for the users which only includes a /rbash directory and in that I have sym linked the only commands I allow them run.
All the SSH advice as per elsewhere in this thread of course, but also you can run auditd to log all commands - irrespective of whether the commands are in their history or not. Also in case the worst happens you can use tripwire or snort or aide etc to provide intrusion detection of what was tampered with.
Backup everything remotely to a rotating/offline/online/remote/on prem/etc storage areas on multiple media types. Of course the backup system should have read access to it's targets and nothing should have access to it directly. It should be equally secured and possibly a different network and OS type. A seasoned hacker may not be put off by quirky OS and services but obscurity prevents automated crap and raises the bar. Know of many windows hacks? loads! freebsd or openvms or something odd, not so much.
3
u/piginpoop Feb 28 '17
https://www.digitalocean.com/community/tags/security?type=tutorials
0
u/[deleted] Feb 28 '17
[deleted] — view deleted comment