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.

Security Threats<br />

343<br />

Exposure of Confidential Data<br />

Data stored on your computers, or being transmitted to or from your computers, might<br />

be confidential. It might be information that only certain people are intended to see,<br />

such as wholesale price lists. It might be confidential information provided by a customer,<br />

such as his password, contact details, <strong>and</strong> credit card number.<br />

We hope you are not storing information on your web server that you do not intend<br />

anyone to see. A web server is the wrong place for secret information. If you were storing<br />

your payroll records or your top secret plan for beating racing ferrets on a computer,<br />

you would be wise to use a computer other than your web server.The web server is<br />

inherently a publicly accessible machine <strong>and</strong> should contain only information that either<br />

needs to be provided to the public or has recently been collected from the public.<br />

To reduce the risk of exposure, you need to limit the methods by which information<br />

can be accessed <strong>and</strong> limit the people who can access it.This process involves designing<br />

with security in mind, configuring your server <strong>and</strong> software properly, programming carefully,<br />

testing thoroughly, removing unnecessary services from the web server, <strong>and</strong> requiring<br />

authentication.<br />

You need to design, configure, code, <strong>and</strong> test carefully to reduce the risk of a successful<br />

criminal attack <strong>and</strong>, equally important, to reduce the chance that an error will leave<br />

your information open to accidental exposure.<br />

You also need to remove unnecessary services from your web server to decrease the<br />

number of potential weak points. Each service you are running might have vulnerabilities.<br />

Each one needs to be kept up to date to ensure that known vulnerabilities are not<br />

present.The services that you do not use might be more dangerous. If you never use the<br />

comm<strong>and</strong> rcp, for example, why have the service installed? 1 If you tell the installer that<br />

your machine is a network host, the major Linux distributions <strong>and</strong> Windows will install a<br />

large number of services that you do not need <strong>and</strong> should remove.<br />

Authentication means asking people to prove their identity.When the system knows<br />

who is making a request, it can decide whether that person is allowed access. A number<br />

of possible methods of authentication can be employed, but only two forms are commonly<br />

used on public websites: passwords <strong>and</strong> digital signatures.We talk a little more<br />

about both later.<br />

CD Universe offers a good example of the cost both in dollars <strong>and</strong> reputation of<br />

allowing confidential information to be exposed. In late 1999, a cracker calling himself<br />

Maxus reportedly contacted CD Universe, claiming to have 300,000 credit card numbers<br />

stolen from the company’s site. He wanted a $100,000 (U.S.) ransom from the site to<br />

destroy the numbers.The company refused <strong>and</strong> found itself in embarrassing coverage on<br />

the front pages of major newspapers as Maxus doled out numbers for others to abuse.<br />

Data is also at risk of exposure while it traverses a network. Although TCP/IP networks<br />

have many fine features that have made them the de facto st<strong>and</strong>ard for connecting<br />

1 Even if you do currently use rcp, you should probably remove it <strong>and</strong> use scp (secure copy)<br />

instead.

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

Saved successfully!

Ooh no, something went wrong!