MTU Cork Library Catalogue

Syndetics cover image
Image from Syndetics

Building secure software : how to avoid security problems the right way / John Viega, Gary McGraw.

By: Viega, John.
Contributor(s): McGraw, Gary, 1966-.
Material type: materialTypeLabelBookSeries: Addison-Wesley professional computing series.Publisher: Boston : Addison-Wesley, c2002Description: xxx, 493 p. : ill. ; 24 cm. + hbk.ISBN: 020172152X.Subject(s): Computer software -- Development | Computer security | System designDDC classification: 005.1
Contents:
Introduction to Software Security -- Managing software security risk -- Selecting Technologies -- On Open Source and Closed Source -- Guiding Principles for software Security -- Auditing Software -- Buffer Overflows -- Access Control -- Race Conditions -- Randomness and Determinism -- Applying Cryptography -- Trust Management and Input Validation -- Password Authentication -- Database Security -- Client-side Security -- Through the Firewall.
Holdings
Item type Current library Call number Copy number Status Date due Barcode Item holds
General Lending MTU Bishopstown Library Lending 005.1 (Browse shelf(Opens below)) 1 Available 00092321
Total holds: 0

Enhanced descriptions from Syndetics:

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.

Includes bibliographical references (pages 465-470) and index.

Introduction to Software Security -- Managing software security risk -- Selecting Technologies -- On Open Source and Closed Source -- Guiding Principles for software Security -- Auditing Software -- Buffer Overflows -- Access Control -- Race Conditions -- Randomness and Determinism -- Applying Cryptography -- Trust Management and Input Validation -- Password Authentication -- Database Security -- Client-side Security -- Through the Firewall.

