Você está na página 1de 5

Building Security In

Editor: Gary McGraw, gem@cigital.com

Bridging the Gap between


Software Development
and Information Security

T
raditionally, software development efforts in large
particular, incident handlers and
corporations have been about as far removed from vulnerability/patch specialists
have spent years responding to at-
information security as they were from human re- tacks against real systems and
thinking about the vulnerabilities
sources or any other business function. Software de- that spawned them. In many cases,
theyve studied software vulnerabili-
velopment has also had the tendency to be highly distributed ties and their resulting attack profiles
in minute detail. However, few in-
among business units and thus not Dont stand formation security professionals are
KENNETH R. even practiced in a cohesive, coher- so close to me software developers (at least, on a
VAN WYK ent manner. In the worst cases, busy Best practices in software security in- full-time basis), and their solution
Cigital and business unit executives trade roving clude a manageable number of sim- sets tend to be limited to reactive
KRVW bands of developers like Pokmon ple activities that should be applied techniques such as installing software
Associates cards in a fifth-grade classroom (in an throughout any software develop- patches, shoring up firewalls, updat-
attempt to get ahead). Suffice it to ment process (see Figure 1). These ing intrusion detection signature
GARY say, none of this is good. lightweight activities should start at databases, and the like. Its very rare
MCG RAW The disconnect between secu- the earliest stages of software devel- to find information security profes-
Cigital rity and development has ultimately opment and then continue through- sionals directly involved in major
produced software development ef- out the development process and software development projects.
forts that lack any sort of contem- into deployment and operations. Sadly, these two communities of
porary understanding of technical Although an increasing number highly skilled technology experts
security risks. Todays complex and of software shops and individual de- exist in near complete isolation, yet
highly connected computing envi- velopers are adopting the software their knowledge and experience
ronments trigger myriad security security touchpoints we describe bases are largely complementary.
concerns, so by blowing off the idea here as their own, they often lack the Finding avenues for interdisciplinary
of security entirely, software requisite security domain knowl- cooperation will likely bear fruit in
builders virtually guarantee that edge required to do so. This critical the form of fielded software thats bet-
their creations will have way too knowledge arises from years of ob- ter equipped to resist well-known and
many security weaknesses that serving system intrusions, dealing easily predicted attacks. A secondary
couldand shouldhave been with malicious hackers, suffering the benefit of any interdisciplinary coop-
avoided. This article presents some consequences of software vulnera- eration is gaining information secu-
recommendations for solving this bilities, and so on. Put in this posi- rity personnel with a much better
problem. Our approach is born out tion, even the best-intended understanding of the applications that
of experience in two diverse fields: development efforts can fail to take theyre tasked with protecting.
software security and information into account real-world attacks pre-
security. Central among our rec- viously observed on similar applica- Every silver linings
ommendations is the notion of tion architectures. Although recent got a touch of gray
using the knowledge inherent in in- books1,2 are starting to turn this A complete description of every
formation security organizations to knowledge gap around, the science software security best practice is far
enhance secure software develop- of attack is a novel one. beyond this articles scope, but we
ment efforts. Information security staffin can provide a high-level description

64 PUBLISHED BY THE IEEE COMPUTER SOCIETY 1540-7993/05/$20.00 2005 IEEE IEEE SECURITY & PRIVACY
Building Security In

of the most effective software secu- Security External Code Penetration


