<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.communities.hp.com/securitysoftware/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Following the White Rabbit Blog : testing</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/testing/default.aspx</link><description>Tags: testing</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Hybrid Analysis - The Answer to Static Code Analysis Shortcomings</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/05/15/Hybrid-Analysis-_2D00_-The-Answer-to-Static-Code-Analysis-Shortcomings.aspx</link><pubDate>Thu, 15 May 2008 14:16:00 GMT</pubDate><guid isPermaLink="false">94bda21f-7d63-4095-85de-7c2a68fb172c:77254</guid><dc:creator>Rafal Los</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.communities.hp.com/securitysoftware/blogs/rafal/rsscomments.aspx?PostID=77254</wfw:commentRss><comments>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/05/15/Hybrid-Analysis-_2D00_-The-Answer-to-Static-Code-Analysis-Shortcomings.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;Hybrid Analysis - The Answer to Static Code Analysis Shortcomings&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Given my previous article and the buzz it generated (both for and against the ideas I set forth)... I needed to hurry-up and write the follow-on article for &amp;quot;Static Code Analysis Failures&amp;quot;.&amp;nbsp; I&amp;#39;ve had so many conversations with people about Hybrid Analysis, and &amp;quot;why static code analysis fails&amp;quot; I&amp;#39;ve come to realize a few things, and wanted to share more of the base for my mindset...&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Most of the folks I&amp;#39;ve spoken to (developer to security &amp;quot;expert&amp;quot;) have a mis-guided idea of &amp;quot;static code analysis&amp;quot;.&amp;nbsp; With that in mind, here is the definition from the Wikipedia...&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Static code analysis&lt;/strong&gt; is the analysis of computer &lt;/em&gt;&lt;a class="mw-redirect" href="http://en.wikipedia.org/wiki/Software" title="Software"&gt;&lt;em&gt;software&lt;/em&gt;&lt;/a&gt;&lt;em&gt; that is &lt;font color="#ff0000"&gt;performed without actually executing programs built from that software&lt;/font&gt; (analysis performed on executing programs is known as &lt;/em&gt;&lt;a href="http://en.wikipedia.org/wiki/Dynamic_program_analysis" title="Dynamic program analysis"&gt;&lt;em&gt;dynamic analysis&lt;/em&gt;&lt;/a&gt;&lt;em&gt;). In most cases the analysis is performed on some version of the &lt;/em&gt;&lt;a href="http://en.wikipedia.org/wiki/Source_code" title="Source code"&gt;&lt;em&gt;source code&lt;/em&gt;&lt;/a&gt;&lt;em&gt; and in the other cases some form of the &lt;/em&gt;&lt;a class="mw-redirect" href="http://en.wikipedia.org/wiki/Object_code" title="Object code"&gt;&lt;em&gt;object code&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. The term is usually applied to the analysis performed by an &lt;/em&gt;&lt;a href="http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis" title="List of tools for static code analysis"&gt;&lt;em&gt;automated tool&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, with human analysis being called program &lt;/em&gt;&lt;a href="http://en.wikipedia.org/wiki/Understanding" title="Understanding"&gt;&lt;em&gt;understanding&lt;/em&gt;&lt;/a&gt;&lt;em&gt; or program comprehension.&lt;/em&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Concept:&amp;nbsp;&lt;/strong&gt;The whole&amp;nbsp;reason&amp;nbsp;we (security professionals) have pushed to get a security tool into the &amp;quot;development&amp;quot; part of the SDLC is that it&amp;#39;s easiest to fix defects when the code is still being worked on and built.&amp;nbsp; We all know patching is a recipe for disaster, no one will argue that -&amp;nbsp;so the idea in itself was sound.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Evolution:&lt;/strong&gt;&amp;nbsp;As the evolution&amp;nbsp;of security marches on we have seen the evolution of &amp;quot;static code analysis&amp;quot; move forward as well.&amp;nbsp; The concept of the traditional white-box testing strategy has gone from sending your code to a human being who would read it, line-by-line and provide an analysis of that code to programs which are essentially smart enough to build the code, trace &amp;quot;source-to-sink&amp;quot; and build data flow models and attack vector simulations. I am writing to contend that we have moved on in the next step of the evolution.&amp;nbsp; Building the code and doing a &amp;quot;source-to-sink&amp;quot; trace with simulated attack scenarios is no longer good enough. (more on this in a minute)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Comprehension:&lt;/strong&gt;&amp;nbsp;It seems a few folks have missed the point of what I was talking about.&amp;nbsp; I&amp;#39;m not saying that this type of testing (white-box, source-analysis, whatever you call it) shouldn&amp;#39;t be done.&amp;nbsp; Quite the opposite my friends - &amp;quot;code analysis&amp;quot; is vital to the success of any good security SDLC.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&amp;nbsp;Everyone quickly jumped on my case to defend whatever tools their company makes or uses... but I think I did my best to not attack any particular tool or vendor... hrmmm...&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OK so now let&amp;#39;s talk about what the answer to this whole mess of analyzing web-borne code is going to be.&amp;nbsp; How will we, as security professionals, continue to be relevant to developers and the roots of the Software Development LifeCycle?&amp;nbsp; I tell you that the future lies in what I can only call &amp;quot;&lt;font color="#ff0000"&gt;Hybrid Analysis&lt;/font&gt;&amp;quot;.&amp;nbsp; This isn&amp;#39;t a term I&amp;#39;ve developed, in fact, the term can be attributed to the developers of a certain software tool which is now distributed and built by the HP ASC group (to which I belong).&amp;nbsp; Without turning this into a marketing pitch, I want to explain to you why the leap I made in the above bullet-point titled &amp;quot;evolution&amp;quot; is valid, and why you should care.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I love the quote I put in my first article so I think it&amp;#39;s worth repeating... &amp;quot;Machines do not execute source code, they execute machine code&amp;quot;... absolutely true.&amp;nbsp; So when people used to work with source code we can now understand why they only got the answers part of the time.&amp;nbsp; Yes, I fully realize most &lt;em&gt;modern&lt;/em&gt; source-scanners &amp;quot;or white-box scanner&amp;quot; tools don&amp;#39;t just grep through code, as someone suggested at a blog posting that quoted me.&amp;nbsp; In fact, I&amp;#39;ll go out on a limb and say that to grep through the code for &amp;quot;vulnerabilities&amp;quot; is about as effective as anti-virus and IDS (both pattern-based recognition)... there are so many permutations of the bad/malicious that those tools are inherently broken.&amp;nbsp; Anyway - to get back on track, I want to talk about this term &amp;quot;hybrid analysis&amp;quot;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What is Hybrid Analysis?&amp;nbsp; (And more importantly, why do you care?)&amp;nbsp; Hybrid analysis is the culmination and what I feel is the inevitable cross between white-box and black-box testing.&amp;nbsp; I&amp;#39;m not sure if &amp;quot;gray-box&amp;quot; is the proper term or not, so I&amp;#39;ll just keep using Hybrid Analysis for the sake of not mixing things up.&amp;nbsp; Hybrid analysis analyzes the byte-code that a source-compiler generates and builds your standard &amp;quot;source-to-sink&amp;quot; data-flow model but then moves beyond the limitations of that approach by taking that &amp;quot;knowledge&amp;quot; of the application and submitting it seamlessly into a (modified) black-box scanner built into the solution.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Picture it - you have the blueprints of the bank vault, so you can try all the ways to &lt;em&gt;theoretically&lt;/em&gt; break into the vault, then you hand those theoretical attack plans to a grunt who takes your information and goes and actually tries each of those attack vectors with multiple permutations and attack parameters to make the score and break in.&amp;nbsp; That my friends, is the proverbial Holy Grail of application security testing.&amp;nbsp; Data-modeling will only get you so far, before you have to actually try the attack to make sure it really works.&amp;nbsp; Now, given the many parameters involved, for example, external libraries, compiler behavior, and so on that influence the way code actually behaves it&amp;#39;s conceivable that you can accomplish this feat I&amp;#39;ve described without the &lt;em&gt;hybrid analysis&lt;/em&gt; approach (the modified black-box scanner) ... but then I think you&amp;#39;re looking at an incredibly complex and almost AI-driven analysis tool... and I simply don&amp;#39;t believe that technology exists or will exist.&amp;nbsp; I&amp;#39;m the kind of person that has to see something being broken before I&amp;#39;ll believe it&amp;#39;s real.&amp;nbsp; Give me the proof.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; If you take the hybrid approach - the proof looks you in the face each and every time.&amp;nbsp; As a nice side-effect you can virtually forget false-positives!&amp;nbsp; Source code scanners are infamous (notorious even!) for generating a lot of false-positives.&amp;nbsp; This has always been one of the many reasons developers argue against using these tools.&amp;nbsp; But what if you could offer your developers a way to eliminate those false-positives with little or no human intervention or double-checking?&amp;nbsp; If you&amp;#39;re still skeptical, I&amp;#39;ll be happy to have someone from our team demonstrate how this type of approach works, yes - we have it exclusively in our toolset.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; So let&amp;#39;s recap.&amp;nbsp; Here are all the ways that Hybrid Analysis will save the world (joking):&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Reaches well beyond modern &amp;quot;source-to-sink&amp;quot; data-flow modeling for vulnerability detection&lt;/li&gt;&lt;li&gt;Addresses 3rd party components by reflection (analyzing byte-code or IL of DLLs, JARs, etc)&lt;/li&gt;&lt;li&gt;Provides a &lt;em&gt;real validation&lt;/em&gt; of the theoretical attack scenarios that the above step generates&lt;/li&gt;&lt;li&gt;Virtually eliminates false-positives!&amp;nbsp; This is a nice side-effect of testing using the Hybrid Analysis method&lt;/li&gt;&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.communities.hp.com/securitysoftware/aggbug.aspx?PostID=77254" width="1" height="1"&gt;</description><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/testing/default.aspx">testing</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/static+code+analysis/default.aspx">static code analysis</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/whitebox/default.aspx">whitebox</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/hybrid+analysis/default.aspx">hybrid analysis</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/dynamic+analysis/default.aspx">dynamic analysis</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/blackbox/default.aspx">blackbox</category></item><item><title>Static Code Analysis Failures</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/05/06/Static-Code-Analysis-Failures.aspx</link><pubDate>Tue, 06 May 2008 17:32:00 GMT</pubDate><guid isPermaLink="false">94bda21f-7d63-4095-85de-7c2a68fb172c:77056</guid><dc:creator>Rafal Los</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.communities.hp.com/securitysoftware/blogs/rafal/rsscomments.aspx?PostID=77056</wfw:commentRss><comments>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/05/06/Static-Code-Analysis-Failures.aspx#comments</comments><description>&lt;p&gt;Static code analysis failures are costing enterprises money and reputation.&lt;/p&gt;&lt;p&gt;White-box security testing is inherently a flawed proposition for many reasons -but it all comes down to a very simple concept:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;strong&gt;Machines do not execute source code, they execute machine code (compiled code). --Paul Anderson (&lt;a href="http://www.grammatech.com" title="GrammaTech website"&gt;GrammaTech&lt;/a&gt;)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; If you think this through for a minute you realize that there are a few specific reasons why the above statement fundamentally changes the way that people look at white-box testing, and why this is a losing proposition.&amp;nbsp; Let&amp;#39;s analyze this in the context of a web application project for a mythical online bank.&amp;nbsp; Consider that the use-case here is that we are dealing with a bank that has an online presence (currently being analyzed) which will be integrated with a series of existing legacy applications, partners, and external 3rd party components.&amp;nbsp; Given this information let&amp;#39;s analyze why white-box analysis (or static source-code analysis) is doomed to fail this project with respect to security.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;&lt;strong&gt;Compiler Optimizers Break Things&lt;/strong&gt; - Think of it this way, compilers are designed to make machine code from your source code.&amp;nbsp; That compiler&amp;#39;s sole purpose (in most cases) is to create machine code that will be optimized, extremely fast-executing, but not necessarily secure.&amp;nbsp; Often times security functions that people build into source code can be removed by compiler optimizers and most often without our knowledge.&amp;nbsp; These actions often undo many of the advanced security features that developers may consciously insert into their code.&amp;nbsp; Consider the following example:&lt;/div&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;Developer is paranoid about data-persistence in memory space, and wants to be doubly-sure that variables are expired and destroyed&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Developer writes a routine whereby the variable will have a null value written to it&amp;nbsp;before the memory is freed&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Compiler optimizer sees this as a double-work scenario, and removes the null-value portion and simply opts to free memory&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;A potential security vulnerability is created with variable persistence in freed memory space&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;This example ideally demonstrates how a security vulnerability can be inserted in spite of the developer&amp;#39;s best efforts to write secure code.&amp;nbsp; Standard static-code analysis tools which are used to &amp;quot;scan code&amp;quot; at the static-file level will fail to catch this vulnerability.&amp;nbsp; Quite simply - static code analysis fails if it is not supplemented with dynamic analysis.&lt;/p&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;&lt;strong&gt;3rd Party Library Integrations&lt;/strong&gt; - There is another threat to developing and scanning static code in a white-box format.&amp;nbsp; Inevitably, 3rd party libraries are used to complement features or functionality that are not natively provided by the local development effort.&amp;nbsp; After all, no one re-invents the whole wheel everytime - we simply build what we cannot reuse from someone else&amp;#39;s work, then use the publicly available libraries from 3rd parties to fill in the functionality and features that have already been written and (hopefully) tested before.&amp;nbsp; White-box testing (or static code analysis) will absolutely fail in finding flaws when it comes to pulling in 3rd party libraries.&amp;nbsp; By the definition of this type of issue, 3rd party libraries rarely provide you the source to be scanned and checked for weaknesses that will affect your application.&amp;nbsp; What you&amp;#39;re left with is someone else&amp;#39;s code (in machine-compiled format!) which will be interacting with your application.&amp;nbsp; Would you trust that model?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;&lt;strong&gt;Static Code Analysis Rarely Understands&amp;nbsp;Data-Flow&amp;nbsp;Modeling&amp;nbsp;(Data Tracing)&lt;/strong&gt; - If you&amp;#39;re scanning your application with a source-code-only analysis tool, you&amp;#39;re going to not only miss things that will almost certainly come back to haunt you - but you may also be over-working yourself without a real purpose.&amp;nbsp; Consider the following example to illustrate my point.&amp;nbsp; Before I get into that example though, allow me to explain this idea of &amp;quot;data-flow modeling&amp;quot; for those that are not familiar with this idea.Data-flow modeling seeks to understand how data moves through your application, not just how the application code is written.&amp;nbsp; After all, that&amp;#39;s the whole pointn of the application, to work with data.&amp;nbsp; Vulnerabilities lie in manipulating data either to or from the end users or the server(s).&amp;nbsp; Data-flow modeling maps out the data in your appliaction from it&amp;#39;s instantiation (maybe when the user types it in) to its resting state (maybe when it&amp;#39;s finally written to a database, or handed off to another application or service for additional work).&amp;nbsp; That being said let&amp;#39;s consider a web application that has 1,000 forms across 100 pages written in the language of your choice, built to be AJAX.&amp;nbsp; While each page does nothing individually to validate user input (the data source) all variables (data) are filtered through a central validation module deep within the application logic.&amp;nbsp; A standard source-code analysis tool (I have evaluated this and can honestly say this is a real use-case but will not mention the tool) will flag on each and every input that is not validated (within the page) as vulnerable to hudreds of vulnerabilities ranging from XSS (Cross-Site Scripting) to SQL Injection and other attack types.&amp;nbsp; What you are left with is a very lengthy report with hundreds of critical and high vulnerabilities that you now obviously must address... unless you do some dynamic analysis on the code and realize that *none* of those theoretical vulnerabilities are exploitable due to the fact that the application filters all data through the central validator/scrubber.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So, there you have it.&amp;nbsp; Static code analysis is inherently doomed to fail.&amp;nbsp; White-box testing of source-only is flawed.&amp;nbsp; The sky is falling, global warming will kill us all.&amp;nbsp; In my next installment of this column, I&amp;#39;ll&amp;nbsp;give you what you need to know to avoid&amp;nbsp;failing in your security initiatives at the development step of the SDLC&amp;nbsp;- remember, knowing is half the battle.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;Stay tuned!&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;If this information disturbs you, and you would like to talk about it directly please don&amp;#39;t hesitate to email me directly.&amp;nbsp; I am not a sensationalist, and pride myself on presenting practical solutions to real-world problems which are realistically attainable.&amp;nbsp; Thanks for reading.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.communities.hp.com/securitysoftware/aggbug.aspx?PostID=77056" width="1" height="1"&gt;</description><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/security/default.aspx">security</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/testing/default.aspx">testing</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/static+code+analysis/default.aspx">static code analysis</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/whitebox/default.aspx">whitebox</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/data-flow+analysis/default.aspx">data-flow analysis</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/hybrid+analysis/default.aspx">hybrid analysis</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/dynamic+analysis/default.aspx">dynamic analysis</category></item><item><title>Navigating the PCI DSS Standards...</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/04/22/Navigating-the-PCI-DSS-Standards_2E00__2E00__2E00_.aspx</link><pubDate>Tue, 22 Apr 2008 12:18:00 GMT</pubDate><guid isPermaLink="false">94bda21f-7d63-4095-85de-7c2a68fb172c:76702</guid><dc:creator>Rafal Los</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.communities.hp.com/securitysoftware/blogs/rafal/rsscomments.aspx?PostID=76702</wfw:commentRss><comments>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/04/22/Navigating-the-PCI-DSS-Standards_2E00__2E00__2E00_.aspx#comments</comments><description>&lt;p&gt;For those of you who keep up with the PCI DSS standard, the coucil today has issued an update titled: &lt;strong&gt;&lt;a href="https://www.pcisecuritystandards.org/pdfs/infosupp_6_6_applicationfirewalls_codereviews.pdf" title="PCI DSS Section 6.6 Update" target="_blank"&gt;Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp; &lt;/strong&gt;The standard item 6.6 has been further clarified in one of two options, as before, being either Application Code Reviews or an Application Firewall.&amp;nbsp; I&amp;#39;ll address the first option, since that is the more logical one, but will briefly talk about the Application Firewall as well - just to clear the air a bit.&amp;nbsp; While the Standards Council continues to add clarification, which makes the standard more usable, more opportunities for compliance surface with less cost and effort.&amp;nbsp; No doubt the IT manager feels like this is a good thing because now the cost of compliance won&amp;#39;t necessarily be astronomical - and thereby make it viable.&amp;nbsp; As we all know, the issue of compliance to a non-government regulation is always a balancing act.&amp;nbsp; Compliance, as with most security components, is an equation balancing risk against spending and business value.&amp;nbsp; We all know the results... if the equation balances just right, the business benefits from the added security and sees value while not spending more money than the risk is worth - and security feels worthwhile because risk has been decreased by some factor which affects the business in a positive manner.&amp;nbsp; Granted, it doesn&amp;#39;t always work out quite so rosy - but the PCI DSS standard is going a long way to make sure that these equations that happen every day, in many businesses throughout the world&amp;nbsp;- balance.&lt;/p&gt;&lt;p&gt;&amp;nbsp; Now - on to the meat of the standards update.&amp;nbsp; First off, let me address the Web Application Firewall issue.&amp;nbsp; While this is a topic that deserves a whole article onto itself, the short version is this - web app firewalls are very expensive, complex band-aids.&amp;nbsp; That&amp;#39;s the reality.&amp;nbsp; While many of them work phenomenally well, and in fact I can name a few that do, they are difficult to implement into an existing production environment, they are primarily signature-based (remember how well we stop &amp;quot;unknown&amp;quot; viruses?), or have some other architectural quirk that makes them an impossibility in your enterprise.&amp;nbsp; Personally, at my previous company I started to implement a particular WAF ... but it took over a year and a half of research, testing, approvals, and more testing to get them into a newly built environment... not even into a legacy production environment where they would have provided the most value.&amp;nbsp; Anyway... the point is - a WAF is a tool you use when you don&amp;#39;t have the resources to &amp;quot;do it right&amp;quot;... fix the code itself.&lt;/p&gt;&lt;p&gt;&amp;nbsp; Section 6.6 of the PCI DSS standards, option 1 (the Application Code Reviews) now has 4 basic alternatives.&amp;nbsp; Candidates are urged to implement at least one of the following...&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Manual review of application source code&lt;/li&gt;&lt;li&gt;Propse use of automated application source code analyzer tools (static code scanners)&lt;/li&gt;&lt;li&gt;Manual web application security vulnerability assessment&lt;/li&gt;&lt;li&gt;Propse use of automated web application security vulnerability assessment tools&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp; First, a few things of note.&amp;nbsp; The above does not necessarily call for a &amp;quot;penetration test&amp;quot; which exploits vulnerabilities by an ethical hacker... only an &amp;quot;assessment&amp;quot; (which identifies but does not exploit) vulnerabilities is required.&amp;nbsp; The distincion is important because it means that you can now do this on production code, or a production environment without the risk of damaging your applications by necessity to prove their vulnerability.&lt;/p&gt;&lt;p&gt;&amp;nbsp; I find it interesting that the update goes and directly says &lt;em&gt;&amp;quot;In all cases, the individual(s) must have the proper skills and experience to understand the source code and/or web application, know how to evaluate each for vulnerabilities, and understand the findings&amp;quot;&lt;/em&gt;.&amp;nbsp; The fact that the DSS requirement 6.6 now specifically addresses competence in the assessor should mean that there was some ... question... over the competence of assessors or possibly a need to specifically stamp out that only qualified people should be doing assessments.&amp;nbsp; Interesting, at either angle.&amp;nbsp; The same statement goes for assessors using automated tools - but now we have an interesting proposition.&amp;nbsp; Do you (a) hire an extremely qualified application vulnerability tester, or (b) hire a knowledgeable user, and give him a software testing/scanning tool and some training... and are those even the same?&amp;nbsp; Obviously the dollar amounts for the two are different... or are they?&amp;nbsp; There is also the point about the testers having to be (the authors use the word &amp;quot;should be&amp;quot;) organizationally separate from those writing the code... well that makes sense.&amp;nbsp; No one wants the fox guarding the hen-house, right?&amp;nbsp; You don&amp;#39;t want the same developers that are potentially churning out insecure code to then review it and give themselves gold stars.&amp;nbsp; So far so good.&lt;/p&gt;&lt;p&gt;&amp;nbsp; So now we have 2 options for doing this internally - which will help our bottom line (external 3rd parties are typically very, very expensive)... &lt;/p&gt;&lt;ol&gt;&lt;li&gt;First option is to do an SDLC-integrated code review... actually reviewing the application code before it gets compiled and leaves the development group&amp;#39;s control.&amp;nbsp; We have the option to do it manually, or with some tools - using only highly trained and knowledgeable people.&lt;/li&gt;&lt;li&gt;Second option is to do a post-development analysis of the code.&amp;nbsp; Once the code is written, built, and tested for usability issues it&amp;#39;s time to security-test it with, again, either a human being, or&amp;nbsp;some black-box testing tool(s) - but again, you must use trained and knowledgeable people here as well.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&amp;nbsp; Well, if I&amp;#39;m a security manager...this is great!&amp;nbsp; Thinking logically - you always want the security expertise in-house, and why in the world wouldn&amp;#39;t you want to do application security throughout the application lifecycle?&amp;nbsp; The DSS update also goes on to remind us of requirement 6.3, and the need to have an effective change-control process such that the security reviews are not bypassed, at any level.&amp;nbsp; While the final sign-off must be done when the code is ready for production - it&amp;#39;s imperative that the effectiveness of the application security policy be enacted to push as far back into the development (pre-development planning?&amp;nbsp; requirements gathering?) lifecycle as possible (more on that in a separate article).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;As a final note - the update talks about the need to stay current and abreast of new developments in application security testing.&amp;nbsp; It&amp;#39;s essential that whatever tools are purchased (whether they be the full SDLC suite from &lt;a href="http://www.hp.com/go/securitysoftware" title="HP Application Security Center Suite" target="_blank"&gt;HP/ASC&lt;/a&gt;, or some other vendor) - that these tools and their users be continually updated from the brightest minds in the field.&amp;nbsp; This is unfortunately a one-up battle against the &amp;quot;bad guys&amp;quot;... if you&amp;#39;re behind you&amp;#39;re sunk.&lt;/p&gt;&lt;p&gt;So what have we learned from the new Section 6.6 update?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;There are at least 4 ways to interpret the &amp;quot;Application Code Review&amp;quot; guideline&lt;/li&gt;&lt;li&gt;You can have your code &amp;quot;reviewed&amp;quot; internally, as long as your assessor is trained and competent (but to who&amp;#39;s qualifications?)&lt;/li&gt;&lt;li&gt;You can use automated tools, either static code analysis or black-box testing software, if you have your people trained in those tools, and application security&lt;/li&gt;&lt;li&gt;Your testers/assessors have to be organizationally separate from the development organization (but at what level?)&lt;/li&gt;&lt;li&gt;Your organization should absolutely integrate application security as early into the SDLC as possible, using &amp;quot;tools and rules&amp;quot; in combination&lt;/li&gt;&lt;li&gt;Your testers should always be up-to-date on the latest developments, techniques, and methods... otherwise you&amp;#39;re bringing a knife to a gunbattle&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Thanks for your attention!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.communities.hp.com/securitysoftware/aggbug.aspx?PostID=76702" width="1" height="1"&gt;</description><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/testing/default.aspx">testing</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/tools/default.aspx">tools</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/web+application/default.aspx">web application</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/PCI+DSS/default.aspx">PCI DSS</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/assessments/default.aspx">assessments</category></item><item><title>"Security Vulnerability" != "Defect"  ; why?</title><link>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/04/01/Security-vulnerabilities-as-quality-defects_3F00_.aspx</link><pubDate>Tue, 01 Apr 2008 11:18:00 GMT</pubDate><guid isPermaLink="false">94bda21f-7d63-4095-85de-7c2a68fb172c:75801</guid><dc:creator>Rafal Los</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.communities.hp.com/securitysoftware/blogs/rafal/rsscomments.aspx?PostID=75801</wfw:commentRss><comments>http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2008/04/01/Security-vulnerabilities-as-quality-defects_3F00_.aspx#comments</comments><description>&lt;p&gt;It&amp;#39;s one of those obvious things.&amp;nbsp; A defect is a defect, right?&amp;nbsp; Whether the airbag is faulty, or the gas cap doesn&amp;#39;t hold pressure... a defect is a defect.&amp;nbsp; The strange thing is - it hasn&amp;#39;t been that way, and still isn&amp;#39;t that way, in most of the IT shops I&amp;#39;ve been in.&amp;nbsp; Why?&lt;/p&gt;&lt;p&gt;The reason is simple.&amp;nbsp; Historically, &lt;em&gt;security vulnerabilities&lt;/em&gt;&lt;strong&gt; &lt;/strong&gt;have been in a class all their own.&amp;nbsp; In an attempt to put some urgency to the matter, security professionals have labeled defects in the security of their projects (in this case I&amp;#39;m talking about web applications) as an entirely different thing than a functional defect.&amp;nbsp; What we didn&amp;#39;t realize is that we were actually doing a dis-service to ourselves and the security cause.&amp;nbsp; You may not agree with me right now - but I&amp;#39;ll explain this more clearly, and I think you&amp;#39;ll be on board with my thought process.&lt;/p&gt;&lt;p&gt;Let&amp;#39;s talk about defects, in general and then apply it to the matter at hand.&amp;nbsp; First, let&amp;#39;s identify what a defect is...&amp;nbsp; A defect is, in the dictionary sense (cut from &lt;a href="http://dictionary.reference.com/browse/defect" target="_blank"&gt;dictionary.com)&lt;/a&gt;:&lt;/p&gt;&lt;p&gt;&lt;span class="me"&gt;&lt;strong&gt;de&amp;middot;fect&lt;/strong&gt;&lt;/span&gt; &lt;span class="pronset"&gt;&lt;font color="#116699"&gt;&amp;nbsp;&lt;img border="0" height="15" src="http://cache.lexico.com/g/d/premium.gif" width="16" /&gt;&amp;nbsp; &lt;img border="0" class="luna-Img" height="4" src="http://cache.lexico.com/dictionary/graphics/luna/thinsp.png" width="2" /&gt;&lt;/font&gt;&lt;a href="https://secure.reference.com/premium/login.html?rd=2&amp;amp;u=http%3A%2F%2Fdictionary.reference.com%2Fbrowse%2Fdefect"&gt;&lt;font color="#116699"&gt;&lt;img border="0" height="18" src="http://cache.lexico.com/g/d/speaker.gif" width="17" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font color="#116699"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;span class="show_ipapr" style="display:none;"&gt;&lt;span class="prondelim"&gt;&lt;font color="#880000" face="Arial Unicode MS"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;span class="pg"&gt;&lt;em&gt;&lt;font color="#558811"&gt;n. &lt;/font&gt;&lt;/em&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font color="#880000"&gt;&lt;span class="pron"&gt;ˈdi&lt;img border="0" class="luna-Img" height="4" src="http://cache.lexico.com/dictionary/graphics/luna/thinsp.png" width="2" /&gt;fɛkt, &lt;/span&gt;&lt;span class="pron"&gt;dɪˈfɛkt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span class="pg"&gt;&lt;em&gt;&lt;font color="#558811"&gt;v. &lt;/font&gt;&lt;/em&gt;&lt;/span&gt;&lt;font color="#880000"&gt;&lt;span class="pron"&gt;dɪˈfɛkt&lt;/span&gt;&lt;span class="prondelim"&gt;&lt;font face="Arial Unicode MS"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#116699"&gt; &lt;/font&gt;&lt;a class="pronlink" title="Click for pronunciation key"&gt;&lt;u&gt;&lt;font color="#116699"&gt;Pronunciation Key&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;span class="pron_toggle" style="display:inline;"&gt;&lt;span class="prondelim"&gt;&lt;font color="#880000" face="Arial Unicode MS"&gt; - &lt;/font&gt;&lt;/span&gt;&lt;a class="pronlink" title="Click to show spelled pronunciation"&gt;&lt;u&gt;&lt;font color="#116699"&gt;Show Spelled Pronunciation&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="show_spellpr" style="display:inline;"&gt;&lt;span class="prondelim"&gt;&lt;font color="#880000" face="Arial Unicode MS"&gt;[&lt;/font&gt;&lt;/span&gt;&lt;span class="pg"&gt;&lt;em&gt;&lt;font color="#558811"&gt;n. &lt;/font&gt;&lt;/em&gt;&lt;/span&gt;&lt;font color="#880000"&gt;&lt;font face="Verdana"&gt;&lt;span class="pron"&gt;&lt;strong&gt;dee&lt;/strong&gt;-fekt, &lt;/span&gt;&lt;span class="pron"&gt;di-&lt;strong&gt;fekt&lt;/strong&gt;; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span class="pg"&gt;&lt;em&gt;&lt;font color="#558811"&gt;v. &lt;/font&gt;&lt;/em&gt;&lt;/span&gt;&lt;font color="#880000"&gt;&lt;span class="pron"&gt;&lt;font face="Verdana"&gt;di-&lt;strong&gt;fekt&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class="prondelim"&gt;&lt;font face="Arial Unicode MS"&gt;]&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#116699"&gt; &lt;/font&gt;&lt;a class="pronlink" title="Click for pronunciation key"&gt;&lt;u&gt;&lt;font color="#116699"&gt;Pronunciation Key&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;span class="pron_toggle" style="display:inline;"&gt;&lt;span class="prondelim"&gt;&lt;font color="#880000" face="Arial Unicode MS"&gt; - &lt;/font&gt;&lt;/span&gt;&lt;a class="pronlink" title="Click to show IPA pronunciation"&gt;&lt;u&gt;&lt;font color="#116699"&gt;Show IPA Pronunciation&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;font color="#116699"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="body"&gt;&lt;span class="pg"&gt;&lt;em&gt;&lt;font color="#558811"&gt;&amp;ndash;noun &lt;/font&gt;&lt;/em&gt;&lt;/span&gt;&lt;table class="luna-Ent"&gt;&lt;tr&gt;&lt;td class="dn"&gt;1.&lt;/td&gt;&lt;td&gt;a shortcoming, fault, or imperfection: &lt;span class="ital-inline"&gt;&lt;em&gt;a defect in an argument; a defect in a machine. &lt;/em&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;table class="luna-Ent"&gt;&lt;tr&gt;&lt;td class="dn"&gt;2.&lt;/td&gt;&lt;td&gt;lack or want, esp. of something essential to perfection or completeness; deficiency: &lt;span class="ital-inline"&gt;&lt;em&gt;a defect in hearing. &lt;/em&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;OK, easy enough right?&amp;nbsp; So the first meaning is clear; a defect is a shortcoming, fault, or imperfection.&amp;nbsp; It is reasoned that a defect in a web-based application results when functionality X doesn&amp;#39;t work as required.&amp;nbsp; Say you have a button, and the &lt;em&gt;functional specification&lt;/em&gt; (we&amp;#39;ll get back to this gem in a minute) calls for the button to perform some action, A.&amp;nbsp; During the testing phase of the application, before release to production, a tester or tool is utilized to test the functionality of that button, but instead of action A happening, some other action B happens.&amp;nbsp; This is a defect.&amp;nbsp; There is no doubt in anyone&amp;#39;s mind that this immediately gets classified as a defect, put into the defect tracking system and sent back to the developer for remediation.&amp;nbsp; The defect is classified as a higher-priority defect if the function happens to be one that is showcased, or important to the overall functionality of the application.&amp;nbsp; Those of you that already use the HP Quality Center tools know exactly what I&amp;#39;m talking about, and know how this process works.&amp;nbsp; Here&amp;#39;s the strange twist though - why is quality testing only done with &lt;em&gt;good data&lt;/em&gt;?&amp;nbsp; I understand that you want to make sure that the test cases work properly - but why are the testing options limited?&amp;nbsp; The issue at hand here is a very narrow view of defects, and defect testing.&lt;/p&gt;&lt;p&gt;Back in college, I took very basic programming class and had to write a program that was a calculator.&amp;nbsp; It would ask for two inputs of numbers, and then give you an option to perform either an addition, subtraction, multiplication or division of the inputs.&amp;nbsp; Generally, it was assumed that these would be numbers, but what if they weren&amp;#39;t numbers?&amp;nbsp; Most of the students in the class, myself included, never thought about ... &amp;quot;What if someone enters a letter or some other unexpected input?&amp;quot;&amp;nbsp; Well, luckily, the professor chose my application, put it up on the screen for the whole class to see, and promptly entered a and b for the two inputs and tried to add them.&amp;nbsp; When my application core dumped, he explained to the class why I had gotten my first F on a project.&amp;nbsp; I learned a very valuable lesson that day - developers must brace their applications for unexpected input.&amp;nbsp; &amp;quot;Why would anyone want to enter something other than numbers?&amp;quot; wasn&amp;#39;t a good enough answer to explain why my application failed.&amp;nbsp; Let&amp;#39;s apply this lesson I learned back in college to today&amp;#39;s application programmers and functional testers.&lt;/p&gt;&lt;p&gt;Here are the reasons why I think security &lt;em&gt;vulnerabilities&lt;/em&gt; aren&amp;#39;t seen as &amp;quot;defects&amp;quot; in general...&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Security professionals have insisted that a vulnerability is its own separate category&lt;/strong&gt; - While it is true, some security vulnerabilities are a whole new level of &amp;quot;bad&amp;quot; they should be considered just like any other defect in the application for the sake of tracking and remediation.&amp;nbsp; Web platform managers are generally concerned with meeting the demands of their customers and producing code that is defect-free - and it&amp;#39;s our own fault that &amp;quot;vulnerabilities&amp;quot; of the security variety have become some ethereal, magical issue for security nerds to worry about.&amp;nbsp; This matter can only be fixed by changing the naming back... a vulnerability is a defect, period.&amp;nbsp; &lt;em&gt;Security vulnerabilities must be explained as &amp;quot;high-criticality defects&amp;quot; to developers, managers and customers otherwise this situation will never change.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Functional specifications rarely, if ever - call for for security validation&lt;/strong&gt; - Functional specifications aren&amp;#39;t written by security professionals, generally.&amp;nbsp; At best, security professionals have a chance to review the functional specification way too late into the process, while the code is being written and readied for production.&amp;nbsp; This is, once again, our own fault most of the time.&amp;nbsp; The answer to this dilemma is a two-pronged attack.&amp;nbsp; &lt;em&gt;We as security professionals must educate those that write functional specifications, and enlighten them to the need for security features.&amp;nbsp; At the same time, we must work hard to have an active input in the writing and release of functional specification documents.&amp;nbsp;&lt;/em&gt; These two vectors are critical to getting secure code as an end-product.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Programmers don&amp;#39;t typically think about malicious users&lt;/strong&gt; - While it would be great to think that one day all developers will inherently write secure code because they will have &amp;quot;learned&amp;quot; what security is, and how important it is to the application - the fact is that it&amp;#39;s a pipe dream.&amp;nbsp; Developers care about one thing... meeting functional specifications in the least amount of time possible, and moving on to the next project.&amp;nbsp; Developers like to write optimized code that accomplishes the required tasks in as little time as possible.&amp;nbsp; Solving #2 above will also partly solve this problem.&amp;nbsp; In addition, &lt;em&gt;developers must be given the tools (such as static and dynamic code analysis tools as plug-ins to their IDEs) to make their jobs easier&lt;/em&gt;.&amp;nbsp; It is not reasonable to expect developers to be security experts in all aspects, so we must arm them with the tools to be experts, without having to do too much extra work or they won&amp;#39;t use those tools.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;So what have we learned today?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Security vulnerabilities must be re-classified as easily-understandable &amp;quot;functional defects&amp;quot;&lt;/li&gt;&lt;li&gt;Funcitonal specifications must be written to include provisions for security validation&lt;/li&gt;&lt;li&gt;Quality professionals must be given the tools to test for &amp;quot;security defects&amp;quot; in web applications to close the loop in the lifecycle&lt;/li&gt;&lt;li&gt;Developers must be educated and also given the tools to write more secure code with minimal additional effort&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;-- I welcome your comments!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.communities.hp.com/securitysoftware/aggbug.aspx?PostID=75801" width="1" height="1"&gt;</description><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/defects/default.aspx">defects</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/vulnerabilities/default.aspx">vulnerabilities</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/security/default.aspx">security</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/functional+specification/default.aspx">functional specification</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/quality/default.aspx">quality</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/testing/default.aspx">testing</category><category domain="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/tags/development/default.aspx">development</category></item></channel></rss>