General Unix Security Issues


June 11, 2003

Ryan Bradetich
ryan.bradetich@hp.com


(page 1)


What is Security?





Security is a process,
not a product.


(page 2)


Host Security Layers








(page 3)


Potential threats to the Perimeter









(page 4)


Physical Threats







(page 5)


Remote Console Threats








(page 6)


Network (IP) Threats



Before delving into the technical details of securing the network access, step back and look at the big picture.




(page 7)


Network Tools


Standard tools for assessing the initial threat.





(page 8)


Example netstat output



$ netstat -an --inet
tcp 0 0 127.0.0.1:1971 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 192.151.81.14:123 0.0.0.0:*
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*


(page 9)


Example 1 using LSOF


$ lsof -ni TCP:953
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
named 410 root 13u IPv4 763 TCP 127.0.0.1:953 (LISTEN)
named 411 root 13u IPv4 763 TCP 127.0.0.1:953 (LISTEN)
named 412 root 13u IPv4 763 TCP 127.0.0.1:953 (LISTEN)
named 413 root 13u IPv4 763 TCP 127.0.0.1:953 (LISTEN)
named 414 root 13u IPv4 763 TCP 127.0.0.1:953 (LISTEN)


(page 10)


Example 2 using LSOF


$ lsof -p 410
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
named 410 root cwd DIR 58,1 4096 144290 /var/cache/bind
named 410 root rtd DIR 9,2 4096 2 /
named 410 root txt REG 58,2 244952 96392 /usr/sbin/named



(page 11)


Example Nmap Output


$ nmap -sT -O -P0 -n 10.0.0.1

Starting nmap V. 3.10ALPHA4 ( www.insecure.org/nmap/ )
Interesting ports on 10.0.0.1:
(The 1604 ports scanned but not shown below are in state: closed)

Port State Service
22/tcp open ssh

Remote operating system guess: Linux Kernel 2.4.0 - 2.5.20
Uptime 42.567 days (since Mon Apr 28 07:56:00 2003)

Nmap run completed -- 1 IP address (1 host up) scanned in 23.081 seconds


(page 12)


Disable all non-essential network services.







(page 13)


Review essential network services.



Many Unix protocols were not designed with security in mind.

Replace with a better designed (security wise) application when possible.


(page 14)


Bind services to specific interfaces when possible.








(page 15)


Restrict access to services when possible.







(page 16)


Kernel based packet filtering.








(page 17)


Application jails and privilege dropping.






(page 18)


Compartments







(page 19)


HP Virtual Vault compartment diagram




vv.png


(page 20)


Additional interesting Linux kernel parameters









(page 21)


Additional interesting HP-UX kernel parameters






(page 22)


Modems/Serial/Other Threats






(page 23)


Inside the Perimeter








(page 24)


Software and Patches Security








(page 25)


Filesystem Security









(page 26)


Filesystem Security (2)







(page 27)


Password Management







(page 28)


Password Management (2)




crypt3.png



(page 29)


Privileged Access







(page 30)


Privileged Access (2)



To reduce risk and exposure from root in traditional Unix, UID-0 need to be treated as just another user.





(page 31)


Summary





(page 32)