When To Choose Static vs. Dynamic Testing for a Website

Screen Shot 2013-11-05 at 3.01.32 PM.png

 

Baselining

 

Before we look at the tradeoffs between dynamic and static testing, let's do a quick levelset on what the difference between dynamic and static testing is:

 

  • Static Testing technically means the app is being tested while it's not running, and it looks at the source code for an application. Using various techniques for analysis, static analysis (specifically source code analysis) can find security issues within the code that will manifest as vulnerabilites on the running website.
  • Dynamic Testing takes the opposite approach and looks at the web app while it's in operation, and it focuses not on what you can see from the inside looking out, but rather what a malicous actor from the outside can see.

Pro/Con Discussion

 

All web tests are different, so it's difficult to lock down a specific list of considerations. But we can cover some basics.

 

  1. How much time do you have? If you have a long time window the first question is why you're not doing both. But if you have to choose I'd say that a comprehensive source code audit would be the best use of your time.  If, on the other hand, you are starved for time and need results in a matter of a couple of hours, a skilled web pentester is likely to be able to point out your most critical issues before source code analysis can yield quality fruit.
  2. What type of website is it? If you're looking at a high security site, e.g. for the miltary, static analysis is likely the best approach because it has the whitebox visibility to see the most issues with the code. If the site is heavy on business logic, however, the slider once again moves towards dynamic testing. The more interaction that's present that can be broken without violating rules visible to static analysis tools, the more manual and dynamic testing is required.
  3. What Testing Resources Do You Have Available? If time is of the essence the worst thing you can do is become a victim of analysis paralysis. Consider the questions above, but also realize that even a cursory look with either static or dynamic techniques will likely yield serious issues that need to be fixed. Consider simply leveraging the type of testing that you have more talent in at the time.

It must be stated again that this should be a false choice in most cases. If the site matters to any significant degree, both types of testing should be done. But we're purposely looking at the pros/cons here.

 

Also keep in mind that both static and dynamic testing have their automated and manual counterparts. Running an automated source code analysis tool like SCA does not compare to a professional source code auditor spending a week looking at your application's source, just as running a web scanner doesn't compare to a veteran web tester beating up your site. This is especially true because those professionals doing the manual testing will be using tools like SCA and WebInspect to do their work.

 

It's also key to remember that the tester matters, whether we're talking about doing manual pentesting, or running tools that perform static and dynamic analysis. There's also the remediation component, which requires the developer(s) to actually fix the problems. So there are a number of moving parts here.

 

Summary

 

These aren't strict rules, but static testing is best used for extreme depth and when there is more time available. If you're in a time crunch or are facing functionality that can be circumvented by tricking the application's implementation of security features (e.g. password reset mechanism implementations, CAPTCHA, etc.) it's probably a better idea to look at the site first using dynamic testing because those types of issues aren't as easily discovered using static testing.

 

Know the app you're testing, know its pain points, and if you're ever forced to choose between static or dynamic testing, be sure to use the approach that best fits. And remember that if you're ever in that position for an important app, you likely have problems not addressable via either type of testing.

 

--

 

Daniel Miessler is a Principal Security Architect with HP Fortify and can be reached via Twitter at @danielmiessler.

 

Comments
Prophets_Epitaph(anon) | ‎11-05-2013 11:00 PM
Great, quality stuff! Useful, informative, and easy to implement! Thanks! -=PE=-
AJ_Murray | ‎11-14-2013 12:47 PM

Like the article, the author makes some excellent points "pro and con"  for Dynamic and Static testing (highly recommended BTW).  

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Search
Showing results for 
Search instead for 
Do you mean 
About the Author
http://www.danielmiessler.com/about
Featured


Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.