Security Expert Gary McGraw on Black Hats, the U.S. Government, and Good vs. Evil

Date: Jun 11, 2004 By Seth Fogie, Gary McGraw. Article is provided courtesy of Addison Wesley.
Seth Fogie and Gary McGraw discuss McGraw's latest book, Exploiting Software, black hats, the current security situation in the U.S. government, what a software security specialist needs to know to get started in this industry and whether people are fundamentally good or evil.

Bio

Gary McGraw, Ph.D., CTO of Cigital, Inc. (http://www.cigital.com/, http://www.cigital.com/~gem), researches software security and sets technical vision in the area of software quality management. Dr. McGraw has coauthored five books:

A noted authority on software and application security, Dr. McGraw consults with major software producers and consumers. He has written more than 60 peer-reviewed technical publications and functions as principal investigator on grants from Air Force Research Labs, DARPA, the National Science Foundation, and NIST's Advanced Technology Program. He serves on the advisory boards of Authentica, Counterpane, Fortify Software, and Indigo Security, as well as advising the CS Department at University of California Davis. Dr. McGraw holds a dual Ph.D. in cognitive science and computer science from Indiana University and a BA in philosophy from University of Virginia. He regularly contributes to popular trade publications and is often quoted in national press articles.

Seth: Give us a little background on how you got started in information security.

Gary: I came into computer security through my interest in programming languages. I got my Ph.D. in computer science and cognitive science at Indiana University, where I studied with Doug Hofstadter and wrote the Letter Spirit program. Dan Friedman, another professor at IU, ensured that all IU computer science students were indoctrinated with his excellent thinking about programming languages (with a strong Scheme flavoring). So I was a part-time languages junkie in grad school.

I also had a strong interest in the web, having helped get Hofstadter's lab on the web in late 1993. I recall when Yahoo! was a complete list of all web sites.

I got my Ph.D. and joined Cigital (called Reliable Software Technologies back then) in late 1995 as one of the first few employees. I was slated to work as a research scientist on fault injection for computer security. Java was released in beta form, and I immediately downloaded it and started playing. I was pretty disappointed in Java, actually, since it didn't take advantage of the functional programming paradigm I loved as a languages junkie. The claims about security really intrigued me, though, and I began to ponder how a programming language could possibly be "secure."

I met Ed Felten and his Princeton Ph.D. students Dan Wallach and Drew Dean at IEEE Security & Privacy (Oakland) in 1996. They were presenting a seminal paper on mobile code security. Ed and I hit it off, and we decided to collaborate on a book called Java Security, which we released in August 1996. The book was an instant top seller, and really helped me to get started in computer security.

After writing the second edition (Securing Java) in 1999, I started thinking hard about why such excellent engineers and languages guys like Guy Steele and James Gosling had such a hard time making Java secure. After digging into software security, it was clear that there was a dearth of information on security for people who build stuff (software stuff, that is). So I wrote Building Secure Software with John Viega in 2001. In that book, we described some of the thinking behind Cigital's early software security services. Cigital has been helping customers with software security since 1997.

Exploiting Software and Building Secure Software were mapped out at the same time. You'll notice that each features a cowboy hat on the cover; I refer to them collectively as the "black and white" series. Viega was instrumental in getting the ball rolling with the first one, but the second required a different sort of coauthor—somebody with deep technical experience on the hacker side. Greg Hoglund was a perfect fit.

I'm psyched about the amount of progress we've made in the last few years on software security. When Building Secure Software first came out, the idea that software was the problem was not as obvious as it seems to be now. For the first time, people who build things are getting interested in security (as opposed to general interest being limited to operations people—the usual "go to" guys for corporate security). This bodes well for the future of computer security.

Seth: What do you think the black hat on the cover of Exploiting Software tells someone who picks it up?

Gary: Building Secure Software (the antidote book) has a white cowboy hat, signifying the good guys. Exploiting Software has a black cowboy hat, signifying the bad guys. A cowboy movie just wouldn't be the same without both good guys and bad guys! Plus, malicious hackers are known as "black hats," so there you have it—a nice double entendre.

I'm always very meticulous about covers and cover art for my books and tend to be somewhat more involved than many authors. Java Security had an image of the Holy Grail on the front (plus a hidden message in the subtitle). Securing Java had a broken egg in a nest (poking fun at Sun's Java Security book). Software Fault Injection had a needle (well, Cleopatra's, anyway). My favorite cover has to be that of Exploiting Software. It just looks cool. Hopefully lots of people will buy the book for its cover.

Seth: This book represents one of a very few of a new breed of books that goes into in-depth detail on how to crack software. Since most publishers like to have some type of writing history on which to base their potential profits, what convinced you that Exploiting Software and its sister book were going to sell?

Gary: I really don't worry too much about whether books I write are going to sell well. That said, I've been very fortunate that most of the books I've written (especially the security books) have done extremely well. I think that's because I'm truly passionate about what I'm doing. I feel compelled to get the word out, and get people working on these great hard problems. The passion seems to appeal to people. That's lucky!

Seth: Many of the concepts discussed in this book could be used illegally. With the explicit mention and illustration of several programs (such as Microsoft C++ compiler, hlpctr.exe, I-Planet 6), do you worry about ending up attempting to justify your actions before a court?

Gary: Nope.

Seth: With in-depth coverage of a wide range of material, I'm sure you could say that this book took a lifetime to write. But even with all your knowledge, there's a lot of heavy material in the book. What personal commitment did it take to turn Exploiting Software from an idea into a tangible book?

Gary: Exploiting Software was a long time coming. Greg and I started writing it shortly after Building Secure Software was published in 2001. It took about three and a half years to write. The hardest part was taking the "pile" (as we affectionately called our collection of examples and actual attacks) and organizing it into coherent sets of stuff. The resulting 48 attack patterns should be very helpful to those people charged with security design and analysis.

We did lots of refinement, mungification, building of tools, review, etc. during the process. Addison-Wesley was great about lining up reviewers for us. And they nicely tolerated our sometimes torturous progress. In the end, we came out with a strong book that has lots of depth.

Seth: Why do you think complex books are becoming all the rage? In the last few months, books have pushed the barrier of the security community to the point where many readers will be left scratching their heads after page 10. What's the reason for this complexity?

Gary: The days of very simple security books are coming to an end as the field matures and moves from "comic book stage" to college textbook stage. But hardcore technical books don't have to be unapproachable. I think that my books are readable by any smart person, regardless of his or her personal geek factor.

The thing is, we have to start getting more serious about how things break. Early writings focused too much attention on the easy stuff (script-kiddie level), and didn't really get across what you need to do to defend yourself. Books like Exploiting Software do plenty to jolt us all back into reality about the nature of the security problem. I believe (as do many others) that the only way to build things to defend themselves is to know precisely how they're likely to be attacked.

Seth: What advice would you give to young information-security practitioners who are trying to get a first book published?

Gary: Writing takes practice. I've been writing in a serious way since high school. My undergrad degree is in philosophy, which involved creating boatloads of clear and lucid argumentation in written form. But my main writing influence involved working with Doug Hofstadter (who earned the Pulitzer Prize in 1980 for writing Gödel, Escher, Bach: An Eternal Golden Braid [Basic Books, 1979]). Doug taught me to make my writing sparkle. He follows a regimen of constant refinement, rereading, rewriting, tweaking, etc. in what he calls the "creative feedback loop." Practice, practice, practice. Redo, refine, rewrite.

I guess what you ultimately need to do is find your voice. My best friends say that they can hear me in my books. That's interesting.

Seth: When books have more than one author, each has something to offer to the book, which generally makes the content well-rounded. What would you consider to be your specialty with regard to Exploiting Software?

Gary: Probably writing style, clarity, science, and organization. We both worked extremely hard with this collaboration, and we both did lots of things. Greg wrote most of the code and furnished lots of raw material. I wrote lots of stuff, moved things around radically, promoted and demoted ideas, and so on. By the time the book was finally declared "done," we were both pretty tired of reading it! Now comes the fun part—watching people react to our product. We've been very gratified by the reaction to all our hard work.

Seth: Suppose I have a friend who wants to break into information security (no pun intended). What advice would you give him? Do you need a four-year degree to get in the door? After that, then what?

Gary: I believe that some people are naturally good at breaking systems (and defending them) and others just aren't. It helps to question assumptions and have a healthy skeptical streak. It also helps if you've taken stuff apart your entire life to see how it really works. All that is much more important than a four-year degree!

In any case, good academic computer security programs are few and far between, especially at the undergraduate university level. The state of the practice is such that the formal aspects of education are not as important as the informal aspects. This is likely to change over time, but only slowly.

Now is an excellent time for anyone to get into software security, on either side of the field (building or breaking). The field is young, there's lots to do, and there simply are not enough good software security people to go around. I predict phenomenal growth in this area over the next ten years. My advice to someone who wants to start a new career in information security is to focus on security engineering. We need more builders who understand security. Digest Ross Anderson's excellent book Security Engineering: A Guide to Building Dependable Distributed Systems [John Wiley & Sons, 2001] and go from there.

Seth: How important is hands-on experience when learning information security, and how can those who don't have this experience gain it when they're first learning?

Gary: Absolutely critical. Get a computer and start playing.

End of Part 1. Part 2 of this interview will appear at InformIT next week.

Seth: Your Ph.D. is in cognitive science and computer science. How did this affect your perspective of computer security? How has your education helped—or hindered—your career with regard to computer security? Would you recommend a certain type of education over another (for example, CERTS verse hacker school verses practical experience)?

Gary: I learned to think in undergrad school, and I learned to publish and advance the edge of science in grad school. It's hard to say what my formal education has done for me with regard to security, since my education certainly permeates my way of being. Strangely, though, I've never taken a course in computer security.

More important than education was probably the fact that I got my first computer (an Apple II+ with 48K) in 1981. I was coding the day Santa left the machine, showing dad how to use lores and hires mode. In high school, I was one of those guys that the teachers turned to in order to make stuff work. We had a LAN and a 20MB hard drive in 1983 (fun stuff) at Dobyns-Bennett High. I do recall one time that an admin password was imposed on us (for about a day)...

Back to the topic at hand. CERTS seem to be good for operations people, but not very useful for builders. Builders need to write lots of code and supplement that with software engineering and software testing courseware. Getting an MS or a Ph.D. in computer science will certainly teach you how to build things (one would hope, anyway). If you're interested in software security, become a software guy first and foremost and only then go for the security part.

With regard to experience, there's no substitute for working with other security people for many years. We're stuck in an apprenticeship situation in security these days, though formal education in security has more to offer now than it did ten years ago.

Seth: You've done a lot of research with the U.S. government (including Air Force Research Labs, DARPA, National Science Foundation, and NIST's Advanced Technology Program). Security is obviously a concern of the government. Do you think they're fully aware of software and network security issues? Are they taking appropriate measures to combat these dangers?

Gary: Yes and no. The government is huge. Inside the government there are a host of excellent people working hard on software security issues. There are strong research programs at the NSF, at DARPA, and at the newly-formed SARPA (part of DHS). All in all, the security research community is in okay shape. Things were better four years ago, but that's another story.

On the operations side, many government agencies really need help. Sometimes they're clueless, sometimes they're cash-strapped, and other times nobody seems to be thinking about the security problem. September 11 jolted the government into action on many fronts, but it will take years to see how that all plays out.

I think the commercial world is significantly ahead of the government when it comes to applied software security.

Seth: You recently coauthored "Processes to Produce Security Software" with the National Cyber Security Partnership. This report to the Department of Homeland Security issued preliminary recommendations for improving software security. Was there much debate or disagreement among the committee as to what those recommendations should be?

Gary: The committee was on the large size, but in the end, our part of the report was written by just a few people working like crazy for the last week. Sam Redwine coordinated comments and suggestions. All in all, there was general agreement over the content. We all agree that software security is something critical from a national security perspective. We hope that the best practices that we describe will be widely adopted by software producers everywhere.

Seth: Your recommendations call for process improvement, redesign of flawed systems, and the implementation of security best practices for software design. How do you envision these recommendations taking root and becoming more entrenched in software development policies and procedures? Is seems that you're fighting an uphill battle against developers who are up against too-short deadlines and too-tight budgets.

