Static application security testing


Static application security testing is part of technologies used to secure software by reviewing the source code of the software to identify sources of vulnerabilities. Although the process of statically analyzing the source code exists since computers exist, the technic largely expanded to security in the late 90s when Web applications integrated new technologies like JavaScript and Flash and the first public discussion of SQL injection in 1998.
Unlike dynamic application security testing tools performing Black-box testing based on functionalities of applications, SAST tools focus on the technical content of the application by doing White-box testing.
A SAST tool is a program that scans the source code of applications and its components to identify potential security vulnerabilities in the software and within its architectural organization.
It is estimated that static analysis tools can detect about 50% of existing security vulnerabilities..
Within the SDLC, SAST is performed early in the development process and is done at code level during the development process but also and when all pieces of code and components are put together using a consistent testing environment. SAST is based on static analysis which is also used to ensure quality of software even if the large rate of false-positive is slowing down the adoption by developers.
SAST tools are integrated into the development process to help development teams as they are primarily focusing on developing and delivering software respecting requested specifications.
SAST tools, like other security tools, focus on reducing the risk of downtime of applications or that private information stored in applications will not be compromised.
For the year of 2018, the Privacy Rights Clearinghouse database shows that more than 612 millions of records have been compromised by hacking.

Overview

The specific domain of application security is based on numerous tests of applications before they are released. To do so, there are different technics used: static application security testing, dynamic application security testing, and interactive application security testing which is a combination of two previous technics.
Static analysis tools examine the text of a program syntactically. They look for a fixed set of patterns or rules in the source code. Theoretically, they can also examine a compiled form of the software. This technic relies on instrumentation of the code to do the mapping between compiled components and source code components to identify issues.
Static analysis can be done manually in a form of code review or auditing of the code for different purposes, including security. Although, it is time-consuming.
The precision of SAST tool is determined by its scope of analysis and techniques used to identify vulnerabilities. Different Level of analysis are:
The scope of analysis determines its accuracy and capacity in detecting vulnerabilities by using a wider contextual information.
Depending on the scope of the analysis, different techniques are used by SAST tools. At a function level, a common technique used is the construction of an Abstract syntax tree to control the flaw of data within the function.
Since late 90s, the need for adaptability to business challenges transforms the software development into a componentization of software enforced by processes and organization of development teams.
Following the flaw of data among all the components of an application or group of applications allows to validate that required calls to dedicated procedures for sanitization and that proper actions are taken to taint data in specific pieces of code.
The rise of web applications implied a focus on testing them: it is reported by Verizon Data Breach that 40% of all data breaches were achieved using web application.
At the opposite of external security validations, there is a rise in focusing on internal threats. It is reported by the Clearswift Insider Threat Index that 92% of their respondents in a 2015 survey that they experienced IT or security incidents in the past 12 months and 74% of these breaches were originated by insiders. Lee Hadlington categorized internal threats in 3 categories: Malicious, Accidental, and Unintentional. Mobile applications growing explosively implies securing application earlier in the development process to reduce malicious code development.

SAST strengths

The earlier a vulnerability is fixed in the SDLC, the cheaper it will cost. Common measures of costs for fixing during the development is 10 times less than during the testing stage and 100 times less than during the production stage.
SAST tools are run automatically, either at the code level or application-level and do not require manual activities. When integrated into a CI/CD context, SAST tools can be used to automatically stop the integration process if critical vulnerabilities are identified
Because the tool is scanning the entire source-code, it can cover 100% of it when dynamic application security testing covers the execution resulting in the possibility to miss part of the application or missing unsecured configuration located in configuration files.
SAST tools can offer extended functionalities such as quality and architectural testing. In that case, the extension of security to these subjects enforces the security as there is a direct correlation between the quality and the security. Bad quality software are also poorly secured software

SAST weaknesses

Even though developers are positive about the usage of SAST tools, there are different challenges with the adoption of SAST tools by developers.
With the development of Agile Processes into software development, the integration of SAST early in the process results in many problems as developers focus first on features and delivering something.
Scanning a large amount of line of code with SAST tools may result in hundreds or thousands of vulnerability warnings for a single application. It generates a large number of false-positives increasing the investigation time and reducing the trust in such tools. This is particularly the case when the context of the vulnerability cannot be caught by the tool