Table of contents provided by Syndetics

  • Foreword (p. xix)
  • Preface (p. xxiii)
  • Organization (p. xxiv)
  • Code Examples (p. xxv)
  • Contacting Us (p. xxvi)
  • Acknowledgments (p. xxvii)
  • 1 Introduction to Software Security (p. 1)
  • It's All about the Software (p. 2)
  • Dealing with Widespread Security Failures (p. 6)
  • Bugtraq (p. 7)
  • CERT Advisories (p. 8)
  • RISKS Digest (p. 8)
  • Technical Trends Affecting Software Security (p. 9)
  • The 'ilities (p. 13)
  • What Is Security? (p. 14)
  • Isn't That Just Reliability? (p. 15)
  • Penetrate and Patch Is Bad (p. 15)
  • On Art and Engineering (p. 17)
  • Security Goals (p. 18)
  • Prevention (p. 19)
  • Traceability and Auditing (p. 19)
  • Monitoring (p. 20)
  • Privacy and Confidentiality (p. 20)
  • Multilevel Security (p. 21)
  • Anonymity (p. 21)
  • Authentication (p. 22)
  • Integrity (p. 23)
  • Know Your Enemy: Common Software Security Pitfalls (p. 24)
  • Software Project Goals (p. 26)
  • Conclusion (p. 27)
  • 2 Managing Software Security Risk (p. 29)
  • An Overview of Software Risk Management for Security (p. 30)
  • The Role of Security Personnel (p. 32)
  • Software Security Personnel in the Life Cycle (p. 34)
  • Deriving Requirements (p. 34)
  • Risk Assessment (p. 35)
  • Design for Security (p. 37)
  • Implementation (p. 38)
  • Security Testing (p. 38)
  • A Dose of Reality (p. 39)
  • Getting People to Think about Security (p. 40)
  • Software Risk Management in Practice (p. 40)
  • When Development Goes Astray (p. 41)
  • When Security Analysis Goes Astray (p. 41)
  • The Common Criteria (p. 43)
  • Conclusion (p. 46)
  • 3 Selecting Technologies (p. 49)
  • Choosing a Language (p. 49)
  • Choosing a Distributed Object Platform (p. 54)
  • CORBA (p. 54)
  • DCOM (p. 56)
  • EJB and RMI (p. 58)
  • Choosing an Operating System (p. 59)
  • Authentication Technologies (p. 61)
  • Host-Based Authentication (p. 61)
  • Physical Tokens (p. 63)
  • Biometric Authentication (p. 64)
  • Cryptographic Authentication (p. 66)
  • Defense in Depth and Authentication (p. 66)
  • Conclusion (p. 67)
  • 4 On Open Source and Closed Source (p. 69)
  • Security by Obscurity (p. 70)
  • Reverse Engineering (p. 73)
  • Code Obfuscation (p. 74)
  • Security for Shrink-Wrapped Software (p. 75)
  • Security by Obscurity Is No Panacea (p. 75)
  • The Flip Side: Open-Source Software (p. 75)
  • Is the "Many-Eyeballs Phenomenon" Real? (p. 76)
  • Why Vulnerability Detection Is Hard (p. 79)
  • Other Worries (p. 81)
  • On Publishing Cryptographic Algorithms (p. 82)
  • Two More Open-Source Fallacies (p. 82)
  • The Microsoft Fallacy (p. 82)
  • The Java Fallacy (p. 83)
  • An Example: GNU Mailman Security (p. 84)
  • More Evidence: Trojan Horses (p. 85)
  • To Open Source or Not to Open Source (p. 86)
  • Another Security Lesson from Buffer Overflows (p. 87)
  • Beating the Drum (p. 88)
  • Conclusion (p. 89)
  • 5 Guiding Principles for Software Security (p. 91)
  • Principle 1 Secure the Weakest Link (p. 93)
  • Principle 2 Practice Defense in Depth (p. 96)
  • Principle 3 Fail Securely (p. 97)
  • Principle 4 Follow the Principle of Least Privilege (p. 100)
  • Principle 5 Compartmentalize (p. 102)
  • Principle 6 Keep It Simple (p. 104)
  • Principle 7 Promote Privacy (p. 107)
  • Principle 8 Remember That Hiding Secrets Is Hard (p. 109)
  • Principle 9 Be Reluctant to Trust (p. 111)
  • Principle 10 Use Your Community Resources (p. 112)
  • Conclusion (p. 113)
  • 6 Auditing Software (p. 115)
  • Architectural Security Analysis (p. 118)
  • Attack Trees (p. 120)
  • Reporting Analysis Findings (p. 125)
  • Implementation Security Analysis (p. 126)
  • Auditing Source Code (p. 127)
  • Source-level Security Auditing Tools (p. 128)
  • Using RATS in an Analysis (p. 130)
  • The Effectiveness of Security Scanning of Software (p. 132)
  • Conclusion (p. 133)
  • 7 Buffer Overflows (p. 135)
  • What Is a Buffer Overflow? (p. 138)
  • Why Are Buffer Overflows a Security Problem? (p. 139)
  • Defending against Buffer Overflow (p. 141)
  • Major Gotchas (p. 142)
  • Internal Buffer Overflows (p. 147)
  • More Input Overflows (p. 148)
  • Other Risks (p. 149)
  • Tools That Can Help (p. 150)
  • Smashing Heaps and Stacks (p. 151)
  • Heap Overflows (p. 155)
  • Stack Overflows (p. 159)
  • Decoding the Stack (p. 160)
  • To Infinity ... and Beyond! (p. 165)
  • Attack Code (p. 177)
  • A UNIX Exploit (p. 178)
  • What About Windows? (p. 185)
  • Conclusion (p. 185)
  • 8 Access Control (p. 187)
  • The UNIX Access Control Model (p. 187)
  • How UNIX Permissions Work (p. 189)
  • Modifying File Attributes (p. 190)
  • Modifying Ownership (p. 193)
  • The umask (p. 194)
  • The Programmatic Interface (p. 195)
  • Setuid Programming (p. 197)
  • Access Control in Windows NT (p. 202)
  • Compartmentalization (p. 204)
  • Fine-Grained Privileges (p. 207)
  • Conclusion (p. 208)
  • 9 Race Conditions (p. 209)
  • What Is a Race Condition? (p. 210)
  • Time-of-Check, Time-of-Use (p. 214)
  • Broken passwd (p. 216)
  • Avoiding TOCTOU Problems (p. 219)
  • Secure File Access (p. 222)
  • Temporary Files (p. 225)
  • File Locking (p. 226)
  • Other Race Conditions (p. 227)
  • Conclusion (p. 229)
  • 10 Randomness and Determinism (p. 231)
  • Pseudo-random Number Generators (p. 232)
  • Examples of PRNGs (p. 234)
  • The Blum-Blum-Shub PRNG (p. 236)
  • The Tiny PRNG (p. 237)
  • Attacks Against PRNGs (p. 238)
  • How to Cheat in On-line Gambling (p. 238)
  • Statistical Tests on PRNGs (p. 241)
  • Entropy Gathering and Estimation (p. 241)
  • Hardware Solutions (p. 242)
  • Software Solutions (p. 245)
  • Poor Entropy Collection: How to Read "Secret" Netscape Messages (p. 254)
  • Handling Entropy (p. 255)
  • Practical Sources of Randomness (p. 258)
  • Tiny (p. 259)
  • Random Numbers for Windows (p. 260)
  • Random Numbers for Linux (p. 260)
  • Random Numbers in Java (p. 263)
  • Conclusion (p. 265)
  • 11 Applying Cryptography (p. 267)
  • General Recommendations (p. 268)
  • Developers Are Not Cryptographers (p. 268)
  • Data Integrity (p. 270)
  • Export Laws (p. 271)
  • Common Cryptographic Libraries (p. 272)
  • Cryptlib (p. 272)
  • OpenSSL (p. 274)
  • Crypto++ (p. 275)
  • BSAFE (p. 277)
  • Cryptix (p. 278)
  • Programming with Cryptography (p. 279)
  • Encryption (p. 280)
  • Hashing (p. 286)
  • Public Key Encryption (p. 287)
  • Threading (p. 293)
  • Cookie Encryption (p. 293)
  • More Uses for Cryptographic Hashes (p. 295)
  • SSL and TLS (Transport Layer Security) (p. 297)
  • Stunnel (p. 299)
  • One-Time Pads (p. 301)
  • Conclusion (p. 305)
  • 12 Trust Management and Input Validation (p. 307)
  • A Few Words on Trust (p. 308)
  • Examples of Misplaced Trust (p. 311)
  • Trust Is Transitive (p. 311)
  • Protection from Hostile Callers (p. 314)
  • Invoking Other Programs Safely (p. 319)
  • Problems from the Web (p. 322)
  • Client-side Security (p. 325)
  • Perl Problems (p. 327)
  • Format String Attacks (p. 329)
  • Automatically Detecting Input Problems (p. 331)
  • Conclusion (p. 334)
  • 13 Password Authentication (p. 335)
  • Password Storage (p. 336)
  • Adding Users to a Password Database (p. 339)
  • Password Authentication (p. 350)
  • Password Selection (p. 356)
  • More Advice (p. 358)
  • Throwing Dice (p. 358)
  • Passphrases (p. 362)
  • Application-Selected Passwords (p. 363)
  • One-Time Passwords (p. 365)
  • Conclusion (p. 379)
  • 14 Database Security (p. 381)
  • The Basics (p. 382)
  • Access Control (p. 383)
  • Using Views for Access Control (p. 385)
  • Field Protection (p. 387)
  • Security against Statistical Attacks (p. 391)
  • Conclusion (p. 396)
  • 15 Client-side Security (p. 397)
  • Copy Protection Schemes (p. 400)
  • License Files (p. 409)
  • Thwarting the Casual Pirate (p. 411)
  • Other License Features (p. 412)
  • Other Copy Protection Schemes (p. 413)
  • Authenticating Untrusted Clients (p. 414)
  • Tamperproofing (p. 415)
  • Antidebugger Measures (p. 416)
  • Checksums (p. 418)
  • Responding to Misuse (p. 419)
  • Decoys (p. 421)
  • Code Obfuscation (p. 421)
  • Basic Obfuscation Techniques (p. 422)
  • Encrypting Program Parts (p. 423)
  • Conclusion (p. 426)
  • 16 Through the Firewall (p. 427)
  • Basic Strategies (p. 427)
  • Client Proxies (p. 430)
  • Server Proxies (p. 432)
  • SOCKS (p. 433)
  • Peer to Peer (p. 435)
  • Conclusions (p. 437)
  • Appendix A Cryptography Basics (p. 439)
  • The Ultimate Goals of Cryptography (p. 440)
  • Attacks on Cryptography (p. 442)
  • Types of Cryptography (p. 444)
  • Symmetric Cryptography (p. 444)
  • Types of Symmetric Algorithms (p. 445)
  • Security of Symmetric Algorithms (p. 447)
  • Public Key Cryptography (p. 451)
  • Cryptographic Hashing Algorithms (p. 457)
  • Other Attacks on Cryptographic Hashes (p. 460)
  • What's a Good Hash Algorithm to Use? (p. 461)
  • Digital Signatures (p. 462)
  • Conclusions (p. 464)
  • References (p. 465)
  • Index (p. 471)

