Building Secure Software: How to Avoid Security Problems the Right Way
John Viega
Gary McGraw

ISBN-10: 020172152X
ISBN-13: 9780201721522

Publisher: Addison-Wesley Professional
Copyright: 2002
Format: Cloth; 528 pp
Published: 09/24/2001

Suggested retail price: $59.99
Buy from myPearsonStore

Building Secure Software cuts to the heart of computer security to help students get security right the first time. Bugs in software are a serious problem and students must learn to take that into consideration early on in the software development lifecycle. Building Secure Software provides expert perspectives and techniques to help you ensure the security of essential software. If students learn to consider threats and vulnerabilities early in the development cycle they can build security into the system. With this book students will learn how to determine an acceptable level of risk, develop security tests, and plug security holes before software is even shipped.



Foreword.


Preface.

Organization.

Code Examples.

Contacting Us.



Acknowledgments.


1. Introduction to Software Security.

It's All about the Software.

Dealing with Widespread Security Failures.

Bugtraq.

CERT Advisories.

RISKS Digest.

Technical Trends Affecting Software Security.

The 'ilities.

What Is Security?.

Isn't That Just Reliability?

Penetrate and Patch Is Bad.

On Art and Engineering.

Security Goals.

Prevention.

Traceability and Auditing.

Monitoring.

Privacy and Confidentiality.

Multilevel Security.

Anonymity.

Authentication.

Integrity.

Know Your Enemy: Common Software Security Pitfalls.

Software Project Goals.

Conclusion.



2. Managing Software Security Risk.

An Overview of Software Risk Management for Security.

The Role of Security Personnel.

Software Security Personnel in the Life Cycle.

Deriving Requirements.

Risk Assessment.

Design for Security.

Implementation.

Security Testing.

A Dose of Reality.

Getting People to Think about Security.

Software Risk Management in Practice.

When Development Goes Astray.

When Security Analysis Goes Astray.

The Common Criteria.

Conclusion.



3. Selecting Technologies.

Choosing a Language.

Choosing a Distributed Object Platform.

CORBA.

DCOM.

EJB and RMI.

Choosing an Operating System.

Authentication Technologies.

Host-Based Authentication.

Physical Tokens.

Biometric Authentication.

Cryptographic Authentication.

Defense in Depth and Authentication.

Conclusion.



4. On Open Source and Closed Source.

Security by Obscurity.

Reverse Engineering.

Code Obfuscation.

Security for Shrink-Wrapped Software.

Security by Obscurity Is No Panacea.

The Flip Side: Open-Source Software.

Is the “Many-Eyeballs Phenomenon<170) Real?

Why Vulnerability Detection Is Hard.

Other Worries.

On Publishing Cryptographic Algorithms.

Two More Open-Source Fallacies.

The Microsoft Fallacy.

The Java Fallacy.

An Example: GNU Mailman Security.

More Evidence: Trojan Horses.

To Open Source or Not to Open Source.

Another Security Lesson from Buffer Overflows.

Beating the Drum.

Conclusion.



5. Guiding Principles for Software Security.

Principle 1: Secure the Weakest Link.

Principle 2: Practice Defense in Depth.

Principle 3: Fail Securely.

Principle 4: Follow the Principle of Least Privilege.

Principle 5: Compartmentalize.

Principle 6: Keep It Simple.

Principle 7: Promote Privacy.

Principle 8: Remember That Hiding Secrets Is Hard.

Principle 9: Be Reluctant to Trust.

Principle 10: Use Your Community Resources.

Conclusion.



6. Auditing Software.

Architectural Security Analysis.

Attack Trees.

Reporting Analysis Findings.

Implementation Security Analysis.

Auditing Source Code.

Source-level Security Auditing Tools.

Using RATS in an Analysis.

The Effectiveness of Security Scanning of Software.

Conclusion.



7. Buffer Overflows.

What Is a Buffer Overflow?

Why Are Buffer Overflows a Security Problem?

Defending against Buffer Overflow.

Major Gotchas.

Internal Buffer Overflows.

More Input Overflows.

Other Risks.

Tools That Can Help.

Smashing Heaps and Stacks.

Heap Overflows.

Stack Overflows.

Decoding the Stack.

To Infinity and Beyond!

Attack Code.

A UNIX Exploit.

What About Windows?

Conclusion.



8. Access Control.

The UNIX Access Control Model.

How UNIX Permissions Work.

Modifying File Attributes.

Modifying Ownership.

The umask.

The Programmatic Interface.

Setuid Programming.

Access Control in Windows NT.

Compartmentalization.

Fine-Grained Privileges.

Conclusion.



9. Race Conditions.

What Is a Race Condition?

Time-of-Check, Time-of-Use.

Broken passwd.

Avoiding TOCTOU Problems.

Secure File Access.

Temporary Files.

File Locking.

Other Race Conditions.

Conclusion.



10. Randomness and Determinism.

Pseudo-random Number Generators.

Examples of PRNGs.

The Blum-Blum-Shub PRNG.

The Tiny PRNG.

Attacks Against PRNGs.

How to Cheat in On-line Gambling.

Statistical Tests on PRNGs.

Entropy Gathering and Estimation.

Hardware Solutions.

Software Solutions.

Poor Entropy Collection: How to Read “Secret” Netscape Messages.

Handling Entropy.

Practical Sources of Randomness.

Tiny.

Random Numbers for Windows.

Random Numbers for Linux.

Random Numbers in Java.

Conclusion.



11. Applying Cryptography.

General Recommendations.

Developers Are Not Cryptographers.

Data Integrity.

Export Laws.

Common Cryptographic Libraries.

Cryptlib.

OpenSSL.

Crypto++.

BSAFE.

Cryptix.

Programming with Cryptography.

Encryption.

Hashing.

Public Key Encryption.

Threading.

Cookie Encryption.

More Uses for Cryptographic Hashes.

SSL and TLS (Transport Layer Security.

Stunnel.

One-Time Pads.

Conclusion.



12. Trust Management and Input Validation.

A Few Words on Trust.

Examples of Misplaced Trust.

Trust Is Transitive.

Protection from Hostile Callers.

Invoking Other Programs Safely.

Problems from the Web.

Client-side Security.

Perl Problems.

Format String Attacks.

Automatically Detecting Input Problems.

Conclusion.



13. Password Authentication.

Password Storage.

Adding Users to a Password Database.

Password Authentication.

Password Selection.

More Advice.

Throwing Dice.

Passphrases.

Application-Selected Passwords.

One-Time Passwords.

Conclusion.



14. Database Security.

The Basics.

Access Control.

Using Views for Access Control.

Field Protection.

Security against Statistical Attacks.

Conclusion.



15. Client-side Security.

Copy Protection Schemes.

License Files.

Thwarting the Casual Pirate.

Other License Features.

Other Copy Protection Schemes.

Authenticating Untrusted Clients.

Tamperproofing.

Antidebugger Measures.

Checksums.

Responding to Misuse.

Decoys.

Code Obfuscation.

Basic Obfuscation Techniques.

Encrypting Program Parts.

Conclusion.



16. Through the Firewall.

Basic Strategies.

Client Proxies.

Server Proxies.

SOCKS.

Peer to Peer.

Conclusions.



Appendix A. Cryptography Basics.

The Ultimate Goals of Cryptography.

Attacks on Cryptography.

Types of Cryptography.

Symmetric Cryptography.

Types of Symmetric Algorithms.

Security of Symmetric Algorithms.

Public Key Cryptography.

Cryptographic Hashing Algorithms.

Other Attacks on Cryptographic Hashes.

What's a Good Hash Algorithm to Use?

Digital Signatures.

Conclusions.



References.


Index.

John Viega is the CTO of Secure Software Solutions (www.securesw.com) and a noted expert in the area of software security. He is responsible for numerous tools in this area, including code scanners (ITS4 and RATS), random number suites (EGADS), automated repair tools, and secure programming libraries. He is also the original author of Mailman, the GNU mailing list manager.

Gary McGraw, Cigital's CTO, is a leading authority on software security. Dr. McGraw is coauthor of the groundbreaking books Building Secure Software and Exploiting Software (both from Addison-Wesley). While consulting for major software producers and consumers, he has published over ninety peer-reviewed technical publications, and functions as principal investigator on grants from DARPA, the National Science Foundation, and NIST's Advanced Technology Program. He serves on the advisory boards of Authentica, Counterpane, and Fortify Software. He is also an advisor to the computer science departments at University of California, Davis, and the University of Virginia, as well as the School of Informatics at Indiana University.



"This book is useful, practical, understandable, and comprehensive. The fact that you have this book in your hands is a step in the right direction. Read it, learn from it. And then put its lessons into practice."
--From the Foreword by Bruce Schneier, CTO, Counterpane, and author of Secrets and Lies
"A must-read for anyone writing software for the Internet."
--Jeremy Epstein, Director, Product Security and Performance, webMethods
"This book tackles complex application security problems like buffer overflows, race conditions, and applied cryptography in a manner that is straightforward and easy to understand. This is a must for any application developer or security professional."
--Paul Raines, Global Head of Information Risk Management, Barclays Capital

Most organizations have a firewall, antivirus software, and intrusion detection systems, all of which are intended to keep attackers out. So why is computer security a bigger problem today than ever before? The answer is simple--bad software lies at the heart of all computer security problems. Traditional solutions simply treat the symptoms, not the problem, and usually do so in a reactive way. This book teaches you how to take a proactive approach to computer security.

Building Secure Software cuts to the heart of computer security to help you get security right the first time. If you are serious about computer security, you need to read this book, which includes essential lessons for both security professionals who have come to realize that software is the problem, and software developers who intend to make their code behave. Written for anyone involved in software development and use--from managers to coders--this book is your first step toward building more secure software. Building Secure Software provides expert perspectives and techniques to help you ensure the security of essential software. If you consider threats and vulnerabilities early in the devel-opment cycle you can build security into your system. With this book you will learn how to determine an acceptable level of risk, develop security tests, and plug security holes before software is even shipped.

Inside you'll find the ten guiding principles for software security, as well as detailed coverage of:

  • Software risk management for security
  • Selecting technologies to make your code more secure
  • Security implications of open source and proprietary software
  • How to audit software
  • The dreaded buffer overflow
  • Access control and password authentication
  • Random number generation
  • Applying cryptography
  • Trust management and input
  • Client-side security
  • Dealing with firewalls

Only by building secure software can you defend yourself against security breaches and gain the confidence that comes with knowing you won't have to play the "penetrate and patch" game anymore. Get it right the first time. Let these expert authors show you how to properly design your system; save time, money, and credibility; and preserve your customers' trust.



020172152XB08202001

View a Sample Chapter PDF: /samplechapter/020172152X.pdf

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, contact your Pearson Higher Education representative for pricing and ordering information.

This title is a member of the Addison-Wesley Professional Computing Series, which also contains the titles below . You can also visit the Addison-Wesley Professional Computing Series page.

  • 0201379279Advanced CORBA® Programming with C++
    Henning & Vinoski
    © 1999 | Addison-Wesley Professional | Paper; 1120 pages | Instock
    ISBN-10: 0201379279 | ISBN-13: 9780201379273
    Brief Description | Buy from myPearsonStore

  • 0321525949Advanced Programming in the UNIX Environment: Paperback Edition, 2/E
    Stevens & Rago
    © 2008 | Addison-Wesley Professional | Paper; 960 pages | Instock
    ISBN-10: 0321525949 | ISBN-13: 9780321525949
    Buy from myPearsonStore

  • 0201433079Advanced Programming in the UNIX® Environment, 2/E
    Stevens & Rago
    © 2005 | Addison-Wesley Professional | Cloth; 960 pages | Instock
    ISBN-10: 0201433079 | ISBN-13: 9780201433074
    Brief Description | Buy from myPearsonStore

  • 0131411543Advanced UNIX Programming, 2/E
    Rochkind
    © 2004 | Addison-Wesley Professional | Paper; 736 pages | Instock
    ISBN-10: 0131411543 | ISBN-13: 9780131411548
    Brief Description | Buy from myPearsonStore

  • 0131429019The Art of UNIX Programming
    Raymond
    © 2004 | Addison-Wesley Professional | Paper; 560 pages | Instock
    ISBN-10: 0131429019 | ISBN-13: 9780131429017
    Brief Description | Buy from myPearsonStore

  • 020172152XBuilding Secure Software: How to Avoid Security Problems the Right Way
    Viega & McGraw
    © 2002 | Addison-Wesley Professional | Cloth; 528 pages | Instock
    ISBN-10: 020172152X | ISBN-13: 9780201721522
    Brief Description | Buy from myPearsonStore

  • 0201498413C Interfaces and Implementations: Techniques for Creating Reusable Software
    Hanson
    © 1997 | Addison-Wesley Professional | Paper; 544 pages | Instock
    ISBN-10: 0201498413 | ISBN-13: 9780201498417
    Buy from myPearsonStore

  • 0201634988Design Patterns CD: Elements of Reusable Object-Oriented Software
    Gamma, Helm, Johnson & Vlissides
    © 1998 | Addison-Wesley Professional | CD-ROM Only; 2 pages | Instock
    ISBN-10: 0201634988 | ISBN-13: 9780201634983
    Brief Description | Buy from myPearsonStore

  • 0201633612Design Patterns: Elements of Reusable Object-Oriented Software
    Gamma, Helm, Johnson & Vlissides
    © 1995 | Addison-Wesley Professional | Cloth; 416 pages | Instock
    ISBN-10: 0201633612 | ISBN-13: 9780201633610
    Brief Description | Buy from myPearsonStore

  • 0321334876Effective C++: 55 Specific Ways to Improve Your Programs and Designs, 3/E
    Meyers
    © 2005 | Addison-Wesley Professional | Paper; 320 pages | Instock
    ISBN-10: 0321334876 | ISBN-13: 9780321334879
    Brief Description | Buy from myPearsonStore

  • 0201749629Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
    Meyers
    © 2001 | Addison-Wesley Professional | Paper; 288 pages | Instock
    ISBN-10: 0201749629 | ISBN-13: 9780201749625
    Brief Description | Buy from myPearsonStore

  • 020163466XFirewalls and Internet Security: Repelling the Wily Hacker, 2/E
    Cheswick, Bellovin & Rubin
    © 2003 | Addison-Wesley Professional | Paper; 464 pages | Instock
    ISBN-10: 020163466X | ISBN-13: 9780201634662
    Brief Description | Buy from myPearsonStore

  • 020163497XForensic Discovery
    Farmer & Venema
    © 2005 | Addison-Wesley Professional | Cloth; 240 pages | Instock
    ISBN-10: 020163497X | ISBN-13: 9780201634976
    Brief Description | Buy from myPearsonStore

  • 0321618092Forensic Discovery
    Farmer & Venema
    © 2005 | Addison-Wesley Professional | On-line Supplement | Estimated Availability: 12/27/2004
    ISBN-10: 0321618092 | ISBN-13: 9780321618092
    URL: http://safari.informit.com


  • 0201563339Gigabit Networking
    Partridge
    © 1994 | Addison-Wesley Professional | Paper; 416 pages | Estimated Availability: 10/30/1993
    ISBN-10: 0201563339 | ISBN-13: 9780201563337
    Brief Description | Buy from myPearsonStore

  • 0201634481Interconnections: Bridges, Routers, Switches, and Internetworking Protocols, 2/E
    Perlman
    © 2000 | Addison-Wesley Professional | Cloth; 560 pages | Instock
    ISBN-10: 0201634481 | ISBN-13: 9780201634488
    Buy from myPearsonStore

  • 0201633620Large-Scale C++ Software Design
    Lakos
    © 1996 | Addison-Wesley Professional | Paper; 896 pages | Instock
    ISBN-10: 0201633620 | ISBN-13: 9780201633627
    Buy from myPearsonStore

  • 020163371XMore Effective C++: 35 New Ways to Improve Your Programs and Designs
    Meyers
    © 1996 | Addison-Wesley Professional | Paper; 336 pages | Instock
    ISBN-10: 020163371X | ISBN-13: 9780201633719
    Buy from myPearsonStore

  • 020161586XThe Practice of Programming
    Kernighan & Pike
    © 1999 | Addison-Wesley Professional | Paper; 288 pages | Instock
    ISBN-10: 020161586X | ISBN-13: 9780201615869
    Brief Description | Buy from myPearsonStore

  • 0201379236STL Tutorial and Reference Guide: C++ Programming with the Standard Template Library, 2/E
    Musser, Derge & Saini
    © 2001 | Addison-Wesley Professional | Cloth; 560 pages | Instock
    ISBN-10: 0201379236 | ISBN-13: 9780201379235
    Brief Description | Buy from myPearsonStore

  • 0201633469TCP/IP Illustrated, Volume 1: The Protocols
    Stevens
    © 1994 | Addison-Wesley Professional | Cloth; 600 pages | Instock
    ISBN-10: 0201633469 | ISBN-13: 9780201633467
    Brief Description | Buy from myPearsonStore

  • 020163354XTCP/IP Illustrated, Volume 2: The Implementation
    Wright & Stevens
    © 1995 | Addison-Wesley Professional | Cloth; 1200 pages | Instock
    ISBN-10: 020163354X | ISBN-13: 9780201633542
    Brief Description | Buy from myPearsonStore

  • 0201634953TCP/IP Illustrated, Volume 3: TCP for Transactions, HTTP, NNTP, and the UNIX® Domain Protocols
    Stevens
    © 1996 | Addison-Wesley Professional | Cloth; 352 pages | Instock
    ISBN-10: 0201634953 | ISBN-13: 9780201634952
    Buy from myPearsonStore

  • 020163337XTcl and the Tk Toolkit
    Ousterhout
    © 1994 | Addison-Wesley Professional | Paper; 480 pages | Out of Stock
    ISBN-10: 020163337X | ISBN-13: 9780201633375
    Brief Description

  • 0201633388UNIX® Systems for Modern Architectures: Symmetric Multiprocessing and Caching for Kernel Programmers
    Schimmel
    © 1994 | Addison-Wesley Professional | Paper; 432 pages | Instock
    ISBN-10: 0201633388 | ISBN-13: 9780201633382
    Brief Description | Buy from myPearsonStore

  • 0131411551Unix Network Programming, Volume 1: The Sockets Networking API, 3/E
    Stevens, Fenner & Rudoff
    © 2004 | Addison-Wesley Professional | Cloth; 1024 pages | Instock
    ISBN-10: 0131411551 | ISBN-13: 9780131411555
    Brief Description | Buy from myPearsonStore

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, browse our available packages below, or contact your Pearson Higher Education representative to create your own package.



Copyright ©2008 Pearson Education. All rights reserved. Legal Notice | Privacy Policy | Permissions