< Day Day Up > |
Item 57: Security is a process, not a product"If you think technology can solve your security problems, then you don't understand the problems and you don't understand the technology" [Schneier01, xii]. To the casual eye cruising the Internet, the various trade press publications, or the various security vendor Web sites, security would seem a kind of postdevelopment add-in that we can sprinkle all over an application to render it suddenly "secure," immune to attack and safe from harm. Just buy a product, make a few API calls, and voilà! Instant secure application, and it took only a few minutes to put it in. What could be better? Developers look at cryptography in much the same way. All we have to do to make the application secure is encrypt the data somehow, relying on the mathematics of the cryptographic algorithm to prevent the data from being viewed by unfriendly eyes. Bruce Schneier himself even subscribed to this view when he wrote, "It is insufficient to protect ourselves with laws; we need to protect ourselves with mathematics" [Schneier95, xx]. Unfortunately, this attitude is exactly the wrong way to think about security. The various vendor products across the Internet cannot make your application secure. No one security technology will protect your application from all harm, not even Transport Layer Security (TLS), also known as the Secure Sockets Layer (SSL). The problem is simple: developers wrap themselves in the belief that "cryptography equals security" and that if the crypto key is strong enough, the system will be secure. Unfortunately, it's a horrible fallacy and one that Schneier himself admits to in the Preface to Secrets and Lies:
This is not a confidence-inspiring editorial. If the one man who arguably knows most about cryptography in the Internet era suddenly feels that cryptography isn't the solution, then how, exactly, are enterprise developers who haven't the time to learn cryptography to the depths that Schneier knows it supposed to make our systems secure? The problem isn't in the use of cryptography itself; the problem is in the belief that most developers have that cryptography holds the solution to all of our security needs. Consider the canonical e-commerce Internet application: a new company, seeking to peddle its wares across the Internet, creates the onlisne shopping site e-socks.com, the World's Premier Internet Retailer of Soft Fluffy Footwear. As developers, we build the site to provide all the classic e-commerce functions: shopping cart, customer checkout, and so on. And, in typical fashion, to allay customers who fear sending their credit card numbers over the Internet,[1] we take their credit card information over an HTTPS connection. So we're secure, right?
Unfortunately, no. While the system may be sending the credit card number in secure format to render it inaccessible to prying eyes, the wily hacker is far from stymied. Any number of ways into the system are possible, some of which are highlighted here.
Other attacks are certainly possible, and I'm sure we've not even scratched the surface of possible attack vectors. Note that none of them involved trying to go directly against the SSL layer itself; instead, they attack other parts of the overall security of the system. Why bother going against SSL and its key exchange protocol when it's far easier for the attacker to engage in one of the dozens of other forms of attack, all of which end with the same result (i.e., your credit card number in his highly immoral fist)? Security is not something that we can simply "turn on" as a feature at some point in the system's implementation lifecycle. Unfortunately, this is exactly the attitude that most development teams and managers take: "Well, sure, the system needs to be secure, but we'll get to that after we get it up and running." While this particular approach and attitude might work for optimizing a system (even then, it's debatable), this will never work when discussing the security of a system as a whole. Concerns about security have to be factored into the analysis, design, implementation, and test phases of every iteration of the system's development, or gaping security holes will result. For example, consider the e-socks.com e-commerce application again. Assuming this is a classic Model-View-Controller application, where do we need to worry about security? What are the security concerns? A partial list includes the following issues.
Subsequent items in this chapter cover many of these concerns in further detail, but all of these issues are meant to serve as background material to support the main title of this item, a phrase Schneier uses over and over again: "Security is a process, not a product." You have to consciously think about this at every stage of the system's development if you're to have any hope of building a system that's remotely attacker-resistant. This requires a shift in your mental model: it requires you to briefly put on the attacker's black hat and think about how you might attack the system and then, putting the white hat back on, what you might do to prevent that attack. And not only the architect or technical lead needs to think about this�everybody, at all levels of the system's implementation, needs to have security in mind. "Write secure code" should be a driving principle of every programmer, just as "write good code" and "write elegant code" are. |
< Day Day Up > |
No comments:
Post a Comment