Software Security Testing

The Security Testing practice is concerned with prerelease testing, including integrating security into standard quality assurance processes. The practice includes use of black-box security tools (including fuzz testing) as a smoke test in QA, risk-driven white-box testing, application of the attack model, and code coverage analysis. Security testing focuses on vulnerabilities in construction.

Security Testing Level 1

[ST1.1: 100] Ensure QA supports edge/boundary value condition testing.

QA efforts go beyond functional testing to perform basic adversarial tests and probe simple edge cases and boundary conditions, with no particular attacker skills required. When QA understands the value of pushing past standard functional testing that uses expected input, it begins to move slowly toward thinking like an adversary. A discussion of boundary value testing can lead naturally to the notion of an attacker probing the edges on purpose (for example, determining what happens when someone enters the wrong password over and over).

[ST1.3: 87] Drive tests with security requirements and security features.

QA targets declarative security mechanisms with tests derived from requirements and security features. A test could try to access administrative functionality as an unprivileged user, for example, or verify that a user account becomes locked after some number of failed authentication attempts. For the most part, security features can be tested in a fashion similar to other software features; security mechanisms based on requirements such as account lockout, transaction limitations, entitlements, and so on are tested with both expected and unexpected input. Software security isn’t security software, but testing security features is an easy way to get started. New software architectures and deployment models, such as with cloud, might require novel test approaches.

Security Testing Level 2

[ST2.1: 32] Integrate black-box security tools into the QA process.

The organization uses one or more black-box security testing tools as part of the QA process. Such tools are valuable because they encapsulate an attacker’s perspective, albeit generically; tools such as IBM Security AppScan or Fortify WebInspect are relevant for web applications, while Prowler is relevant for AWS deployments. In some situations, other groups might collaborate with the SSG to apply the tools. For example, a testing team could run the tool but come to the SSG for help interpreting the results. Because of the way testing is integrated into agile development approaches, black-box tools might be hooked into toolchains or be used directly by engineering. Regardless of who runs the black-box tool, the testing should be properly integrated into the QA cycle of the SSDL.

[ST2.4: 15] Share security results with QA.

The SSG or others with security testing data routinely share results from security reviews with those responsible for testing. Using testing results as the basis for a conversation about common attack patterns or the underlying causes of code vulnerabilities allows QA to generalize that information into new test approaches. CI/CD makes this easier because of the way testing is integrated into the cross-functional team. Over time, QA learns the security mindset, and the organization benefits from an improved ability to create security tests tailored to the organization’s code.

[ST2.5: 9] Include security tests in QA automation.

Security tests are included in an automation framework and run alongside other QA tests. While many groups trigger these tests manually, in a modern toolchain, these tests are likely part of the pipeline and triggered through automation. Security tests might be derived from abuse cases identified earlier in the lifecycle, from creative tweaks of functional tests, developer tests, security feature tests, or even from guidance provided by penetration testers on how to reproduce an issue.

[ST2.6: 9] Perform fuzz testing customized to application APIs.

QA efforts include running a customized fuzzing framework against APIs critical to the organization. They could begin from scratch or use an existing fuzzing toolkit, but the necessary customization often goes beyond creating custom protocol descriptions or file format templates to giving the fuzzing framework a built-in understanding of the application interfaces it calls into. Test harnesses developed explicitly for particular applications make good places to integrate fuzz testing.

Security Testing Level 3

[ST3.3: 2] Drive tests with risk analysis results.

Testers use architecture analysis results (see [AA 2.1 Define and use AA process]) to direct their work. If the AA determines that “the security of the system hinges on the transactions being atomic and not being interrupted partway through,” for example, then torn transactions will become a primary target in adversarial testing. Adversarial tests like these can be developed according to risk profile, with high-risk flaws at the top of the list.

[ST3.4: 1] Leverage coverage analysis.

Testers measure the code coverage of their security tests (see [ST2.5 Include security tests in QA automation]) to identify code that isn’t being exercised. In turn, code coverage analysis drives increased security testing depth. Standard-issue black-box testing tools achieve exceptionally low coverage, leaving a majority of the software under test unexplored, which isn’t a testing best practice. Coverage analysis is easier when using standard measurements such as function coverage, line coverage, or multiple condition coverage.

[ST3.5: 2] Begin to build and apply adversarial security tests (abuse cases).

Testing begins to incorporate test cases based on abuse cases (see [AM2.1 Build attack patterns and abuse cases tied to potential attackers]) as testers move beyond verifying functionality and take on the attacker’s perspective. One way to do this is to systematically attempt to replicate incidents from the organization’s history. Abuse and misuse cases based on the attacker’s perspective can also be derived from security policies, attack intelligence, standards, and the organization’s top N attacks list (see [AM2.5 Build and maintain a top N possible attacks list]). This effort turns the corner from testing features to attempting to break the software under test.