Files
nexus/wiki/concepts/SAST.md

1.6 KiB
Raw Blame History

SAST (Static Application Security Testing)

Definition

SAST tools analyze an application's source code to identify security vulnerabilities without executing the code. They excel at spotting common issues such as SQL injection, cross-site scripting, and buffer overflows.

Aliases

  • Static Application Security Testing
  • White-box testing
  • Static analysis

Characteristics

  • 无需运行代码:在静态状态下分析源代码
  • 白盒测试:能看到代码内部结构
  • 开发阶段适用:在编码和代码审查时使用
  • 速度快:可以快速扫描大量代码

Common Vulnerabilities Detected

  • SQL 注入SQL Injection
  • 跨站脚本XSS, Cross-Site Scripting
  • 缓冲区溢出Buffer Overflow
  • 硬编码凭证Hardcoded Credentials
  • 不安全的加密使用
  • 路径遍历Path Traversal

Tools

  • SonarQube — 代码质量和安全分析
  • Checkmarx
  • Veracode
  • Fortify
  • Semgrep

Integration

SAST 工具通常集成到:

  • IDE 开发环境
  • CI/CD 构建管道
  • 代码审查流程

Limitations

  • 可能产生误报False Positives
  • 无法检测运行时问题
  • 需要源代码访问权限
  • 不检测配置问题
  • DevSecOps — SAST 是其重要组件
  • DAST — 动态应用安全测试(黑盒测试)
  • IAST — 交互式应用安全测试
  • SCA — 软件组成分析
  • Shift-Left-Security — SAST 是左移策略的重要工具

Sources