Static Security Testing (SAST)
🌟 Objective
To detect security vulnerabilities in source code before the application runs, through automated static analysis, ensuring:
- Early and continuous feedback to development teams;
- Traceability between code, findings and security requirements;
- Automated integration with the development cycle and CI/CD;
- Risk reduction without impact on productivity.
SAST is the foundation of shift-left validation - it detects flaws without the need to run the application.
🔍 What SAST is
SAST (Static Application Security Testing) analyses source code or bytecode to identify dangerous patterns, bad practices, logic flaws and potential vulnerabilities - without running the application.
It can be performed by:
- Language tooling (linters with security rules);
- Generic scanners (e.g. commercial tools);
- Configurable semantic engines (e.g. with custom rules).
⚠️ SAST is complementary to dynamic and manual testing - it does not replace runtime validation.
⚙️ How to apply
- Select the appropriate tool per stack (e.g. Node, Java, .NET, Python);
- Define minimum acceptance rules and thresholds (e.g. critical flaws block the build);
- Run automatically on every pull request and build pipeline;
- Emit findings with traceability by line of code and commit;
- Maintain a baseline of accepted findings vs new findings;
- Document exceptions and justify false positives, with AppSec follow-up.
💡 Suggestion: use tags on findings to associate requirements (e.g.
EX-REQ-205— illustrative identifier; it does not correspond to the Ch. 02 Requirements Catalogue) and mitigations.
✅ Good practices
- Run SAST locally (pre-commit) and in the pipeline (CI);
- Tune rules to reduce false positives and noise;
- Establish a clear policy of blocking findings by severity;
- Integrate with the backlog (e.g. Jira, Azure Boards) for triage and management;
- Validate the coverage of the analysis (e.g. ignored files, exclusions);
- Reassess configurations with each technological evolution.
📎 Cross-references
| Document | Relationship with SAST |
|---|---|
| Chapter 02 - Requirements | Validates EX-REQ-203, EX-REQ-205, EX-REQ-303 |
| Chapter 06 - Development | Reinforces secure coding practices |
| Chapter 07 - Secure CI/CD | See 07-validacoes-seguranca-integradas.md |
06-cobertura-e-priorizacao.md | Defines analysis targets and priorities |
08-gestao-findings.md | Ensures effective handling of the results |
09-feedback-equipa.md | Involvement of the teams in validation |
Illustrative identifiers (EX-…); they do not correspond to the Ch. 02 Requirements Catalogue.
🔒 SAST reduces the cost of fixing vulnerabilities by acting before execution - but it is only effective when configured with judgement, kept up to date and managed together with the developers.