rity touchpoints available today. requirements review review testing
(tools)
Abuse Risk Risk-based Risk
Requirements: cases analysis analysis Security
security tests
Abuse cases operations
The concept of abuse case develop-
ment is derived from use case devel-
opment. In an abuse case, the
developer considers softwares delib- Requirements Design Test Code Test Field
and use cases plans results feedback
erate misuse and ponders its corre-
sponding effect. When addressing
user input, for example, the devel- Figure 1. Software security best practices or touchpoints. Although the software
oper can construct a series of abuse artifacts are laid out according to a traditional waterfall model, most organizations
cases that describes in some detail follow an iterative approach today: best practices are cycled through more than once
how malicious users can and will at- as the software evolves.
tempt to overflow input buffers, in-
sert malicious data, and so on. An
abuse case depicts these scenarios as analyses against a designs individual about exploiting a weakness and
well as how the software should re- subcomponents as well as to the de- compromising the software. Such
spond to them. As with their use case sign as a whole. Attention to securitys descriptions can help generate a
counterparts, each abuse case then holistic aspects is paramount: at least priority-based list of test scenarios
drives a requirement and correspond- 50 percent of all security defects are for later adversarial testing.
ing test scenario for the software. architectural in nature.
Implementation:
Design: Business Test planning: Security Code review
risk analysis functionality testing The design-centric activities de-
Assessing the business impact likely Just as testers typically use functional scribed thus far focus on architec-
to result from a successful software specifications and requirements to tural flaws built into software design,
compromise is a critical undertak- create test scenarios and test plans but they completely overlook im-
ing. If no one explicitly tackles this (especially those testers who under- plementation bugs that the coders
issue, a security analysis will fall short stand the critical notion of require- might introduce during coding. Im-
in the who cares? department. A ments traceability), security-specific plementation bugs are both numer-
good risk analysis considers ques- functionality should be used to de- ous and common (just like real bugs
tions of the projects cost to the par- rive tests against the target softwares in the Virginia countryside) and can
ent organization sponsoring the security functions. These kinds of include nasty creatures such as the
software in terms of both direct cost investigations generally include tests notorious buffer overflow, which
(liability, lost productivity, and re- that verify security features such as owes its existence to the use (or mis-
work) and indirect cost (reputation encryption, user identification, log- use) of vulnerable APIs. Code re-
and brand damage). ging, confidentiality, authentication, view processesboth manual and
and so on. These are positive se- (even more important) automated
Design: curity features for white hats. with a static analysis toolattempt
Architectural risk analysis to identify security bugs prior to the
Similar to a business risk analysis, an Test planning: softwares release.
architectural risk analysis assesses the Risk-driven testing
technical security exposures in an ap- Thinking like a good guy isnt System testing:
plications proposed design and links enough: you have to don your Penetration testing
them to business impact. Starting black hat and think like a bad guy. System penetration testing, when
with a high-level depiction of the de- Risk-based test scenarios are the used appropriately, focuses on
sign, the analysis team considers each natural result of the process of as- human and procedural failures made
module, interface, interaction, and so sessing and prioritizing softwares during the softwares configuration
forth against known attack method- architectural risks. Each architec- and deployment. The best kinds of
ologies and their likelihood of suc- tural risk and abuse case considered penetration testing are driven by
cess. To provide a forest-level view of should be described and docu- previously identified risks and are
a software systems security posture, mented down to a level that clearly engineered to probe risks directly to
the analysts typically apply such explains how an attacker might go ascertain their exploitability.

www.computer.org/security/ IEEE SECURITY & PRIVACY 65


Building Security In

Fielded system: these exercises involves carefully and these questions comes from their
Deployment thoroughly considering similar sys- wealth of experience in seeing secu-
and operations tems and the successful attacks rity impacts first-hand when similar
Careful configuration and cus- against them. Getting past your own business applications were compro-
tomization of any software applica- belly button is especially important mised. It gives them the opportu-
tions deployment environment can to abuse case success, so consider nity to knowledgeably answer
greatly enhance its security posture. other domains that could be relevant several other security-related ques-
Designing a smartly tailored deploy- to the application under review tions: What sorts of costs have simi-
ment environment for a program re- while youre at it. Once again, real lar companies incurred from
quires following a process that starts at battle experience is critical. Infor- attacks? How much downtime was
the network-component level, pro- mation security people are likely to involved? What was the resulting
ceeds through the operating system, find (much to their amusement) that publicity in each case? In what ways
and ends with the applications own the software developers in the room was the organizations reputation
security configuration and setup. are blissfully unaware of many of the tarnished? Information security
attack forms found daily beyond the people can provide input and flesh
Kumbaya (for network perimeter. Of course, out a conversation with relevant sto-
software security) many of the uninformed are also ries. Here again, take care to not
With the software security touch- naturally skeptical unbelievers. overstate the facts. When citing in-
points weve just listed in mind, lets While converting these skeptics, try cidents at other organizations, be
turn to the issue at hand: how infor- to avoid succumbing to the ten- prepared to back up your claims
mation security professionals can best dency toward hyperbole and exag- with news reports and other third-
participate in the software develop- geration that is unfortunately party documentation.
ment process. If youre a CISSP, an common among security types.
operational security professional, or a Theres nothing worse than a blus- Architectural risk analysis
network administrator, this Buds for tery security weenie on his high Now were getting to the technical
you. Lets go back through the activ- horse about some minor skirmish. heart of the software development
ities we just covered and give some Dont overstate the attacks youve process. For architectural risk analy-
recommendations relevant to both seen and studied, just stick to the sis to be effective, security analysts
software developers and information facts and be prepared to back up must possess a great deal of technol-
security practitioners. your statements with actual exam- ogy knowledge covering both the
ples. Knowledge of actual software application and its underlying plat-
Abuse cases technology a plus. form, frameworks, languages, func-
Folding information security into tions, libraries, and so on. The most
abuse case development is such low- Business risk analysis effective information security team
hanging fruit that the fruit itself is The most important people to con- member in this situation is clearly
dirt-splattered from the latest thun- sult when assessing software-in- one who is a technology expert with
derstorm. Simply put, information duced business risks are the business solid experience around particular
security professionals come to the stakeholders behind the software. In software tools. With this kind of
table with the (rather unfortunate) organizations that already practice knowledge under his or her belt, the
benefit of having watched and dis- business-level technology analysis, information security professional
sected years of attack data, built this tends to be quite well under- can provide real-world feedback
forensics tools,3 created profiles of stood. (Unfortunately, technological into the process. If the analysis team
attackers, and so on. This might assessment of the business situation is discussing a particular network en-
make them jaded and surly, but at stops well before the software level in cryption protocols relative strengths
least they intimately know what most of these organizations.) En- and weaknesses, for example, infor-
theyre up against. hancing a standard approach is easy mation security can provide per-
Many abuse case analysis efforts with a few additional questions: spective to the conversation. All
begin with brainstorming or white What do the people asking for this software has potential weaknesses,
boarding sessions during which the software think about security? What but was component X involved in
development team describes an ap- do they expect? What are they try- any actual attacks? Are there known
plications use cases and functional ing to accomplish that a successful vulnerabilities in the protocol the
requirements while a room full of attack might thwart? What worries project is planning to use? Is a com-
experts pontificate about how an at- them about security? mercial off-the-shelf component or
tacker might attempt to abuse the The value information security platform a popular attacker target?
system. Properly participating in professionals bring to answering Or does it have a stellar reputation

