Secure Programming with Static Analysis 0321424778, 9780321424778

To secure complex enterprise and commercial software systems, developers must evaluate enormous code bases and predict t

394 96 4MB

English Pages 619 Year 2007

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Secure programming with static analysis......Page 1
Contents......Page 10
Part I: Software Security and Static Analysis......Page 32
1 The Software Security Problem......Page 34
1.1 Defensive Programming Is Not Enough......Page 35
1.2 Security Features != Secure Features......Page 37
1.3 The Quality Fallacy......Page 40
1.4 Static Analysis in the Big Picture......Page 42
1.5 Classifying Vulnerabilities......Page 45
1.6 Summary......Page 50
2 Introduction to Static Analysis......Page 52
2.1 Capabilities and Limitations of Static Analysis......Page 53
2.2 Solving Problems with Static Analysis......Page 55
2.3 A Little Theory, a Little Reality......Page 66
Summary......Page 76
3 Static Analysis as Part of the Code Review Process......Page 78
3.1 Performing a Code Review......Page 79
3.2 Adding Security Review to an Existing Development Process......Page 87
3.3 Static Analysis Metrics......Page 93
Summary......Page 100
4 Static Analysis Internals......Page 102
4.1 Building a Model......Page 103
4.2 Analysis Algorithms......Page 114
4.3 Rules......Page 127
4.4 Reporting Results......Page 136
Summary......Page 144
Part II: Pervasive Problems......Page 146
5 Handling Input......Page 148
5.1 What to Validate......Page 150
5.2 How to Validate......Page 163
5.3 Preventing Metacharacter Vulnerabilities......Page 191
Summary......Page 203
6 Buffer Overflow......Page 206
6.1 Introduction to Buffer Overflow......Page 207
6.2 Strings......Page 220
Summary......Page 264
7 Bride of Buffer Overflow......Page 266
7.1 Integers......Page 267
7.2 Runtime Protection......Page 282
Summary......Page 294
8 Errors and Exceptions......Page 296
8.1 Handling Errors with Return Codes......Page 297
8.2 Managing Exceptions......Page 302
8.3 Preventing Resource Leaks......Page 309
8.4 Logging and Debugging......Page 317
Summary......Page 325
Part III: Features and Flavors......Page 326
9 Web Applications......Page 328
9.1 Input and Output Validation for the Web......Page 329
9.2 HTTP Considerations......Page 350
9.3 Maintaining Session State......Page 359
9.4 Using the Struts Framework for Input Validation......Page 367
Summary......Page 377
10 XML and Web Services......Page 380
10.1 Working with XML......Page 381
10.2 Using Web Services......Page 397
Summary......Page 407
11 Privacy and Secrets......Page 410
11.1 Privacy and Regulation......Page 411
11.2 Outbound Passwords......Page 419
11.3 Random Numbers......Page 428
11.4 Cryptography......Page 438
11.5 Secrets in Memory......Page 443
Summary......Page 451
12 Privileged Programs......Page 452
12.1 Implications of Privilege......Page 454
12.2 Managing Privilege......Page 458
12.3 Privilege Escalation Attacks......Page 470
Summary......Page 485
Part IV: Static Analysis in Practice......Page 488
13 Source Code Analysis Exercises for Java......Page 490
Exercise 13.0 Installation......Page 491
Exercise 13.1 Begin with the End in Mind......Page 492
Exercise 13.2 Auditing Source Code Manually......Page 500
Exercise 13.3 Running Fortify SCA......Page 502
Exercise 13.4 Understanding Raw Analysis Results......Page 503
Exercise 13.5 Analyzing a Full Application......Page 509
Exercise 13.6 Tuning Results with Audit Workbench......Page 510
Exercise 13.7 Auditing One Issue......Page 514
Exercise 13.8 Performing a Complete Audit......Page 518
Exercise 13.9 Writing Custom Rules......Page 522
Answers to Questions in Exercise 13.2......Page 530
14 Source Code Analysis Exercises for C......Page 534
Exercise 14.0 Installation......Page 535
Exercise 14.1 Begin with the End in Mind......Page 536
Exercise 14.2 Auditing Source Code Manually......Page 544
Exercise 14.3 Running Fortify SCA......Page 545
Exercise 14.4 Understanding Raw Analysis Results......Page 546
Exercise 14.5 Analyzing a Full Application......Page 551
Exercise 14.6 Tuning Results with Audit Workbench......Page 552
Exercise 14.7 Auditing One Issue......Page 556
Exercise 14.8 Performing a Complete Audit......Page 560
Exercise 14.9 Writing Custom Rules......Page 562
Answers to Questions in Exercise 14.2......Page 568
Epilogue......Page 572
References......Page 576
A......Page 590
C......Page 593
D......Page 596
E......Page 597
F......Page 599
H......Page 600
I......Page 601
J......Page 602
L......Page 603
M......Page 604
N......Page 605
P......Page 606
R......Page 609
S......Page 611
U......Page 615
V......Page 616
W......Page 617
Z......Page 618

Secure Programming with Static Analysis
 0321424778, 9780321424778

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up