Glossary · Scanning and analysis

SAST (static application security testing)

Static application security testing (SAST) analyzes an application's own source code, bytecode or binaries for security weaknesses without executing it, such as injection, unsafe deserialization or disabled certificate checks.

SAST tools parse code into a structure they can query (an abstract syntax tree, a control-flow graph or a data-flow graph) and look for patterns associated with vulnerabilities. Simple rules match a single construct: a call to eval(), a hash function known to be weak, TLS verification switched off. More advanced engines perform taint tracking: they follow untrusted input from a source, such as an HTTP parameter, through the program to a dangerous sink, such as a database query, and report a finding only if no sanitiser intervenes. Rules are usually language-specific and are mapped to weakness classes such as CWE identifiers.

How it is used in practice

Because it needs only the code, SAST can run early: in an editor, in a pre-commit hook, or in CI on every change, which is why it is central to shift left. Results are commonly exchanged in SARIF so that code hosts can show them inline. Teams typically start with a small, high-confidence ruleset, gate builds only on those rules, and add rules as they learn which ones their codebase triggers falsely. SAST complements SCA, which covers third-party packages, and DAST, which tests the running application.

Common pitfalls

  • False positives. A pattern without data-flow context flags code that is safe; too many of these and developers stop reading the results.
  • False negatives. Single-pattern rules miss flaws that span files or functions, and no ruleset covers every weakness class in every language.
  • Unpinned rules. If the ruleset changes between runs, a finding can appear or disappear without any code change.
  • Suppression without review. Inline ignore comments are useful, but only if they are reviewed like any other change.

How TrustIvan relates to it

SAST ships in TrustIvan as an opt-in part of a repository scan. It runs Semgrep against the configured rules (SAST_RULES); the analyzer is not in the published backend image because of its LGPL license, so you build the provided Dockerfile.sast recipe yourself, and the worker reports static analysis as disabled until a working analyzer is present. The vendored ruleset is first-party: 302 rules across Go, Python, JavaScript, TypeScript, Java, C#, PHP, Ruby and Kotlin, 123 of them taint rules that follow an HTTP request value to a dangerous call such as a SQL query, a shell command or an outbound URL. Its limits are stated in the docs: taint tracking stops at the function boundary, only web request accessors count as sources, there are no rules for languages such as Swift, Rust or C/C++, and there are no per-tenant rules. Every finding records a digest of the ruleset that produced it. Findings can be exported as SARIF 2.1.0 for a code host to annotate a pull request; TrustIvan does not import SARIF or post inline comments itself. See Static analysis (SAST).

Related terms

Guides on SAST

On the platform: Container scanning. All glossary terms

See TrustIvan on your own estate.

Book thirty minutes with an engineer and bring an image, a repository or a cloud account, or start free on the hosted service.