Gary: I think we've already made tons of progress in software security since the publication of Building Secure Software, and I'm optimistic that there will be more to come. First of all, many more developers and architects understand that they need to think about securing their systems from the get-go. Second, the application of best practices is clearly evolving from simple "outside the software" black-box penetration testing toward "inside the software" source-code review in the tools space. Third, many companies seek out architectural risk analysis help (and have been doing so for years). Market pressures are helping to drive some of this process improvement and best-practice adoption. Simply put, software consumers (think GM here) are demanding better software that's more secure and reliable.

Seth: What's the worst example of sloppy/security-unaware programming you've seen?

Gary: Probably one of the silliest things we saw was a design that called for a "hash algorithm" to be used for integrity purposes where the implementation somehow made use of a hash table. This made us laugh, and it was indicative of the other major problems we found. Ironically, the system was supposed to be a mobile code security system!

Alas, most of the really fun things that we find are "untalkaboutable." But I can assure you that breaking systems remains a blast even after ten years of doing it.

Seth: What's the worst hack you've recovered from?

Gary: Back when I was helping with sysadmin duties in my grad school days, we had somebody turn our FTP server into a warez site for about four hours. We found the hole, plugged it, cleaned out the FTP site, and got back up within a few hours.

Around the same time, we almost got hit by the Morris worm at Indiana. Fortunately, the guys at Purdue spotted the anomaly and called the "red phone" before the worm made it down to us. That one shut down 10% of the Internet at the time.

