18.12.2012 Views

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

[Chapter 17] 17.4 <strong>Sec</strong>urity Implications of Network Services<br />

Bringing Up an <strong>Internet</strong> Server Machine: Step-by-Step<br />

Although every site is unique, you may find the following step-by-step list helpful in bringing up new<br />

servers as securely as possible:<br />

1.<br />

2.<br />

3.<br />

4.<br />

5.<br />

6.<br />

7.<br />

8.<br />

9.<br />

10.<br />

11.<br />

12.<br />

●<br />

Don't physically connect to the network before you perform all of the following steps. Because<br />

some network access may be needed to FTP patches, for example, you may need to connect as<br />

briefly as possible in single-user mode (so there are no daemons running), fetch what you need,<br />

disconnect physically, and then follow steps 2-12.<br />

Erase your computer's hard disk and load a fresh copy of your operating system.<br />

Locate and load all security-related patches. To find the patches, check with both your vendor and<br />

with CERT's FTP server, ftp.cert.org.<br />

Modify your computer's /etc/syslog.conf file so that logs are stored both locally and on your<br />

organization's logging host.<br />

Configure as few user accounts as necessary. Ideally, users should avoid logging into your <strong>Internet</strong><br />

server.<br />

If your server is a mail server, then you may wish to have your users read their mail with POP.<br />

You will need to create user accounts, but give each user a /bin/nologin (or a shell script that<br />

simply prints a "no logins allowed" message) as their shell to prevent logins.<br />

Check all /etc/rc* and other system initialization files, and remove daemons you don't want<br />

running. (Use netstat to see what services are running.)<br />

Look through /etc/inetd.conf and disable all unneeded services. Protect the remaining services with<br />

tcpwrapper or a similar program.<br />

Add your own server programs to the system. Make sure that each one is based on the most<br />

up-to-date code.<br />

Get and install Tripwire, so you can tell if any files have been modified as the result of a<br />

compromise. (See Chapter 9, Integrity Management, for details.)<br />

Get and run Tiger to look for other problems.<br />

Monitor your system. Make sure that log files aren't growing out of control. Use the last command<br />

to see if people have logged in. Be curious.<br />

Disable all services that you are not sure you need, and put wrappers around the rest to log<br />

connections and restrict connectivity.<br />

17.3 Primary <strong>UNIX</strong> Network<br />

Services<br />

file:///C|/Oreilly Unix etc/<strong>O'Reilly</strong> Reference Library/networking/puis/ch17_04.htm (2 of 3) [2002-04-12 10:45:36]<br />

17.5 Monitoring Your<br />

Network with netstat

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!