66 IEEE SECURITY & PRIVACY SEPTEMBER/OCTOBER 2005


Building Security In

and only a handful of properly han- code-level vulnerability resolution, tion testing. Software security is
dled published vulnerabilities and there is no natural fit for network se- much more interested in the latter.
known attacks? Feedback of this sort curity expertise during the code re- Also worth noting is the use of
is extremely useful for prioritizing view phase. This might come as a various black-box penetration tools.
risk and weaknesses as well as for de- great surprise to those organizations Network security scanners such as
ciding on what, if any, mitigation currently attempting to impose soft- nessus, nmap, SATAN, and the like
strategies to pursue. ware security on their enterprise are extremely useful because of the
through the information security di- countless ways in which to config-
Test planning vision. Although the idea of security ure (and misconfigure) complex
Although test planning and execu- enforcement is solid, making en- networks and their various services.
tion are generally performed by qual- forcement at the code level success- Application security scanners are
ity assurance (QA) and development ful when it comes to code review nowhere near as useful, so if by an
groups, testing represents another op- requires real hands-on experience application penetration test you
portunity for information security to with code. Its definitely not suffi- mean running an application secu-
have a positive impact. Testinges- cient to arm the information secu- rity testing tool and gathering the re-
pecially risk-based testingmust not rity team with a static code scanner sults, you have a long way to go to
only cover functionality, it should and expect them to deliver substan- make your approach hold water. It
closely emulate the steps that an at- tive feedback to the coders. goes almost without saying that soft-
tacker will take when breaking a tar- ware testing isnt something that a set
get system. Highly realistic scenarios Penetration testing of canned tests can handle, no matter
(the security analog to real user sce- Although testing software to a func- how large the can. The idea of test-
narios) are much more useful than ar- tional specification has traditionally ing any arbitrary program with, say, a
bitrary pretend attacks. been QAs domain, penetration test- few thousand tests determined in
Standard-issue testing organizations, ing is usually the domain of informa- advance before the software was
if theyre effective at all, are most ef- tion security and incident-handling even conceived is ridiculous. The
fective at designing and performing organizations. As such, the fit here idea of testing any arbitrary program
tests based on functional specifica- for information security participa- with a few hundred application se-
tions. Designing risk-based test sce- tion is very natural and intuitive. Of curity tests is just as silly.
narios is a rather substantial departure course, several subtleties cant be ig- The good news about penetra-
from the status quo and should bene- nored. Most penetration testing tion testing and information security
fit from the experience base of secu- today focuses its attention on net- involvement is that its most likely al-
rity incident handlers. In this case, work topology, firewall placement, ready underway. The bad news is
information security professionals communications protocols, and the that information security must up its
who are good at thinking like a bad like, thus its an outsidein ap- level of software clue to most effec-
guy are the most valuable resources. proach that barely begins to scratch tively perform penetration testing.
an applications surface. Penetration
Code review testing must encompass a more in- Deployment
By its very nature, code review re- sideout approach that takes into and operations
quires knowledge of code. An infor- account risk analyses and other soft- Many software developers would
mation security practitioner with ware security results as its per- argue that deployment and opera-
little experience writing and com-
piling software is of little use during a
code review. If you dont know what
it means for a variable to be declared Software developers and information security
in a header or an argument to a
method to be static/final, staring at staff can benefit greatly from the respective
lines of code all day isnt going to
help. Because of this, the code re- experiences of the other.
view step is best left in the hands of
the development organization, es-
pecially if its armed with a modern
source-code analysis tool. With the formed. This distinction is tions arent even part of the soft-
exception of information security sometimes described as the differ- ware development process. Even if
people who are highly experienced ence between network penetration this view is correct, we cant prop-
in programming languages and testing and application penetra- erly address operations and deploy-

www.computer.org/security/ IEEE SECURITY & PRIVACY 67


Building Security In

ment concerns if the software is so weenie. To fix this problem, the first the best practice iceberg, but the
poorly constructed that it falls apart step for any of you information se- good news is that these best prac-
no matter what kind of solid curity professionals who want to tices are emerging at all. Naturally,
ground we place it on. Put bluntly, help out with development efforts the software security discipline will
operations organizations have put should be to reach out to the devel- evolve and change with time, and
up with some rather stinky soft- opers, roll up your sleeves, and offer best practices and advice will ebb
ware for a long time, which has to assist. and flow like the tides at the beach,
made them wary. If we can set that Once youve made the develop- but the advice here is likely to bear
argument aside for a moment and ers aware of your willingness to help, fruit for some time.
look at the broader picturethat consider taking small steps toward The recommendations in this ar-
is, safely setting up the application the goals laid out in this article. ticle are based on years of experience
in a secure operational environ- Rather than trying to become in- with a large dose of intuition thrown
ment and running it accordingly volved in every phase all at once in a in for good measure. Weve pre-
then the work that needs doing can giant world-changing endeavor, try sented them in the hopes that others
certainly be positively affected by one at a time. Be careful not to over- will take them, consider them, adjust
information security. The best op- whelm the overall system by at- them, and attempt to apply them in
portunities exist in fine-tuning ac- tempting to make too many changes their organizations. We believe that
cess controls at the network and at once. software developers and information
operating system levels, as well as in Another positive step is for the security staff can benefit greatly from
configuring an event-logging and information security troops to take the respective experiences of the
monitoring mechanism thats most the time to learn as much as they can other, but much work will need to
effective during incident response about software development in gen- be done before the practical recom-
operations. Attacks will happen, so eral and their organizations software mendations made here prove them-
be prepared to clean up the mess af- development environment in partic- selves to be as useful in practice as we
terwards. This advice is pretty ular. Study and learn about the types believe they will be.
much a no duh for information of applications your software people
security organizations, which is develop, why theyre doing it (that is, References
why their involvement in this step for what business purpose the soft- 1. G. Hogland and G. McGraw,
is so important. ware is being built), what languages, Exploiting Software: How to Break
platforms, frameworks, and libraries Code, Addison-Wesley, 2004.
Come together are being used, and so on. Showing 2. J. Koziol et al., The Shellcoders
(right now) up with a clue is much better than Handbook: Discovering and Exploit-
Even if you accept our recommen- showing up willing but clueless. ing Security Holes, John Wiley &
dations wholesale as worthy, the act Software people arent the most pa- Sons, 2004.
of aligning information security and tient people on the planet, and you 3. D.Farmer and W. Venema, Forensic
software development is a serious often have only one shot at getting Discovery, Addison-Wesley, 2004.
undertaking (and not one for the involved. If you help, thats great, but
faint of heart). Close cooperation if you hinder, itll be the last time Kenneth R. van Wyk is a principal con-
with the development organization they talk to you. sultant at KRvW Associates and director
is essential to success. If developers In the end, success or failure is as of research at Cigital. His interests include
software security and incident-handling.
perceive information security peo- likely to be driven by the personali- Van Wyk has a BS in mechanical engi-
ple to be the security police or ties of the people involved as any- neering from Lehigh University. Contact
those people with sticks who show thing else. Success will certainly not him at ken@krvw.com.
up every once in a while and beat us be guaranteed, even with the best of
soundly for reasons we dont under- intentions and the most careful plan- Gary McGraw is chief technology officer
of Cigital. His real-world experience is
stand, you have a problem that must ning. Beer helps. grounded in years of consulting with
be addressed. major corporations and software pro-
In many cases, developers are ducers. McGraw is the coauthor of
more than willing to accept guid- Exploiting Software (Addison-Wesley,
ance and advice from information
security people who know what
T he interesting thing about soft-
ware security is that it appears to
be in the earliest stages of develop-
2004), Building Secure Software (Addi-
son- Wesley, 2001), Java Security (John
Wiley & Sons, 1996), and four other
theyre talking about. One problem ment, much as the field of informa- books. He has a BA in philosophy from
the University of Virginia and a dual PhD
is that they dont know who to talk tion security itself was 10 or so years
in computer science and cognitive science
to, who might help them, and who ago. The security activities de- from Indiana University. Contact him at
might just be a blowhard security scribed here discuss only the tip of gem@cigital.com.

68 IEEE SECURITY & PRIVACY SEPTEMBER/OCTOBER 2005

Você também pode gostar