21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

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.

Most of the security patches issued today are issued to eliminate surprises because<br />

there are no specifications for the underlying code. As a profession, we write too<br />

much surprising code.<br />

I could go on, but I hope my points are clear: there are some real problems in the<br />

way software is being produced, and those problems lead to some serious—and<br />

expensive—problems. However, problem-free software and absolute security are<br />

almost always beyond our reach in any significant software project, so the next best<br />

thing is to identify and reduce the risks. Proven approaches to reduce these risks<br />

include using established methods of software engineering, exercising care in design<br />

and development, reusing proven software, and thinking about how to handle potential<br />

errors. This is the process of assurance—of building trust in our systems. Assurance<br />

needs to be built in rather than asserted after the software is finished.<br />

That’s why this book is so valuable. It can help people write correct, robust software<br />

the first time and avoid many of the surprises. The material in this book can help you<br />

provide a network connection with end-to-end security, as well as help you eliminate<br />

the need to patch the code because you didn’t add enough entropy to key generation,<br />

or you failed to change the UID/GID values in the correct order. Using this<br />

code you can get the environment set correctly, the signals checked, and the file<br />

descriptors the way you need them. And along the way, you can read a clear, cogent<br />

description about what needs to be set and why in each case. Add in some good<br />

design and careful testing, and a lot of the surprises go away.<br />

Are all the snippets of code in this book correct? Well, correct for what? There are<br />

many other things that go into writing reliable code, and they depend on the context.<br />

The code in this book will only get you partway to your goal of good code. As<br />

with any cookbook, you may need to adjust the portions or add a little extra seasoning<br />

to match your overall menu. But before you do that, be sure you understand the<br />

implications! The authors of this book have tried to anticipate most of the circumstances<br />

where you would use their code, and their instructions can help you avoid<br />

the most obvious problems (and many subtle ones). However, you also need to build<br />

the rest of the code properly, and run it on a well-administered system. (For that, you<br />

might want to check out some of the other O’Reilly books, such as Secure Coding by<br />

Mark Graff and Kenneth van Wyk, and Practical Unix and Internet Security by Simson<br />

Garfinkel, Gene Spafford, and Alan Schwartz.)<br />

So, let’s return to those four categories of programmers. This book isn’t likely to help<br />

the group of people who are perpetually unclear on the concepts, but it is unlikely to<br />

hurt them. It will do a lot to help the people who need guidance and examples,<br />

because it contains the text as well as the code. The people who write good software<br />

most of the time could learn a lot by reading this book, and using the examples as<br />

starting points. And the experts are the ones who will readily adopt this code (with,<br />

perhaps, some small adaptions); expert coders know that reuse of trusted components<br />

is a key method of avoiding mistakes. Whichever category of programmer you<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.<br />

Foreword | xv

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

Saved successfully!

Ooh no, something went wrong!