SAST

Definition

Static Application Security Testing (SAST) is a white-box testing methodology that analyzes source code, bytecode, or binary code for security vulnerabilities without executing the program. It is typically integrated into the development process to identify security flaws early, allowing developers to address issues before the software is deployed. SAST tools can detect vulnerabilities such as SQL injection, cross-site scripting (XSS), and buffer overflows by examining the code structure and logic.

Secure Settings Example

# Example SAST configuration for a CI/CD pipeline using a generic SAST tool
sast:
  enabled: true
  fail_on_vulnerability: true
  include:
    - "**/*.java"
    - "**/*.js"
  exclude:
    - "test/**"
    - "vendor/**"
  rules:
    - id: "SQL_INJECTION"
      severity: "high"
    - id: "XSS"
      severity: "medium"

Insecure Settings Example

# Example of a misconfigured SAST setup
sast:
  enabled: false  # SAST is disabled, preventing any security analysis
  fail_on_vulnerability: false  # Vulnerabilities will not cause the build to fail
  include:
    - "**/*"  # No specific file types are targeted, leading to inefficient scanning
  exclude:
    - "**/node_modules/**"  # Excluding critical directories that may contain vulnerabilities