Files
nexus/wiki/concepts/SAST.md
2026-04-27 16:26:34 +08:00

54 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "SAST"
type: concept
tags: [security, static-analysis, devsecops, sast]
sources: ["what-is-devsecops-best-practices-benefits-and-tools"]
last_updated: 2025-12-19
---
## Definition
SASTStatic Application Security Testing静态应用安全测试是一种在不运行应用程序的情况下通过分析源代码、字节码或二进制文件的结构和逻辑来发现安全漏洞的测试方法。
## Characteristics
- **白盒测试**:需要访问源代码
- **编码阶段使用**:在开发人员编写代码时即时发现漏洞
- **零运行时开销**:无需执行程序,不影响性能
- **高覆盖率**:可扫描整个代码库,发现逻辑复杂的安全问题
## Capabilities
SAST 工具擅长发现以下类型的漏洞:
- SQL 注入SQL Injection
- 跨站脚本XSS, Cross-Site Scripting
- 缓冲区溢出Buffer Overflow
- 硬编码凭据
- 不安全的直接对象引用
- 缺少输入验证
## Limitations
- 误报率较高(可能报告非真实漏洞)
- 无法发现运行时漏洞和配置问题
- 对第三方库的分析能力有限(见 [[SCA]]
## Typical Tools
- SonarQube
- Checkmarx
- Fortify
- Semgrep
- Bandit (Python)
## Relationship with DevSecOps
SAST 是 DevSecOps CI/CD 流水线的核心组成部分,通常在代码提交后自动触发,为开发人员提供即时反馈。属于 [[DevSecOps]] 工具链中的"左移"环节。
## Related Concepts
- [[DAST]] — 动态应用安全测试,与 SAST 互补
- [[IAST]] — 交互式应用安全测试,运行时分析
- [[SCA]] — 软件成分分析,扫描第三方依赖
- [[Shift Left]] — 左移策略SAST 是其核心实践