Lately, my wife's machine at home was zapped by the Welchia worm. Bad on me for not having that machine as well protected then as it is now. Recovering from that was a pain.

Seth: Give us a worst-case scenario for a major breach in software security.

Gary: I'm not sure that counterfactualizing about worst-case scenarios is all that useful in a forum like this.

Seth: Is anything not happening in the industry that you think should be?

Gary: I think there's still an overemphasis on security technology instead of security as an emergent phenomenon. Mike Howard says "software security is not security software," and he is absolutely right about that. I would like more people to become attuned to the idea that security must be designed in and can't be bolted on. Magic crypto fairy dust application won't miraculously cure everything.

Seth: What are your five favorite security books?

Gary: I list my favorite 13 security books on Amazon.com. Briefly, these are my top five:

Security Engineering: A Guide to Building Dependable Distributed Systems (John Wiley & Sons, 2001), by Ross J. Anderson

Exploiting Software: How To Break Code (Addison-Wesley, 2004), by Greg Hoglund and me

Building Secure Software: How To Avoid Security Problems the Right Way (Addison-Wesley, 2001), by John Viega and me

Secrets and Lies: Digital Security in a Networked World (John Wiley & Sons, 2000), by Bruce Schneier

Writing Secure Code, Second Edition (Microsoft Press, 2002), by Mike Howard and David C. LeBlanc

I'm excited by the new breed of more deeply technical security books that are just now coming out. Fun stuff! I'm currently reading The Shellcoders Handbook: Discovering and Exploiting Security Holes (John Wiley & Sons, 2004), by Litchfield et al.

Seth: Who are your mentors?

Gary: My first mentor, back in my University of Virginia days, was Richard Rorty. As an impressionable young scholar, I took a few graduate-level courses from him. He didn't know I thought of him as a mentor, although I told him so several years later when I attended a lecture of his at Indiana! My second mentor was Doug Hofstadter, whose brilliant work continues to serve as an inspiration to many people. Doug was a great advisor in grad school, and I loved working with him.

As I got into security, I developed very close relationships with many people in the community. I consider these people more colleagues than mentors, and there are too many to list here exhaustively, but among my most trusted advisors are Avi Rubin, Ed Felten, Crispin Cowan, Dave Evans, Paul Kocher, Carl Landwehr, Peter Neumann, Jon Pincus, Marcus Ranum, Fred Schneider, and Bruce Schneier. My work would not be the same without their regular input.

Seth: Which conferences look interesting to you? Which ones do you plan to attend?

Gary: I don't attend conferences regularly anymore, but I do poke my head in every few years. Conferences that I like to attend include USENIX Security, IEEE S&P, the Internet Society's NDSS, and the occasional academic workshop. I enjoyed RSA this year for the first time, too.

Seth: If you weren't consulting and writing, what would you be doing?

Gary: I am doing now exactly what I love to do.

Seth: What are your interests outside the industry you work in?

Gary: I'm a musician; I've played the violin since age three. I also play the mandolin and the guitar. I was classically trained (played concertos in high school), but got into improvisation in college. Just for fun, I record original music with my best friend from college, Rhine Singleton, under the name "Where's Aubrey."

I'm also a huge fan of nature and the outdoors. I live on a farm on the banks of the Shenandoah River with my wife and two boys. You can see the Blue Ridge from my bedroom window. We have lots of animals: horse, pony, goats, dogs, cats, rabbits, chickens, and sometimes pigs. We camp and hike when we can, and spend most weekends working outside on our land.

I'm a voracious reader, too. I read everything I can get my hands on, but especially love reading great fiction. I'm currently reading Michael Chabon's The Amazing Adventures of Kavalier and Clay (Random House, 2000), another Pulitzer Prize winner.

Seth: Are people fundamentally good or evil?

Gary: People are complicated, context-sensitive, and unpredictable. That's why life is so interesting.

Seth: What are the most valuable words you want to share with your audience?

Gary: Never forget that this is it—right now. Live your life today like you mean it.