This chapter discusses simulating failures in the application's environment, a process known as environment fault injection. When extraordinary conditions occur because of stress and the failure of dependencies, error-handling routines, if present, are executed. These are pathways thought the application that do not add to its functionality but are designed to keep the functional code from failing. Error-handling routines thought are notoriously subjected to far-less testing than the functional code that they are designed to protect. They are underrepresented because in the past causing environment faults has meant modifying the application's code directly and hard-coding bogus return values. To compound the problem, many failure situations are not envisioned during the designed stage, and error handlers are added as afterthought as vulnerability situations are encountered in the test lab.
With such limited exposure to testing, these code parts are fertile breeding grounds for bugs. Software can only be considered secure if it operated securely in all reasonable operating environments. Thus to have any realistic picture of an applications security vulnerabilities, it must be exposed to environmental failures.
There are three basic approaches to simulating environmental failures in a lab situation :
- Source-based fault injection : source-based fault injection can be complicated to achieve but is easy to explain : source statements are modified so that specific faulty behavior is attained. When faults are injected to trigger exceptions, source statements are added, so that internal data can be set values that cause exception conditions to evaluate to true. However, source based fault injection requires access to source code and, in most cases, the corporation of the original developers, which is not always given.
- Run-time fault Injection : Applications access external resources thought functions calls to the operating system, such as requesting memory, disk space etc. Run-time fault injection involved getting between the application and the OS and intercepting these calls.
No comments:
Post a Comment