Is Penetration Testing Security Testing?

Some people start “Security Testing” by buying and using a pen-test tool on project. Such tools uncover security vulnerabilities (though they seldom help with root cause analysis or even obtaining double-digit code coverage).

These tools are degenerate, at best, in facilitating a security testing strategy. Why? Because, these tools are “black box” tools. What are black box tools?

The term “black box” stems from old testing literature and means “without internal knowledge”. An external perspective has always excluded “code” but sometimes goes as far as (in my opinion appropriately) software design. Obviously, you need to know something about the application’s architecture and design to test it though and the slope gets slippery.

In the realm of penetration testing, the term “black box” often has meaning beyond the tester’s knowledge of the product. OSSTM defines “black box” to mean that neither attacker nor defender are given knowledge of each other. They mean for this test procedure to accurately represent the kinds of opportunities, need for stealth, accessibility, and exploit that a real attacker would have, and also to evaluate the defender’s abilities to identify and prevent or recover from attack.

Because black box tools to a large extent run canned tests they will not satisfy my security testing goal (see previous entry) of having run tests that one traces back to requirements. ‘Requirements that one created as a result of doing risk analysis that determines exactly what behaviors (and their impacts) should be avoided were the software attacked.

Arguably, security folk have “cached” this risk analysis and these implicit requirements in the pen testing tool. Fine, this is that small benefit that I mentioned pen tests do provide. And, they DO find bugs. Again, this is at best a degenerate case of security testing in the same way running a fuzz testing tool is a degenerate way of conducting functional testing.

For QA folk wary of accepting the previous statement, it will suffice to say that you wouldn’t defend your job based on achieving less than fifty percent coverage would you?

Vendors have begun using hybrid approaches (this will only become more common). Do these approaches solve our coverage problem and allay our concerns?

I demo’d Compuware’s DevPartner, which has a poorly advertised (and perhaps now nacent) security scanning capability, a few years back and was pretty impressed with the start they had made in hybrid .NET analysis. I’m not sure where it’s gone since then. Fortify’s PTA also combines static and dynamic analyses to help prioritize static findings and provide root cause analysis for dynamic ones.

These hybrid tools don’t get our security testers off the hook either though, as they’re still not addressing the project-specific risk analysis nor are they anchoring tests in requirements.

