<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Security Advancements at the Monastery &#187; Application</title>
	<atom:link href="http://blog.securitymonks.com/category/application/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.securitymonks.com</link>
	<description>Information about developments at the Monastery</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:41:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Security Sects: Destroying Relational Competence</title>
		<link>http://blog.securitymonks.com/2009/03/21/security-sects-destroying-relational-competence/</link>
		<comments>http://blog.securitymonks.com/2009/03/21/security-sects-destroying-relational-competence/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 04:52:19 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[CISSP]]></category>
		<category><![CDATA[COBIT]]></category>
		<category><![CDATA[Defense in Depth]]></category>
		<category><![CDATA[ISACA]]></category>
		<category><![CDATA[Information Security Governance]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Policies]]></category>
		<category><![CDATA[Relation Competence]]></category>
		<category><![CDATA[Risk]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=932</guid>
		<description><![CDATA[I come bearing no answers, only questions.  This being the SecurityMonks website, I could not allow the article, &#8220;The High Priests of IT — And the Heretics&#8221; to pass without comment.  No heretics or high priests here.  Only a simple security monk.  The author, Cory Doctorow, makes his argument well.  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://augustfallsstudio.com/"><img src="/images/coexist01.png" align="left" width=170  /></a>I come bearing no answers, only questions.  This being the SecurityMonks website, I could not allow the article, &#8220;<a href="http://blogs.harvardbusiness.org/now-new-next/2009/03/the-high-priests-of-it.html">The High Priests of IT — And the Heretics</a>&#8221; to pass without comment.  No heretics or high priests here.  Only a simple security monk.  The author, <a href="http://craphound.com/">Cory Doctorow</a>, makes his argument well.  While I may not agree with Cory on several points, I do find how he frames the discussion most interesting.  Discussion of an issue is often influences by how one frames the problem.  </p>
<p>
What I hope people reading Cory&#8217;s post walk away with is the recognition that sects exist.  We all have various fanatics at each of the organization where we work.  Many are good people <a href="http://www.sacred-texts.com/bud/ami/ami14.htm">earnest and true</a> in their desire to do their jobs well.  Yet, they could not be more different in their solutions to the problems facing their organizations.  They may fall into the high priests or heretics camps, or a dozen other camps.
</p>
<p>
Let us talk about some of the divisions within IT and security.  <a href="http://www.bejtlich.net/">Richard Bejtlich</a> points out in his post, , &#8220;<a href="http://taosecurity.blogspot.com/2009/03/steve-liesman-on-inputs-vs-outputs.html">Steve Liesman on Inputs vs Outputs</a>,&#8221; two camps.  Richard is continuing an argument he previously made in &#8220;<a href="http://taosecurity.blogspot.com/2007/11/controls-are-not-solution-to-our.html">Controls Are Not the Solution to Our Problem</a>.&#8221;  He argues that too much time and resources are being spent on auditing controls that are far too input-centric.  Instead, Richard feels controls should become more output-aware and recommends directing attention away from inputs and devoting more energy to outputs.  Included are some real world examples that management could understand and relate to.  <a href="http://en.wikipedia.org/wiki/Steve_Liesman">Steve Liesman</a> is quoted in relation to our current economic crisis, &#8220;<strong>It&#8217;s not what you&#8217;re doing that matters; it&#8217;s whether or not it works</strong>.&#8221;  Consider the following questions.  Within your security organization, who focuses on controls/inputs and who focuses on output?  How much of a division exist between these groups?  Where do the auditors fit in?
</p>
<p>
To point out other divisions within security, take a look at <a href="http://www.blogger.com/profile/05017778127841311186">Jeremiah Grossman</a> recent post, &#8220;<a href="http://jeremiahgrossman.blogspot.com/2009/03/quick-wins-and-web-application-security.html">Quick Wins and Web Application Security</a>.&#8221;  To quote Jeremiah paraphrasing a recent conversation with <a href="http://www.gartner.com/AnalystBiography?authorId=10326">Joseph Feiman </a>(Gartner):</p>
<blockquote><p>During an event a panel of Gartner Analysts asked the audience what the best way is for organization to invest $1 million dollars in effort to reduce risk. The choices were <strong>Network, Host, or Application security</strong> to which the Gartner analysts made their cases for these three disciplines. The catch was the budget could not be shared between them and must be prioritized into a single initiative. The audience selected Application security. However, the Gartner CSO (who took the role of CIO in the play) overruled the audiences&#8217; decision. They instead selected Network security, while at the same time curiously agreeing that Application security would have been the better path. His rational was that that <strong>it is easier for him to show results to his CEO if he invests in the Network</strong>.</p></blockquote>
<p><a href="http://www.cigital.com/gem/">Gary McGraw</a> was recently interviewed by <a href="http://duckdown.blogspot.com/">James McGovern</a> for the <a href="http://www.cigital.com/silverbullet/show-036/">SilverBullet podcast</a>.  They discuss the recent release of &#8220;Building Security In Maturity Model (<a href="http://www.bsi-mm.com/">BSIMM</a>).&#8221;  In the interview, Gary was asked about the leaders of the enterprises that &#8220;have a clue in making their security posture better.&#8221;  While the leadership that helped develop the BSIMM had very diverse backgrounds, James asked, &#8220;It sounds like they are all from a technical background at some level.  Are there IT executives out there that understand software security that are just business people?&#8221;  Gary responded, &#8220;I don&#8217;t know the answer to that.  I really don&#8217;t know any.  I will say this about these people, they are the sort of <strong>hybrid people that can speak business and also have a very deep technical background</strong>.  As you know those kind of creatures are rare on earth.  Right now it appears that they might be necessary to cause software security initiatives to be a success.  Hopefully, we will gain enough experience and write down enough empirical science that won&#8217;t be the case in the future.&#8221;
 </p>
<p>
It is not a great surprise to learn that a major divide exists between the IT and the business camp.  Recent frameworks often include governance components in an attempt to help bridge the gap between the two camps.  As an example, the IT Governance Institute® (<a href="http://www.itgi.org/">ITGI™</a>) recently released v0.1 of risk based framework based on the principles of enterprise risk management standards/frameworks such as COSO ERM2 and AS/NZS 4360,3.  The framework is called <a href="http://www.isaca.org/Template.cfm?Section=Risk_IT&#038;Template=/TaggedPage/TaggedPageDisplay.cfm&#038;TPLID=79&#038;ContentID=48749"><strong>Risk IT</strong></a>.   ITGI would argue that existing IT risk guidance documents tend to  focus solely on IT security.  Risk IT is meant to cover all aspects of IT risk.  ITGI also develops the Control Objectives for Information and related Technology (<a href="http://www.isaca.org/cobit/">COBIT</a>), which  is focused on &#8220;providing a comprehensive framework for the delivery of information technology-based services.&#8221;  Risk IT and COBIT are meant to compliment each other.  COBIT is a set of good practices which provide the means of risk management; while Risk IT is meant to set good practices for the ends by &#8220;providing a framework for enterprises to identify, govern and manage IT risk.&#8221;  Recall Richard Bejtlich argument concerning the division between the controls/inputs and outputs.
</p>
<p>
All these different sects make effective security most difficult.  A layered approach to security fails to work when the layers operate in isolation.  Gary McGraw gets an &#8220;amen!&#8221; for describing leaders of the enterprises that understand security as a &#8220;sort of hybrid people that can speak business and also have a very deep technical background.  As you know those kind of creatures are rare on earth.&#8221;  On top of having an understanding that reaches into areas throughout the organization, they need to be leaders.
</p>
<p>
<a href="http://resources.bnet.com/topic/rob+goffee.html">Rob Goffee</a> and <a href="http://resources.bnet.com/topic/gareth+jones.html">Gareth Jones</a> wrote an article, &#8220;<a href="http://harvardbusinessonline.hbsp.harvard.edu/b01/en/common/viewFileNavBean.jhtml?_requestid=54299">Leading Clever People</a>.&#8221;  Goffee and Jones will be publishing a book with the same title late in 2009.  An <a href="http://www.london.edu/videoandaudio/leadingcleverpeople.html">audio interview</a> is available from the London Business School.   Goffee and Jones conducted over a 100 interviews with leaders at major organizations and report the relationships effective leaders have with their “clever people” can be shaped by seven shared characteristics:</p>
<ol>
<li><strong>They know their worth</strong>—and they know you have to employ them if you want their tacit skills.</li>
<li>They are organizationally savvy and will seek the company context in which their interests are most <strong>generously funded</strong>.</li>
<li>They <strong>ignore corporate hierarchy</strong>; although intellectual status is important to them, you can’t lure them with promotions.</li>
<li>They expect <strong>instant access to top management</strong>, and if they don’t get it, they may think the organization doesn’t take their work seriously.</li>
<li>They are plugged into highly developed knowledge networks, which both <strong>increases their value</strong> and makes them more of a f<strong>light risk</strong>.</li>
<li>They have a <strong>low boredom threshold</strong>, so you have to keep them challenged and committed.</li>
<li>They <strong>won’t thank you</strong>—even when you’re leading them well.</li>
</ol>
<p>Now you may be thinking, &#8220;I am security, not the CEO of the company.  I am not even their project manager.  Why are you talking about leadership?  What should I care about business?  If users just did what I told them, life would be good.&#8221;   It is important to note that a characteristic not listed above is &#8220;empathy.&#8221;  Folks in your organization are not going to try and see things from security&#8217;s point of view.  They want to do their job and if security appear to be a road block, they will go around.  We need to avoid having each sect doing their own thing.  As what occurs in many religions, an &#8220;us verses them&#8221; attitude will develop.  If you want people to follow, you must first lead.  To lead &#8220;clever people&#8221; you must understand those people.
</p>
<p>
<a href="http://mitleadership.mit.edu/p-parker.php">James Parker</a>, Southwest Airlines ex-CEO, offers some advice.  He has written a fascinating book titled &#8220;<a href="http://www.amazon.com/Right-Thing-Dedicated-Employees-Customers/dp/0132343347">Do the Right Thing</a>.&#8221;  One story particularly interesting concerned a manager who didn&#8217;t succeed despite being very intelligent and ambitious.  &#8220;When this person finally left, I asked one of his former employees why she thought everybody disliked her former boss so much. She summed it up: &#8216;<strong>Because he was the kind of person who kissed up and spit down</strong>.&#8217; &#8221;   When problems arose at American, &#8220;the primary focus of communications was blaming and avoidance of blame – in contrast, <strong>when something went wrong at Southwest, the focus of communications was problem-solving</strong>,&#8221; Parker quotes from the book, &#8220;<a href="http://www.amazon.com/Southwest-Airlines-Jody-Hoffer-Gittell/dp/0071458271/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1237681999&#038;sr=8-1">The Southwest Airlines Way</a>&#8220;.
</p>
<p>
James Parker and <a href="http://mitworld.mit.edu/speaker/view/491">Barbara Stocking</a>, Chief Executive of <a href="http://www.oxfam.org.uk/">Oxfam GB</a>, discuss below &#8220;<a href="http://mitworld.mit.edu/video/315">Leadership in an Age of Uncertainty</a>&#8221; with moderator <a href="http://mitsloan.mit.edu/faculty/detail.php?in_spseqno=1&#038;co_list=F">Deborah G. Ancona</a>.  The discussion focuses on the need for distributed leadership.  A key point made is that companies need &#8220;<strong>employees doing things outside the narrow scope of their job responsibilities, to contribute to the success of overall operations</strong>.&#8221;  This is the cornerstone of the concept of &#8220;<strong>relational competence</strong>.&#8221;
</p>
<p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="481" height="361" id="Main" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://mitworld.mit.edu/flash/player/Main.swf?host=cp58255.edgefcs.net&#038;flv=mitw-00338-sloan-convo-uncertainty-anacona-07oct2005&#038;preview=http://mitworld.mit.edu//uploads/mitwstill-00338-sloan-convo-uncertainty-anacona-07oct2005.jpg" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="http://mitworld.mit.edu/flash/player/Main.swf?host=cp58255.edgefcs.net&#038;flv=mitw-00338-sloan-convo-uncertainty-anacona-07oct2005&#038;preview=http://mitworld.mit.edu//uploads/mitwstill-00338-sloan-convo-uncertainty-anacona-07oct2005.jpg" quality="high" bgcolor="#000000" width="481" height="361" name="Main" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
</p>
<p>
The world continues to get more complicated.  In response, more specialization occurs, which leads to less understanding of other groups.  The history of religions have shown us how difficult things can get when various sects develop.  In the corporate world communication breaks down, the focus on the mission is lost, and the relational competence of a company dissolves.  I started this post with the statement that I come bearing no answers, only questions.  While that is true, I have pointed to some very intelligent people who discuss the various sects and offer possible ways to coexist.  Security professionals cannot exist in their own camp, separate from the rest of the organization, dictating how people should do their jobs.  In such an environment, it will not matter if every pronouncement is the embodiment of wisdom and truth.  Failure is inevitable.  <a href="http://quotationsbook.com/quote/5394/">Abraham Lincoln</a> offered these wise words when he addressed the Washington Temperance Society on February 22, 1842:</p>
<blockquote><p>If you would win a man to your cause, first convince him that you are his sincere friend. Therein is a drop of honey that catches his heart, which, say what you will, is the great high-road to his reason, and which, when once gained, you will find but little trouble in convincing his judgment of the justice of your cause. If indeed that cause really be a just one. </p>
<p>On the contrary, assume to dictate to his judgment, or to command his action, or to mark him as one to be shunned and despised, and he will retreat within himself, close all the avenues to his head and his heart; and though your cause be naked truth itself, transformed to the heaviest lance, harder than steel, and sharper than steel can be made, and though you throw it with more than herculean force and precision, you shall be no more able to pierce him, than to penetrate the hard shell of a tortoise with a rye straw.</p></blockquote>
<p>Amen, brother Abraham.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2009/03/21/security-sects-destroying-relational-competence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing a Web Application Firewall with ModSecurity</title>
		<link>http://blog.securitymonks.com/2008/07/31/implementing-a-web-application-firewall-with-modsecurity/</link>
		<comments>http://blog.securitymonks.com/2008/07/31/implementing-a-web-application-firewall-with-modsecurity/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 04:02:27 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[Defense in Depth]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web Application]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=169</guid>
		<description><![CDATA[There are a few topics I have meant to do a post on for awhile.  Sometimes having too much interest and information on a topic can be a bad thing.  Wanting to pull various postings and articles along with implementation instructions can be a bit time consuming.  Plus, in order to demonstrate [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/modsecurity.gif" alt="ModSecurity Image" align="left"/>There are a few topics I have meant to do a post on for awhile.  Sometimes having too much interest and information on a topic can be a bad thing.  Wanting to pull various postings and articles along with implementation instructions can be a bit time consuming.  Plus, in order to demonstrate why someone might be interested in implementing a web application firewall (<a href="http://www.owasp.org/index.php/Web_Application_Firewall">WAF</a>), I envisioned a post discussing the collapse of the perimeter and addressing points made by the <a href="http://www.opengroup.org/jericho/">Jericho Forum</a> (see the <a href="http://www.securitycatalyst.com/blog/2008/06/security-roundtable-for-june-2008-clarion-call-of-the-jericho-forum/">Security Roundtable</a> podcast for June 2008 for a good discussion on the topic).  <a href="http://raffy.ch/blog/">Raffael Marty</a> makes excellent points in his soon to be released book, &#8220;<a href="http://www.amazon.com/Applied-Security-Visualization-Raffael-Marty/dp/0321510100">Applied Security Visualization</a>&#8220;:</p>
<blockquote><p>The crime landscape is shifting.  Attacks are moving up the network stack.  Network-based attacks are not the prime source of security problems anymore.  The attacks today are moving into the application layer: Web 2.0, instant messenger attacks, fraud, information theft, and crime-ware are just some examples of new types of attacks that generate a load of data to be collected and analyzed.  Beware!  Applications are really chatty and generate alot of data.</p></blockquote>
<p>While my current post is not about security visualization (see earlier post &#8220;<a href="http://blog.securitymonks.com/2007/10/20/security-data-visualization/">Security Data Visualization</a>&#8220;), I would like to point out that <a href="http://davix.secviz.org">DAVIX</a>, a live CD for data analysis and visualization, is expected to be released August 6th.  That should be really cool and fun.</p>
<p>
Since application security is a topic of interest for me, I ran into the problem of having too many topics I wanted to discuss when I started trying to write a post on <a href="http://www.modsecurity.org/">ModSecurity</a>, an open source, free WAF Apache module.  Today, rather than waiting for me to integrate the information, I decided to move ahead and do the post while limiting myself to only pointing out the various sources.  The reader can follow the links for a more in-depth discussion and understanding on the topic.</p>
<h3>Why You Should Care</h3>
<p>The <a href="http://itradio.com.au/security/">Risky Business</a> podcast has come to be one of my favorite podcasts.  The host, <a href="http://itradio.com.au/security/?page_id=2">Patrick Gray</a> and regular guest <a href="http://www.zdnet.com.au/tag/munir_kotadia.htm">Munir Kotadia</a>, just cracks me up.  Plus the show is informative and features great guests.  This week&#8217;s show had an interview with <a href="http://itradio.com.au/security/?p=85">H D Moore talking about the DNS bug</a>.  Timely and informative; what else can one ask for?  The <a href="http://itradio.com.au/security/?p=81">68th episode</a>, done at the beginning of this month, had an interview with <a href="http://jeremiahgrossman.blogspot.com/">Jeremiah Grossman</a> concerning web application firewalls.  As Patrick writes in the show notes, &#8220;<em>it takes typical organizations around <strong>130 days to fix sequel injection bugs</strong> in code.  But you can mitigate these sorts of things with a Web app firewall, and you won’t even have to deal with the development team! Hooray!</em>.&#8221;
</p>
<p>
In Grossman&#8217;s blog post &#8220;<a href="http://jeremiahgrossman.blogspot.com/2008/06/can-wafs-protect-against-business-logic.html">Can WAFs protect against business logic flaws?</a>&#8220;, he pointed out that &#8220;<em>WAFs don&#8217;t defend against every logic flaw, or even every crazy form of SQLi or XSS. Just as white/black box scanners can&#8217;t identify every vulnerability and neither can expert pen-testers or source code auditors</em>.&#8221;  Stuart King, in his article, &#8220;<a href="http://www.computerweekly.com/blogs/stuart_king/2008/07/more-wafs.html">Larry David and Web Application Firewalls</a>&#8220;, builds upon this idea when he wrote:</p>
<blockquote><p>Back to the <a href="http://www.csoonline.com/article/412163/Industry_View_Web_Application_Security_Today_Are_We_All_Insane_/1">CSO article</a> where the point is made that we are sitting on a huge legacy of insecure code and that &#8220;we can&#8217;t rewrite history.&#8221; So, the argument is that a web application firewall mitigates the risk &#8211; note: does not solve the problem &#8211; until the code can be replaced.</p>
<p>How much of the risk is mitigated is open to debate, but there are lots of other things to consider too. For instance the cost of redeveloping code against the cost of purchasing and supporting a WAF. We also need to consider the value and risk profile of the product. </p></blockquote>
<p>Today&#8217;s world consist of attackers adjusting focus from network-based attacks to the application layer.  Grossman in his post &#8220;<a href="http://jeremiahgrossman.blogspot.com/2008/03/website-security-strategies-that-work.html">Website Security Strategies that Work</a>&#8221; makes the claim that &#8220;<em><strong>9 out of 10 (or more) websites have vulnerabilities</strong> as a result of being built by those who didn’t know or appreciate the severity of today’s attacks</em>.&#8221;  There is no arguing that many organizations are sitting on a huge legacy of insecure code, much of which may have been written before the discovery of prevalent vulnerabilities such as <a href="http://ha.ckers.org/xss.html">XSS</a>, <a href="http://ha.ckers.org/sqlinjection/">SQL Injection</a>, <a href="http://ha.ckers.org/blog/20080202/csrf-yup-its-real-folks/">CSRF</a>, etc.  Even worse, organization often have their security groups focused on network or system security, leaving application level security to developers.  Unfortunately, these developers are receiving little or no training, while remaining under pressure to produce code under short deadlines.
</p>
<p>
Andre Gironda series, starting with &#8220;<a href="http://www.tssci-security.com/archives/2008/06/23/week-of-war-on-wafs-day-1-top-ten-reasons-to-wait-on-wafs/">Week of War on WAF’s: Day 1 — Top ten reasons to wait on WAF’s,</a>&#8221; provides important reasons why WAFs should not be viewed as a silver bullet solution.  Rich Mogull in his post &#8220;<a href="http://securosis.com/2008/06/02/web-application-security-we-need-web-application-firewalls-to-work-better/">Web Application Security: We Need Web Application Firewalls To Work. Better</a>&#8221; makes the important point:<br />
<blockquote>With old school vulnerabilities we know the details of the specific vulnerability and (usually) exploit mechanism. With WAFs, we are trying to block vulnerability classes instead of specific vulnerabilities. This is a HUGE difference. The WAF doesn’t know the details of the application or any application-specific vulnerabilities, and thus is much more limited in what it can block.</p></blockquote>
<p>Mogull goes on to state that WAFs can:<br />
<blockquote>no longer be merely external boxes protecting against generic vulnerabilities; they need tighter integration into our applications. In the long term, I’ve branded this Application and Database Monitoring and Protection (<a href="http://securosis.com/2007/12/17/definitions-content-monitoring-and-protection-and-application-and-database-monitoring-and-protection/">ADMP</a>) as we create a dedicated application and database security stack that links from the browser on the front end, to the DB server on the back.</p></blockquote>
<p>ADMPs, or if you prefer WAFs + Database Activity Monitoring (WAFs+DAM),  would be another step in the evolution of WAFs.  As <a href="http://www.ivanristic.com/">Ivan Ristic</a>, creator of ModSecurity, points out in his blog post &#8220;<a href="http://blog.modsecurity.org/2008/05/whats-the-score.html">What&#8217;s the Score of the Game?</a>&#8220;:<br />
<blockquote>I feel that one of areas where organizations are failing, with regards to web application security, is that there is a lack of communication between the following three groups: Development teams (who are running source code reviews), InfoSec teams (who are running vulnerability scans) and Operational Security teams (who are running web application firewalls).  These three teams each have unique perspectives on the vulnerabilities of the webapps and they should share their data with each other.</p></blockquote>
<p>Nicely stated.  No one is arguing that writing secure code is not the answer.  If organization began adapting secure systems development lifecycle (<a href="https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/sdlc/326-BSI.html">SDLC</a>) models into their business operation, many security problems would go away.  Building secure software will require changes in the current development culture, which will include people, processes, and technology.  No small task.
</p>
<p>
Gunnar Peterson has a nice post, &#8220;<a href="http://1raindrop.typepad.com/1_raindrop/2006/09/waf_and_xsg_ris.html">WAF and XSG Risk and Effectiveness at 20,000 feet</a>&#8221; where he discusses modeling of combination of risk and effectiveness to identify areas of focus.  As Peterson <a href="http://1raindrop.typepad.com/1_raindrop/2006/01/defense_in_dept.html">points out in another post</a>, &#8220;<em>WAFs are not as static as network firewalls&#8230;Instead WAFs collaborate much more directly with development, which is another growth opportunity for security industry</em>.&#8221;
</p>
<p>
This post is going to stay focused on WAFs.  With it taking on average 130 days to fix sequel injection bugs, organizations need something they can implement today.  WAFs have an important role to play in adding a layer of security and monitoring to a <a href="https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/347-BSI.html">defense in depth security approach</a>.  WAFs will evolve.  They are in the process of evolving now.  Understanding the fundamental ideas and going through the implementation of an open source solution starts us on the path of better understanding of future technologies.</p>
<h3>An Implementation Using ModSecurity</h3>
<p>Building on previous posts concerning &#8220;<a href="http://blog.securitymonks.com/2008/04/14/an-apache-implementation/">An Apache Implementation</a>&#8220;, &#8220;<a href="http://blog.securitymonks.com/2008/04/21/php-implementation/">PHP Implementation</a>&#8220;, and &#8220;<a href="http://blog.securitymonks.com/2008/04/24/apache-and-openssl/">Apache and OpenSSL</a>&#8220;, we have an Apache web server setup to build upon.  For additional details, please get Ivan Ristic&#8217;s book, &#8220;<a href="http://www.apachesecurity.net/">Apache Security</a>.&#8221;  It really is a must have book for anyone serious about running an Apache web server.   Ristic also maintains the ModSecurity <a href="http://www.modsecurity.org/">website</a> and <a href="http://blog.modsecurity.org/">blog</a>, which serves as a great source for up-to-date information on ModSecurity.
</p>
<p>
The Apache module <a href="http://httpd.apache.org/docs/2.2/mod/mod_unique_id.html">mod_unique_id</a> needs to be installed for  ModSecurity to work properly.  This module was not installed when we configured Apache.  At that time, we did not know we needed it.  While it can be somewhat inconvenient, for security reasons it is best not to install modules not needed.</p>
<h4><strong>1.  Stop Apache Server.</strong></h4>
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# /usr/local/apache/bin/apachectl stop
</pre>
</td>
</table>
<p></p>
<h4><strong>2.  Install mod_unique_id Module.</strong></h4>
<p>For non Mac OS X, do the following:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd /usr/local/src/httpd-2.2.8
/usr/local/src/httpd-2.2.8 root# make clean
/usr/local/src/httpd-2.2.8 root# CC=gcc \
CFLAGS="-O3 -fno-omit-frame-pointer" \
./configure --prefix=/usr/local/apache \
--enable-rewrite \
--enable-so \
--disable-imap \
--disable-userdir --with-mpm=worker --enable-ssl --enable-unique-id --enable-unique-id
/usr/local/src/httpd-2.2.8 root# make
/usr/local/src/httpd-2.2.8 root# make install
</pre>
</td>
</table>
<p> <br />
For Mac OS X, please do:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd /usr/local/src/httpd-2.2.8
/usr/local/src/httpd-2.2.8 root# make clean
/usr/local/src/httpd-2.2.8 root# CC=gcc \
CFLAGS="-O3 -fno-omit-frame-pointer" \
LDFLAGS="-L/opt/local/lib -L/usr/lib" \
./configure --prefix=/usr/local/apache --enable-rewrite \
--enable-so --disable-imap --disable-userdir \
--with-mpm=worker --enable-ssl --enable-unique-id
/usr/local/src/httpd-2.2.8 root# make
/usr/local/src/httpd-2.2.8 root# make install
</pre>
</td>
</table>
<p>   </p>
<h4><strong>3.  Install <a href="http://www.pcre.org/">PCRE</a>.</strong></h4>
<p>Only under Mac OS X did I have to install Perl Compatible Regular Expressions (PCRE).  You may be able to skip this step, depending on your OS.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd /usr/local/src
/usr/local/src root# wget http://downloads.sourceforge.net/pcre/pcre-7.7.tar.gz
/usr/local/src root# tar xzf pcre-7.7.tar.gz
/usr/local/src root# cd pcre-7.7
/usr/local/src/pcre-7.7 root# CC=gcc \
CFLAGS="-O3 -fno-omit-frame-pointer" \
LDFLAGS="-L/opt/local/lib -L/usr/lib" \
./configure
/usr/local/src/pcre-7.7 root# make
/usr/local/src/pcre-7.7 root# make test
/usr/local/src/pcre-7.7 root# make install
</pre>
</td>
</table>
<p>   </p>
<h4><strong>4.  Install the latest version of <a href="http://xmlsoft.org/downloads.html">libxml2</a> or <a href="http://www.lua.org/download.html">Lua</a>.</strong></h4>
<p>To quote wikipedia, <a href="http://en.wikipedia.org/wiki/Libxml2">libxml</a> is &#8220;<em>a library for parsing XML documents</em>&#8221; and <a href="http://en.wikipedia.org/wiki/Lua_(programming_language)">Lua</a> is &#8220;<em>a lightweight, reflective, imperative and procedural programming language, designed as a scripting language with extensible semantics as a primary goal</em>.&#8221; ModSecurity requires dynamic libraries which are not built by default in the source distribution.  Binary distribution is recommended.
</p>
<p>
I will go through configuration and installation of libxml2 from source and the binary installation of lua under Mac OS X.   There is a good chance if you are running a different OS, the libraries will have already been installed. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd  /usr/local/src/
/usr/local/src root# wget ftp://xmlsoft.org/libxml2/libxml2-2.6.32.tar.gz
/usr/local/src root# tar xzf libxml2-2.6.32.tar.gz
/usr/local/src root# cd libxml2-2.6.32
/usr/local/src/cd libxml2-2.6.32 root#  CC=gcc \
CFLAGS="-O3 -fno-omit-frame-pointer" \
LDFLAGS="-L/opt/local/lib -L/usr/lib" \
/usr/local/src/cd libxml2-2.6.32 root# ./configure
/usr/local/src/cd libxml2-2.6.32 root# make
/usr/local/src/cd libxml2-2.6.32 root# make install
/usr/local/src/cd libxml2-2.6.32 root# cd ..
/usr/local/src root# wget http://luaforge.net/frs/download.php/3097/lua5_1_3_Darwin811x86_lib.tar.gz
/usr/local/src root# mkdir lua
/usr/local/src root# cd lua
/usr/local/src/lua root# tar xzf lua5_1_3_Darwin811x86_lib.tar.gz
/usr/local/src/lua root# cp liblua5.1.* /usr/local/lib
/usr/local/src/lua root# cp include/* /usr/local/include
</pre>
</td>
</table>
<p></p>
<h4><strong>5.  Download, unpack, configure, and compile <a href="http://www.modsecurity.org/download/direct.html">ModSecurity</a>.</strong></h4>
<p>If you are interested in connecting a ModSecurity sensor to the central audit log repository, you will want to build the ModSecurity Log Collector below with the command &#8220;make mlogc&#8221;.  Install instructions can be found under apache2/mlogc-src directory.  That step will not be included below.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd  /usr/local/src/
/usr/local/src root# wget http://www.modsecurity.org/download/modsecurity-apache_2.5.5.tar.gz
/usr/local/src root# tar xzf modsecurity-apache_2.5.5.tar.gz
/usr/local/src root# cd modsecurity-apache_2.5.5
/usr/local/src/modsecurity-apache_2.5.5 root# cd apache2
</pre>
</td>
</table>
<p>
For non Mac OS X, configure with the command:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# ./configure \
--with-apxs=/usr/local/apache/bin/apxs \
--with-apr=/usr/local/apache/bin \
--with-apu=/usr/local/apache/bin
</pre>
</td>
</table>
<p>
For Mac OS X, use the command:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# CC=gcc \
CFLAGS="-O3 -fno-omit-frame-pointer" \
LDFLAGS="-L/opt/local/lib -L/usr/lib" \
./configure --with-apxs=/usr/local/apache/bin/apxs
</pre>
</td>
</table>
<p>
Continue to compile and install with the commands:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# make
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# make test
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# make install
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# ls -la /usr/local/apache/modules
</pre>
</td>
</table>
<p></p>
<h4><strong>6.  Configure Apache and ModSecurity.</strong></h4>
<p>We must now edit the httpd.conf file in order to load libxml2 or lua5.1 modules before the ModSecurity module.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# vi /usr/local/apache/conf/httpd.conf
</pre>
</td>
</table>
<p>
Add the lines for non Mac OS X:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
#
LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua5.1.so
#
LoadModule security2_module modules/mod_security2.so
</pre>
</td>
</table>
<p>
For Mac OS X, add the lines:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
#
LoadFile /usr/local/lib/libxml2.2.dylib
LoadFile /usr/local/lib/liblua5.1.so
#
LoadModule security2_module modules/mod_security2.so
</pre>
</td>
</table>
<p>
Create the ModSecurity configuration file.  There is a file modsecurity.conf-minimal present in the /usr/local/src/modsecurity-apache_2.5.5 that can be used.  There is also a a Core Rule Set that was included in the /usr/local/src/modsecurity-apache_2.5.5/rules directory courtesy of Breach Security Inc.  To quote the README file, &#8220;<em>The Core Rule Set provides generic protection from unknown vulnerabilities often found in web application that are in most cases custom coded.  The Core Rule Set is heavily commented to allow it to be used as a step-by-step deployment guide for ModSecurity</em>.&#8221;  Under the rules subdirectory, there a directory &#8220;optional&#8221; which contains additional possible rules.  It is left to the reader which configuration files they may want to include, though it might be wise to start with the minimal and make sure the Apache runs without problems.  Then add configurations files as desired. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5/apache2 root# cd ..
/usr/local/src/modsecurity-apache_2.5.5 root# cp  modsecurity.conf-minimal /usr/local/apache/conf/modsecurity.conf
/usr/local/src/modsecurity-apache_2.5.5 root# cp  rules/*.conf /usr/local/apache/conf/
</pre>
</td>
</table>
<p>
Include the modsecurity.conf, and additional ModSecurity configurations file, in the Apache httpd.conf file.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5 root# vi /usr/local/apache/conf/httpd.conf
</pre>
</td>
</table>
<p>
Add the line:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
Include /usr/local/apache/conf/modsecurity.conf
#Include /usr/local/apache/conf/modsecurity_crs_10_config.conf
#Include /usr/local/apache/conf/modsecurity_crs_21_protocol_anomalies.conf
#Include /usr/local/apache/conf/modsecurity_crs_23_request_limits.conf
#Include /usr/local/apache/conf/modsecurity_crs_30_http_policy.conf
#Include /usr/local/apache/conf/modsecurity_crs_35_bad_robots.conf
#Include /usr/local/apache/conf/modsecurity_crs_40_generic_attacks.conf
#Include /usr/local/apache/conf/modsecurity_crs_45_trojans.conf
#Include /usr/local/apache/conf/modsecurity_crs_50_outbound.conf
</pre>
</td>
</table>
<p>
Edit /usr/local/apache/conf/modsecurity.conf.  The modifications will be very dependent on your environment.  See resources listed in the Additional Information section to help with configuration.  The default configuration saves the log files relative to the configuration file directory.  Change this to where the apache logs are currently being saved. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5 root# vi /usr/local/apache/conf/modsecurity.conf
</pre>
</td>
</table>
<p>
Change the values to:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
SecAuditLog /var/www/logs/modsec_audit.log
SecDebugLog /var/www/logs/modsec_debug.log
</pre>
</td>
</table>
<p>
Let&#8217;s create null files with the correct permissions for Apache.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5 root# touch  /var/www/logs/modsec_audit.log
/usr/local/src/modsecurity-apache_2.5.5 root# chown httpd.httpd /var/www/logs/modsec_audit.log
/usr/local/src/modsecurity-apache_2.5.5 root# touch  /var/www/logs/modsec_debug.log
/usr/local/src/modsecurity-apache_2.5.5 root# chown httpd.httpd /var/www/logs/modsec_debug.log
</pre>
</td>
</table>
<p></p>
<h4><strong>7.  Start Apache.</strong></h4>
<p>Check that the configuration file is correct and start up Apache.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5 root# /usr/local/apache/bin/apachectl configtest
Syntax OK
/usr/local/src/modsecurity-apache_2.5.5 root# /usr/local/apache/bin/apachectl start
</pre>
</td>
</table>
<p>
Check if ModSecurity if configured into running Apache server.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/modsecurity-apache_2.5.5 root# cat /var/www/logs/error_log | grep ModSecurity
[Thu Jul 31 18:24:59 2008] [notice] ModSecurity for Apache/2.5.5 (http://www.modsecurity.org/) configured.
</pre>
</td>
</table>
<p></p>
<h3>Additional Information</h3>
<p>This post is only to get the basics down.  The above information was taken from the <a href="http://www.modsecurity.org/documentation/modsecurity-apache/2.5.5/modsecurity2-apache-reference.html#installation">ModSecurity documentation</a> install section for version 2.5.5.  A great deal more information is available at the <a href="http://blog.modsecurity.org/">ModSecurity blog site</a> and in the book &#8220;<a href="http://www.apachesecurity.net">Apache Security</a>&#8220;.  </p>
<h3>Concluding Remarks</h3>
<p>Ivan Ristic and <a href="http://blog.shezaf.com/">Ofer Shezaf</a> are working on an interesting paper, &#8220;<a href="http://blog.modsecurity.org/files/enough_with_default_allow_r2_draft.pdf">Enough With Default Allow in Web Applications!</a>&#8221;  This paper demonstrates how WAFs are evolving.  To quote the paper:</p>
<blockquote><p>The default allow deployment model, which is commonly used to implement and deploy web applications, is the cause of numerous security problems. We propose a method of modeling web applications in a platform-agnostic way to adopt a default deny model instead, removing several classes of vulnerability altogether and significantly reducing the attack surface of many others. Our approach is best adopted during development, but can be nearly as efficient as an afterthought, or when used at deployment time.  What they are looking to do is create a protection layer between the web servers and applications which would increase security and turn applications into verifiable components with external contracts that can be enforced.</p></blockquote>
<p>Ristic mentions in his post the planned release of &#8220;<em>an open source profiling tool (which I will announce next week) to help with the third use case and automate the creation of positive security models (also known as the learning feature of web application firewalls)</em>.&#8221;  Breach Security has also <a href="http://www.breach.com/news-events/press-releases/whitehat-security-and-breach-security-team-to-offer-powerful-web-application-security.html">teamed up with WhiteHat Security</a> to add the ability to their Sentinel scanning service to automatically create custom ModSecurity rules for certain classes of vulnerabilities that are found in your web applications.  This is the kind of evolution that is required in security and makes ModSecurity such an interesting software package.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/07/31/implementing-a-web-application-firewall-with-modsecurity/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ajax Security</title>
		<link>http://blog.securitymonks.com/2008/01/30/ajax-security/</link>
		<comments>http://blog.securitymonks.com/2008/01/30/ajax-security/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 02:06:19 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[Web Application]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/2008/01/30/ajax-security/</guid>
		<description><![CDATA[“Change is the constant, the signal for rebirth, the egg of the phoenix” &#8212; Christina Baldwin

Many of the security issues we are beginning to see with Web applications are issues that we have seen in some form with traditional client/server applications.  Unlike the Phoenix, the Web application security issues are not rising from the [...]]]></description>
			<content:encoded><![CDATA[<p>“<a href="http://www.quotationspage.com/quote/1494.html"><em>Change is the constant, the signal for rebirth, the egg of the phoenix</em></a>” &#8212; <strong><a href="http://books.google.com/books?as_auth=Christina+Baldwin">Christina Baldwin</a></strong></p>
<p>
<a href="http://www.marvel.com/universe/Phoenix_Force"><img src="http://www.marvel.com/universe3zx/images/thumb/a/a5/Phoenix_force.jpg/440px-Phoenix_force.jpg" alt="Phoenix" align="left" width=100 /></a>Many of the security issues we are beginning to see with Web applications are issues that we have seen in some form with traditional client/server applications.  Unlike the <a href="http://en.wikipedia.org/wiki/Phoenix_(mythology)">Phoenix</a>, the Web application security issues are not rising from the ashes of traditional client/server applications.  Client/server security is still very much alive.  The Phoenix just provides better imagery then the <a href="http://en.wikipedia.org/wiki/Lernaean_Hydra">Hydra</a>, where if you cut the head off the Hydra two came back in its place.  In the old days of the Internet (a few years ago), everything was done on the server.  When you think about vulnerabilities in ftp, mail, and Web servers, it was the infrastructure groups responsibility for fixing it.  Fixes were done by doing such things as setting up firewall rules, patching systems, upgrading server software, etc.  With Web 1.0, the intelligence was pretty much on the Web server.  Your Web browser would simply talk to your server where the applications resided.
</p>
<p>
Asynchronous JavaScript and XML (Ajax) changes the traditional model by having the application running on the browser where more of the work is done.  The JavaScript engine runs on the browser, talking to the server and third party sources on your behalf.  This is not unique to Ajax.  Anywhere you have <a href="http://en.wikipedia.org/wiki/Rich_Internet_application">Rich Internet Applications</a> (RIA), there will be this interplay between the server, third party sources, and the client.  State information has to be shared between the client and server.  Unfortunately, one of the lessons we have learned over the years is that you cannot trust the client.  Outside of client side certificates, there really is no way for the server to know who is talking to it.
</p>
<p>
<a href="http://shreeraj.blogspot.com/">Shreeraj Shah</a>, the author of <a href="http://www.blueinfy.com/web2book.html">Web 2.0 Security &#8211; Defending Ajax, RIA and SOA</a>; <a href="http://www.amazon.com/Web-Hacking-Attacks-Stuart-McClure/dp/02017617">Web Hacking</a> (Stuart McClure and Saumil Shah co-authors); and <a href="http://www.amazon.com/Hacking-Services-Internet-Shreeraj-Shah/dp/1584504803/">Hacking Web Services</a>, did a presentation at the HITB Security Conference titled &#8220;<a href="http://conference.hitb.org/hitbsecconf2007kl/materials/D2T1%20-%20Shreeraj%20Shah%20-%20%20Hacking%20Ajax%20and%20Web%20Services%20%e2%80%93%20Next%20Generation%20Web%20Attacks%20on%20the%20Rise.pdf">Web 2.0 hacking, keeping focus on Ajax and Web Services</a>.&#8221;   In the presentation, Shreeraj discusses the vectors of change between Web 1.0 and Web 2.0.  In Web 1.0, the entry points were structured, there were limited dependencies, the vulnerabilities were on the server side (typically through injections), and there were server side exploitations.  In Web 2.0, everything changes.  You have scattered and multiple entry points.  There are dependencies on multiple technologies, information sources, and protocols.  Vulnerabilities can be exploited on Web services through payloads and on the client side through such exploits as <a href="http://ha.ckers.org/xss.html">XSS</a> and <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">XSRF</a>.  Exploits exist for both server and client.
</p>
<p>
More worrisome is that in many organizations, security remains solely network focused while developers are left untrained and unaware.  Up until now, developers have not had to deal seriously with security problems.  Add to this changing environment, pressure on developers to meet deadlines and develop code quickly.  Some developers main goal is simply getting their application not to crash.  It is easy to understand how due to lack of exposure and the need for quick code turn around, developers can fail to put security measures in place sufficient for a Web 2.0 world.  <a href="http://www.lightbluetouchpaper.org/">Ross Anderson</a> and <a href="http://www.cl.cam.ac.uk/~twm29/">Tyler Moore</a> add some great insight into the software development environment in their paper, &#8220;<a href="http://www.cl.cam.ac.uk/~rja14/Papers/econ_crypto.pdf">Information Security Economics &#8211; and Beyond.</a>&#8221;   Ross and Tyler wrote:</p>
<blockquote><p>In many markets, the attitude of ‘ship it Tuesday and get it right by version 3’ is perfectly rational behaviour. Many software markets have dominant firms thanks to the combination of high fixed and low marginal costs, network externalities and client lock-in noted above, so winning market races is all-important. In such races, competitors must appeal to complementers, such as application developers, for whom security gets in the way; and security tends to be a lemons market anyway. So platform vendors start off with too little security, and such as they provide tends to be designed so that the compliance costs are dumped on the end users. Once a dominant position has been established, the vendor may add more security than is needed, but engineered in such a way as to maximise customer lock-in.</p>
<p>In some cases, security is even worse than a lemons market: even the vendor does not know how secure its software is. So buyers have no reason to pay more for protection, and vendors are disinclined to invest in it.</p></blockquote>
<p>Another outstanding article is by <a href="http://www.cs.dartmouth.edu/~sergey/">Sergey Bratus</a> in the July/August 2007 IEEE Security and Privacy magazine titled &#8220;<a href="http://csdl2.computer.org/persagen/DLAbsToc.jsp?resourcePath=/dl/mags/sp/&#038;toc=comp/mags/sp/2007/04/j4toc.xml&#038;DOI=10.1109/MSP.2007.101">What Hackers Learn that the Rest of Us Don&#8217;t: Notes on Hacker Curriculum</a>.&#8221; Sergey makes the following comparisons between developers in the academic programs to those in the hacking community:
<ul>
<li>Developers are under pressue to follow standard solutions, or the path of least resistance to &#8220;just making it work.&#8221;</li>
<li>Developers tend to be implicity trained away from exploring underlying APIs because the extra time investment rarely pays off.</li>
<li>Developers often receive a limited view of the API, with few or hardly any details about its implementation.</li>
<li>Developers are de facto trained to ignore or avoid infrequent border cases and might not understand their effects.</li>
<li>Developers might receive explicit directions to ignore specific problems as being in other developers&#8217; domains.</li>
<li>Developers often lack tools for examining the full state of the system, let alone changing it outside of the limited API.</li>
</ul>
<p>No one said it was going to be easy.  The first step is to recognize that there is a problem.  Actually, there are multiple issues to deal with when getting into application security.  Just keep reminding yourself, one step at a time.  The second step is to reach out and seek help.  To help us on our road to security recover, <a href="http://www.memestreams.net/users/acidus/">Billy Hoffman</a> and Bryan Sullivan have written the book <a href="http://www.amazon.com/Ajax-Security-Billy-Hoffman/dp/0321491939/ref=cm_cr-mr-title">Ajax Security</a>.  Billy has an interview on IT Conversations Technometria titled &#8220;<a href="http://itc.conversationsnetwork.org/shows/detail3516.html">Ajax Security</a>&#8221; where he talks about Ajax in general and reviews some of the specific security issues most likely to occur. He also gives a number of examples of where security is likely to be a problem.
</p>
<p>
<a href="TaoSecurity.com">Richard Bejtlich</a> provided the following very favorable <a href="http://taosecurity.blogspot.com/2007/12/last-book-reviews-of-2007-posted.html">review</a> of &#8220;Ajax Security:&#8221;</p>
<blockquote><p>
Ajax Security was the last book I read and reviewed in 2007. However, it was the best book I read all year. The book is absolutely compelling and every security professional and Web developer should read it. It&#8217;s really as simple as that.</p>
<p>I am not a Web developer. I was not very familiar with Ajax (beyond its buzzword status and a vague notion of functionality) when I started reading Ajax Security. I attended the authors&#8217; Black Hat 2007 talk and was thoroughly impressed and disturbed by the security implications they presented. I expected Ajax Security to be a good book, but one can never be sure if talented hackers and presenters can transfer their skills to the written word. Ajax Security gets the job done.</p></blockquote>
<p>This is extremely high praise considering Richard&#8217;s background and the number of books <a href="http://www.amazon.com/gp/cdp/member-reviews/A2ZVOU9X5W2S47/ref=cm_pdp_reviews_see_all?ie=UTF8&#038;sort%5Fby=MostRecentReview">Richard reviews</a>.
</p>
<p>
Billy has done some outstanding presentations at Black Hat.  In 2006, he presented <a href="www.blackhat.com/presentations/bh-usa-06/BH-US-06-Hoffman.pdf">Ajax (in)security</a>.  In 2007, Bryan Sullivan and Billy Hoffman presented &#8220;<a href="https://www.blackhat.com/presentations/bh-usa-07/Sullivan_and_Hoffman/Whitepaper/bh-usa-07-sullivan_and_hoffman-WP.pdf">Premature Ajax-ulation</a>&#8220;.  If video is more to your liking, Bill presented &#8220;<a href="https://www123.livemeeting.com/cc/microsoft/viewReg?role=&#038;cn=bhoffman&#038;pw=&#038;id=BQB2HZ&#038;email=foo%40bar.com&#038;company=abc">0wn3d: How AJAX Makes Web Hacking Easier</a>.&#8221;  In the <a href="http://blog.securitymonks.com/presentations/">presentation area</a> of this site, there are a couple very interesting talks on Ajax:
<ul>
<li><a href="https://owasp.org/images/0/0d/OWASPAppSec2006Seattle_Why_AJAX_Applications_More_Likely_Insecure.ppt">Why AJAX Applications Are Far More Likely To Be Insecure (And What To Do About It)</a> by <a href="http://www.linkedin.com/pub/dir/?first=Dave&#038;last=Wichers&#038;search=Search">Dave Wichers</a></li>
<li><a href="http://www.owasp.org/images/f/f9/OWASPAppSecEU2006_AJAX_Security.ppt">Ajax Security</a> by <a href="http://www.greebo.net/">Andrew van der Stock</a></li>
<li><a href="http://www.owasp.org/images/6/6a/KC_Dec2006_Ajax_Security_Concerns.pdf">Ajax Security Concerns</a> by <a href="http://www.owasp.org/index.php/Category:OWASP_AJAX_Security_Project">Rohini Sulatycki</a></li>
<li><a href="http://conference.hitb.org/hitbsecconf2007kl/materials/D2T1%20-%20Shreeraj%20Shah%20-%20%20Hacking%20Ajax%20and%20Web%20Services%20%e2%80%93%20Next%20Generation%20Web%20Attacks%20on%20the%20Rise.pdf">Hacking Ajax and Web Services: Next Generation Web Attacks on the Rise</a> by <a href="http://shreeraj.blogspot.com/">Shreeraj Shah</a></li>
</ul>
<p>Borrowing from Dave Wicher&#8217;s presentation, security issues that need to be dealt with include secure communications, authentication and sessions, access control, data protection, input validation and output encoding, error handling, logging &#038; intrusion detection, availability, and concurrency.  Not a simple task.  Is Ajax applications less secure then other Web applications?  Ajax, in and of itself, is neither secure nor insecure.  The <a href="http://www.owasp.org/index.php/OWASP_Guide_Project">OWASP 3.0 Guide</a> chapter on <a href="http://www.owasp.org/index.php/Guide_Table_of_Contents#Ajax_and_Other_.22Rich.22_Interface_Technologies">Ajax and &#8220;Other&#8221; Rich Interface Technologies</a> states, &#8220;<em>AJAX applications face exactly the same security issues as all other Web applications, plus they add their own particular set of risks that must be correctly managed.  By their complex, bidirectional, and asynchronous nature, AJAX applications increase attack surface area.</em>&#8221;  Because of the increase attack surface area of Ajax applications, one can argue these applications  are less secure.  The truth is that other Rich Internet Applications, such as  Flash, Java applets, and Active X controls can be just as insecure.
</p>
<p>
How do you go about securing Ajax applications?  Borrowing from Rohini Sulatycki presentation, you need to validate all inputs, all client side validation must be backed up by server side validation, do not implement business logic validation client side, implement whitelist validation, do not trust third party source (filter it out), identify valid data and reject everything else, no direct cross domain call back, and encode all outputs.  Do not cripple Web development in the name of security.  Instead, organizations need to make sure developers know the security issues.  Get security involved on the application side.
</p>
<p>
Expanding from securing Ajax applications to moving your organizations toward software security and application security, Gary McGraw wrote a nice concise article titled &#8220;<a href="http://www.darkreading.com/document.asp?doc_id=142829">Four ways to kick off your organization&#8217;s software security initiative in the New Year</a>.&#8221;  Read the article along with everything Gary writes.  To summarize the four methods:
<ul>
<li> A top-down framework approach&#8230;perform a gap analysis between where you are and where you want to be from a software security perspective. Then build a plan to address the gaps&#8230;.</li>
<li> The portfolio risk method takes a more business-oriented approach to the software security problem. The idea here is to assess the entire application portfolio according to some risk criteria agreed on in advance. &#8230;</li>
<li>The training first approach to software security is more grounded in the technical world. This approach helps developers who love to do the right thing but just don’t know what the right thing is when it comes to security. &#8230;</li>
<li>The lead with a tool approach, meanwhile, makes sense for an organization that has already purchased and attempted to roll out a security analysis tool&#8230;.</li>
</ul>
<p>Gary also does the Silver Bullet Security Podcast, where on broadcast titled &#8220;<a href="http://www.cigital.com/silverbullet/show-021/">Show 021 &#8211; A Panel Discussion with Cigital’s Principals</a>&#8220;, the principals at Cigital discuss the best ways for large companies to get started with software security.
</p>
<p>
Gunnar Peterson is his post titled &#8220;<a href="http://1raindrop.typepad.com/1_raindrop/2008/01/go-wide-and-dee.html">Go Wide and Deep, Incrementally</a>&#8221; makes the point that the best method for an organizations depends on &#8220;<em>what you are trying to do, your company culture, and the people&#8217;s skills who are working on software security.</em>&#8221;  Gunnar suggest a fifth method, &#8220;namely decentralized specialized teams, or centers of excellence in <a href="http://en.wikipedia.org/wiki/Pointy_Haired_Boss">PHB</a> speak.&#8221;  He makes the important point that &#8220;<em>to deploy any of the current cutting edge stuff in software security at scale, requires technical depth and deployment width. This automatically limits your resource pool of who can deliver this stuff</em>.&#8221;
</p>
<p>
Gunnar offers additional advice in his post titled &#8220;<a href="http://1raindrop.typepad.com/1_raindrop/2006/01/phasing_securit.html">Phasing Security into the SDLC &#8211; A Comparison of Approaches</a>.&#8221;  He suggest four main ways to get started: top down, testing and validation, start in the middle, and training.  Gary and Gunnar favor a mix approach of top down and bottom up, &#8220;<em>that approach often leads with the creation of a special ops execution team that becomes the software security group. By far, this is the most impressive approach in terms of results and the one that is the most effective in well-run enterprises</em>&#8221; (Gary quote).  They will not get any arguments from me.
</p>
<p>
Moving an organization towards an environment where secure code can be produced, let it be Ajax or any RIA, is not an easy endeavor.  Like the software development life cycle, an iterative, incremental delivery is the way to go.  You do what you can.  You work the program, one day at a time.  This way, you take the needed steps to a secure recovery.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/01/30/ajax-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Security News</title>
		<link>http://blog.securitymonks.com/2008/01/10/software-security-news/</link>
		<comments>http://blog.securitymonks.com/2008/01/10/software-security-news/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 20:36:07 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Application]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/2008/01/10/software-security-news/</guid>
		<description><![CDATA[“We should never ever be so arrogant to think that we’re not a potential victim or our data has not been compromised or that there’s not some adversary out there that’s just as smart if not smarter than we are who won’t be able to compromise that data.” &#8212; Howard Schmidt

A quick post on software [...]]]></description>
			<content:encoded><![CDATA[<p>“<em>We should never ever be so arrogant to think that we’re not a potential victim or our data has not been compromised or that there’s not some adversary out there that’s just as smart if not smarter than we are who won’t be able to compromise that data.</em>” &#8212; <strong><a href="http://www.networkworld.com/newsletters/sec/2007/1217sec2.html">Howard Schmidt</a></strong></p>
<p>
<a href="http://searchsoftwarequality.techtarget.com/generic/0,295582,sid92_gci1193537,00.html"><img src="/images/white_hat_hacker_cartoon.jpg" alt="Security Software" align="left" width=250/></a>A quick post on software security.  Gunnar Peterson, a Software Security Architect and CTO at Arctec Group, has posted some excellent advice on getting started with software security.  His posting is titled, &#8220;<a href="http://1raindrop.typepad.com/1_raindrop/2008/01/go-wide-and-dee.html">Go Wide and Deep, Incrementally</a>.&#8221;  He bases his advice on an article titled &#8220;<a href="http://www.darkreading.com/document.asp?doc_id=142829&#038;WT.svl=tease3_2">Software Security Strategies</a>&#8221; by <a href="http://www.cigital.com/%7Egem/">Gary McGraw</a>.  While I am tempted to quote Gunnar quoting Gary, I&#8217;ll leave it to you to follow the links.  When Gary and Gunnar speak, it is smart to listen.
</p>
<p>
Speaking of smart things to do, check out Gary&#8217;s most recent podcast, &#8220;<a href="http://www.cigital.com/silverbullet/show-021/">Show 021 &#8211; A Panel Discussion with Cigital’s Principals</a>.&#8221;  The Silver Bullet Security Podcast has become one of my favorite podcasts.  In this episode, to quote from Citigal&#8217;s site, &#8220;<em>The group discusses the best ways for large companies to get started with software security and the similarities between CLASP, Microsoft’s SDL, and the Security Touchpoints</em>.&#8221;  The <a href="http://www.cigital.com/justiceleague">Justice League&#8217;s members</a> for this podcast consists of <a href="http://www.cigital.com/justiceleague/about/#sammy">Sammy Migues</a> (Director of Training and Knowledge Management), <a href="http://www.cigital.com/justiceleague/about/#john">John Steven</a> (Principal Consultant),  <a href="http://www.cigital.com/justiceleague/about/#pravir">Pravir Chandra</a> (Principal Consultant), and <a href="http://www.cigital.com/justiceleague/about/#gem">Gary McGraw</a> (CTO).  A very interesting discussion.
</p>
<p>
On a related topic, <a href="http://jeremiahgrossman.blogspot.com/">Jeremiah Grossman</a> just pointed out in his blog that <a href="http://www.fortifysoftware.com/">Fortify Software</a> has announced the premier of their new documentary, “<a href="http://www.youtube.com/watch?v=-5zxOLZ5jXM">The New Face of Cybercrime</a>”.  Check out the trailer:
</p>
<p>
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/-5zxOLZ5jXM&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/-5zxOLZ5jXM&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
</p>
<p>
I wish the film was not just premiering in San Francisco, New York, and London.  Following each screening, there will be an expert panel discussion on cybercrime.  Since Gary is in the film, and has good relationships with Fortify Software, I am hoping one of the post-screening discussions will make its way to the Silver Bullet Security Podcast.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/01/10/software-security-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