Excerpt provided by Syndetics

"A book is a machine to think with." --I.A. Richards PRINCIPLES OF LITERARY CRITICISM This book exists to help people involved in the software development process learn the principles necessary for building secure software. The book is intended for anyone involved in software development, from managers to coders, although it contains the low-level detail that is most applicable to programmers. Specific code examples and technical details are presented in the second part of the book. The first part is more general and is intended to set an appropriate context for building secure software by introducing security goals, security technologies, and the concept of software risk management. There are plenty of technical books that deal with computer security, but until now, none have applied significant effort to the topic of developing secure programs. If you want to learn how to set up a firewall, lock down a single host, or build a virtual private network, there are other resources to which to turn outside this book. Because most security books are intended to address the pressing concerns of network-level security practitioners, they tend to focus on how to promote secrecy and how to protect networked resources in a world in which software is chronically broken. Unfortunately, many security practitioners have gotten used to a world in which having security problems in software is common, and even acceptable. Some people even assume that it is too hard to get developers to build secure software, so they don't raise the issue. Instead, they focus their efforts on "best-practice" network security solutions, erecting firewalls, and trying to detect intrusions and patch known security problems in a timely manner. We are optimistic that the problem of bad software security can be addressed. The truth is, writing programs that have no security flaws in them is difficult. However, we assert that writing a "secure-enough" program is much easier than writing a completely bug-free program. Should people give up on removing bugs from software just because it's essentially impossible to eliminate them all? Of course not. By the same token, people shouldn't just automatically throw in the software security towel before they even understand the problem. A little bit of education can go a long way. One of the biggest reasons why so many products have security problems is that many technologists involved in the development process have never learned very much about how to produce secure code. One problem is that until now there have been very few places to turn for good information. A goal of this book is to close the educational gap and to arm software practitioners with the basic techniques necessary to write secure programs. This said, you should not expect to eradicate all security problems in your software simply by reading this book. Claiming that this book provides a silver bullet for security would ignore the realities of how difficult it is to secure computer software. We don't ignore reality--we embrace it, by treating software security as a risk management problem. In the real world, your software will likely never be totally secure. First of all, there is no such thing as 100% security. Most software has security risks that can be exploited. It's a matter of how much money and effort are required to break the system in question. Even if your software is bug free and your servers are protected by firewalls, someone who wants to target you may get an insider to attack you. Or they may perform a "black bag" (break-in) operation. Because security is complicated and is a system-wide property, we not only provide general principles for secure software design, but we also focus on the most common risks, and how to mitigate them. Organization This book is divided into two parts. The first part focuses on the things you should know about software security before you even think about producing code. We focus on how to integrate security into your software engineering practice. Emphasis is placed on methodologies and principles that reduce security risk by getting started early in the development life cycle. Designing security into a system from the beginning is much easier and orders of magnitude cheaper than retrofitting a system for security later. Not only do we focus on requirements and design, we also provide significant emphasis on analyzing the security of a system, which we believe to be a critical skill. The first part of this book should be of general interest to anyone involved in software development at any level, from business-level leadership to developers in the trenches. In the second part, we get our hands dirty with implementation-level issues. Even with a solid architecture, there is plenty of room for security problems to be introduced at development time. We show developers in gory detail how to recognize and to avoid common implementation-level problems such as buffer overflows and race conditions. The second part of the book is intended for those who feel comfortable around code. We purposely cover material that we believe to be of general applicability. That is, unless a topic is security critical, we try to stay away from anything that is dependent on a particular operating system or programming language. For example, we do not discuss POSIX "capabilities" because they are not widely implemented. However, we devote an entire chapter to buffer overflows because they are a problem of extraordinary magnitude, even though a majority of buffer overflows are specific to C and C++. Because our focus is on technologies that are applicable at the broadest levels, there are plenty of worthy technologies that we do not cover, including Kerberos, PAM (pluggable authentication modules), and mobile code sandboxing, to name a few. Many of these technologies merit their own books (although not all of them are adequately covered today). This book's companion Web site, http://www.buildingsecuresoftware.com/, provides links to information sources covering interesting security technologies that we left out. Code Examples Although we cover material that is largely language independent, most of our examples are written in C, mainly because it is so widely used, but also because it is harder to get things right in C than in other languages. Porting our example code to other programming languages is often a matter of finding the right calls or constructs for the target programming language. However, we do include occasional code examples in Python, Java, and Perl, generally in situations in which those languages are significantly different from C. All of the code in this book is available at http://www.buildingsecuresoftware.com/ . There is a large UNIX bias to this book even though we tried to stick to operating system-independent principles. We admit that our coverage of specifics for other operating systems, particularly Windows, leaves something to be desired. Although Windows NT is loosely POSIX compliant, in reality Windows programmers tend not to use the POSIX application programming interface (API). For instance, we hear that most Windows programmers do not use the standard C string library, in favor of Unicode string-handling routines. As of this writing, we still don't know which common functions in the Windows API are susceptible to buffer overflow calls, so we can't provide a comprehensive list. If someone creates such a list in the future, we will gladly post it on the book's Web site. The code we provide in this book has all been tested on a machine running stock Red Hat 6.2. Most of it has been tested on an OpenBSD machine as well. However, we provide the code on an "as-is" basis. We try to make sure that the versions of the code posted on the Web site are as portable as possible; but be forewarned, our available resources for ensuring portability are low. We may not have time to help people who can't get code to compile on a particular architecture, but we will be very receptive to readers who send in patches. Contacting Us We welcome electronic mail from anyone with comments, bug fixes, or other suggestions. Please contact us through http://www.buildingsecuresoftware.com . 020172152XP09242001 Excerpted from Building Secure Software: How to Avoid Security Problems the Right Way by John Viega, Gary McGraw All rights reserved by the original copyright owners. Excerpts are provided for display purposes only and may not be reproduced, reprinted or distributed without the written permission of the publisher.

Author notes provided by Syndetics

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.



Powered by Koha