One Response to “Is Penetration Testing Security Testing?”

  1. Andre Gironda Says:

    From a book I recently read:

    Functional (black-box) methods can be applied to any unit, build, or system, since they assume no knowledge of how either was constructed or what it contains. Such methods require a sufficient and unambiguous specification if they are to be effective. (Devising black-box tests for some code from its specification at the time the specification is written is a useful verification of the specification; if it can’t be done, the specification isn’t good enough). This is what you will normally do for a system test.

    Structural (white-box) methods can also be used on any unit or build, but are cheapest to devise when used on structured programs, e.g., well-written programs in a structured language. These are usually applied to unit tests.

    Dynamic analysis techniques are derivative methods which assume that a particular technique such as condition tables, finite state machines, object-orientation, or functional programming, has been used to develop the software; we use knowledge of that technique to determine the test cases, so these have very special areas of application. These can be applied at both system test and
    unit test times. These are usually applied to unit tests.

    Static analysis techniques can best be used before integration, and can also point to the need for
    more-rigorous unit testing. These require using tools to analyze the source code. These are usually applied to unit tests.

    Symbolic evaluation carried out by an automated symbolic evaluation tool places no special requirement on the unit, except of course that it be in the language evaluated by the tool. This involves “dry-running” the code, and recording the output values of variables algebraically
    rather than using specific values for input variables. This is usually applied to unit tests.

    Coverity, Valgrind, Purify, Insure++ — these are all dynamic analysis tools. However, none of these are `black box’ tools. In fact, dynamic analysis is usually a white-box (structural) activity, just as code coverage is also a structural / white-box activity.

    Fortify SCA, Ounce, and SPIN are examples of static analysis tools in the classic sense that you only refer to.

    I often consider all requirements gathering analysis tools (e.g. HP/Mercury TestDirector, IBM/Rational RequisitePro, NASA SATC ARM) to be static analysis tools, even though the definition above doesn’t factor these tools in. In some ways, you don’t hit on the importance of requirements enough, but you’re mixing a lot of testing/inspection methods. Let me see if I can be of some assistance here.

    There are tools strictly outside of static analysis that perform code comprehension or other analysis of source code. Examples include SciTools Understand, Clover, EMMA, PartCover, NCover, tcov, gcov, and lcov. Some of these require integration. I would prefer to put most tools in a separate “code comprehension” category. The word `hybrid’ is simply too generic and confusing for iterative purposes.

    In summary:
    1) Black-box testing - EP, BVA, feature tests
    2) White-box testing - Code comprehension, dynamic analysis
    2a) Code-comprehension/coverage (white-box) - Statement, decision, condition, multiple-condition, LCSAJ, path analysis
    2b) Dynamic analysis (white-box) - runtime tests usually done with a symbol table, assertion tests, source tracing
    3) Static analysis - DFA, CFA, function value analysis, symbolic execution, mutation tests, fault-injection
    3a) Fault-injection - input-based fuzz tests to cause crashes (e.g. stack-based buffer overflow), input tests propagate to output (e.g. cross-site scripting), input tests propagate to function pointer (e.g. heap overflows), etc

    Compuware SecurityChecker and Fortify PTA are fault-injection tools (not hybrids, sorry!). However, CUTE is an example of a real hybrid tool that also supports symbolic execution. However, CUTE is also technically a fuzz testing tool!

    Regardless, these are static analysis tools. There is no such thing as a hybrid tool in the way that you speak of. There is no gray-box. There is no way to combine a dynamic analysis tool with a static analysis tool (special note below).

    You are correct in identifying that most other classic penetration-testing tools are black-box “feature testing” tools. I think that some classically labeled fuzz testing tools are mislabeled, and they are actually quite more like EC/BVA tools for negative testing.

    Real fuzz testing tools are fault-injectors, which are static analysis tools that have access to code. Note that source code is not necessary thanks to binary and bytecode disassembly and decompilation.

    PaiMei is a type of hybrid tool that crosses the dynamic and static analysis boundaries. Your holy grail is basically a tool that uses the control-flow path of execution information from dynamic analysis and combines it with output from a DFA (static analysis). Great idea, but it’s lacking quite a bit of important information, such as the data values.

    See: P. Fairfield, D. Hedley, and M. A. Hennell. Test coverage analysers. Alvey deliverable A35. Alvey Directorate. Project SE/031.

Leave a Reply



Resources
> Overview
> Your Account
> Podcast
> Blog
> Case Studies
> White Papers
> Publications
> Books
> Security Articles
> Presentations


RSS

About the Bloggers
  • Pravir Chandra
  • Scott Matsumoto
  • Gary McGraw
  • Sammy Migues
  • Craig Miller
  • John Steven
  • Categories
  • Admin (3)
  • Assurance (6)
  • Data Security (3)
  • Defects, Bugs, and Flaws (3)
  • Enterprise Software Security (11)
  • General Interest (3)
  • Governance and Regulation (5)
  • Risk Management (4)
  • Security Features (2)
  • SOA and Web 2.0 (2)
  • Software Quality (4)
  • Software Security (32)
  • Software Security Touchpoints (7)
  • Software Testing (2)
  • Training (3)
  • Archives
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • By Blogger
  • Craig
  • Gary
  • John
  • Pravir
  • Sammy
  • Scott
  • Guest bloggers
  • Recent Comments
  • gem on Three New Books: Thanks Adam (and sorry not to make your role explicit Andrew). I’m...
  • Adam on Three New Books: Thanks Gary! your copy is on its way. Just a little nit, I’m the...
  • Andre Gironda on Is Penetration Testing Security Testing?: From a book I recently read: Functional...
  • Tom Van Vleck on Security And Market Forces: I can’t come up with a number for how much money I...
  • -jOHN on Security And Market Forces: Tim, I’ll let the next 12-24 months of...
  • Recent Entries
  • Unsafe at any bitrate?
  • Three New Books
  • Is Penetration Testing Security Testing?
  • Externalizing Access Control Quandary
  • Making a move
  • Links
  • Cigital
  • Silver Bullet Podcast
  • Blogroll
  • 1 Raindrop
  • Fortify Software's Blog
  • Freedom to Tinker
  • In the Wild
  • Jon Udell
  • Michael Howard's Blog
  • Microsoft Security Vulnerability Research and Defense
  • News.com Security Blog
  • Schneier on Security
  • Security Fix
  • SilverStr's Blog
  • Tao Security