Skip to content

Conversation

@tduhamel42
Copy link
Collaborator

Summary

Implements Issue #5 - Python SAST workflow that combines three static analysis tools:

  • Dependency scanning (pip-audit) for CVE detection
  • Security linting (Bandit) for vulnerability patterns
  • Type checking (Mypy) for type safety issues

Changes

New Modules

  • DependencyScanner: Scans Python dependencies for known CVEs using pip-audit
  • BanditAnalyzer: Analyzes Python code for security issues using Bandit
  • MypyAnalyzer: Checks Python code for type safety issues using Mypy

New Workflow

  • python_sast: Temporal workflow that orchestrates all three SAST tools
    • Runs tools in parallel for fast feedback (3-5 min vs hours for fuzzing)
    • Generates unified SARIF report with findings from all tools
    • Supports configurable severity/confidence thresholds

Updates

  • Added SAST dependencies to Python worker (bandit, pip-audit, mypy)
  • Updated module __init__.py files to export new analyzers
  • Added type_errors.py test file to vulnerable_app for Mypy validation

Testing

Workflow tested successfully on vulnerable_app:

  • ✅ Bandit: Detected 9 security issues (command injection, unsafe functions)
  • ✅ Mypy: Detected 5 type errors
  • ✅ DependencyScanner: Ran successfully (no CVEs in test dependencies)
  • ✅ SARIF export: Generated valid SARIF with 14 total findings

Test Plan

  • Python worker builds successfully with new dependencies
  • Workflow appears in ff workflows list
  • All three SAST modules execute correctly
  • SARIF report generated with findings from all tools
  • Findings viewable via CLI (ff findings get)

Closes #5

Implements Issue #5 - Python SAST workflow that combines:
- Dependency scanning (pip-audit) for CVE detection
- Security linting (Bandit) for vulnerability patterns
- Type checking (Mypy) for type safety issues

## Changes

**New Modules:**
- `DependencyScanner`: Scans Python dependencies for known CVEs using pip-audit
- `BanditAnalyzer`: Analyzes Python code for security issues using Bandit
- `MypyAnalyzer`: Checks Python code for type safety issues using Mypy

**New Workflow:**
- `python_sast`: Temporal workflow that orchestrates all three SAST tools
  - Runs tools in parallel for fast feedback (3-5 min vs hours for fuzzing)
  - Generates unified SARIF report with findings from all tools
  - Supports configurable severity/confidence thresholds

**Updates:**
- Added SAST dependencies to Python worker (bandit, pip-audit, mypy)
- Updated module __init__.py files to export new analyzers
- Added type_errors.py test file to vulnerable_app for Mypy validation

## Testing

Workflow tested successfully on vulnerable_app:
- ✅ Bandit: Detected 9 security issues (command injection, unsafe functions)
- ✅ Mypy: Detected 5 type errors
- ✅ DependencyScanner: Ran successfully (no CVEs in test dependencies)
- ✅ SARIF export: Generated valid SARIF with 14 total findings
@tduhamel42 tduhamel42 merged commit 1c3c7a8 into dev Oct 22, 2025
14 checks passed
@tduhamel42 tduhamel42 deleted the feature/python-sast-workflow branch October 22, 2025 13:55
tduhamel42 added a commit that referenced this pull request Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants