13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

388 Chapter 16 <strong>Web</strong> Application Security<br />

you purchase the operating system, especially in the case of Microsoft Windows, Red<br />

Hat or SuSE Linux, or Sun Microsystem’s Solaris Operating System. For other operating<br />

systems, such as FreeBSD, Ubuntu Linux, or OpenBSD, you typically go to the website<br />

representing their organized communities <strong>and</strong> see what latest security fixes they are recommending.<br />

Like all software updates, you should have a staging environment in which you can<br />

test the application of these patches <strong>and</strong> verify their successful installation before performing<br />

the operation on any production servers.This lets you verify that nothing has<br />

broken in your web application before the problem gets to your live servers.<br />

Being smart with the operating system <strong>and</strong> security fixes is definitely worth your<br />

while: If there is a security fix in the FireWire subsystem of a particular operating system,<br />

<strong>and</strong> your server has no FireWire hardware anywhere inside, it is probably a waste of<br />

time to go through the whole deployment process for that fix.<br />

Run Only What Is Necessary<br />

One of the problems many servers have is that they come with large amounts of software<br />

running, such as mail servers, FTP servers, the capability to work with Microsoft<br />

file system shares (via the SMB protocol), <strong>and</strong> others.To run our web applications, we<br />

need the web server software (such as IIS or Apache HTTP Server), <strong>PHP</strong> <strong>and</strong> any related<br />

libraries, the database server software, <strong>and</strong> often not much else.<br />

If you are not using any of those other pieces of software, shut them off <strong>and</strong> disable<br />

them for good.That way, you do not have to worry about them being safe. Users of<br />

Microsoft Windows 2000 <strong>and</strong> XP operating systems should definitely run through the<br />

list of the services that their server is running <strong>and</strong> shut off those that are not needed. If<br />

in doubt, do some research—it is highly likely that somebody on the Internet has already<br />

asked (<strong>and</strong> received an answer to) what a particular service does <strong>and</strong> whether it is necessary.<br />

Physically Secure the Server<br />

We mentioned previously that one of our security threats is somebody coming into our<br />

building, unplugging the server computer, <strong>and</strong> simply walking off with it.This is, tragically,<br />

not a joke.With the average server not being a terribly cheap piece of hardware,<br />

the motivations for stealing server computers are not limited to corporate espionage <strong>and</strong><br />

intellectual theft. Some people might just want to steal the computer for resale.<br />

Thus, it is critical that servers used to run your web applications are kept in a secure<br />

environment, with only authorized people given access to it <strong>and</strong> specific processes in<br />

place for granting <strong>and</strong> revoking access to different people.<br />

Disaster Planning<br />

If you ever want to see a truly blank look, ask your average IT manager what would<br />

happen to their servers, or indeed their entire data center, if the building in which it was

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

Saved successfully!

Ooh no, something went wrong!