Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DevSecOps security scanner for automated vulnerability detection in CI/CD pipelines

License

Notifications You must be signed in to change notification settings

Kali-ai007/SecureFlow

Repository files navigation

πŸ”’ SecureFlow - DevSecOps Security Scanner

Automated multi-scanner vulnerability detection for CI/CD pipelines with web dashboard

Python Security Scanners Findings License Status


🎯 Overview

SecureFlow is a comprehensive DevSecOps security scanning orchestrator that integrates multiple industry-standard security tools into a unified platform. It detects vulnerabilities in source code, dependencies, and secrets, presenting findings through both a beautiful CLI and an interactive web dashboard.

🌟 Why SecureFlow?

Most security tools work in isolation. SecureFlow orchestrates them all:

Your Code β†’ SecureFlow β†’ Semgrep (Code Analysis)
                      β†’ Trivy (Dependencies)
                      β†’ TruffleHog (Secrets)
                      β†’ Unified Report + Dashboard

πŸš€ Features

Core Scanning

  • πŸ” SAST - Semgrep static code analysis
  • πŸ“¦ SCA - Trivy dependency vulnerability scanning
  • πŸ”‘ Secret Detection - TruffleHog git history scanning
  • πŸ“Š Unified Reporting - Aggregated results from all scanners
  • πŸ’Ύ JSON Export - Machine-readable results for CI/CD

Web Dashboard

  • 🌐 Interactive Dashboard - Beautiful web interface
  • πŸ“ˆ Visual Charts - Severity and scanner breakdown
  • 🎨 Modern UI - Clean, responsive design
  • πŸ“‹ Detailed Reports - Vulnerability details view

CLI Interface

  • 🎨 Colored Output - Color-coded severity indicators
  • πŸ“‚ Smart Categorization - By type and severity
  • πŸ”§ Flexible Options - Run individual or all scanners

πŸ“Š Detection Capabilities

Category Tool Severity
Code Injection Semgrep πŸ”΄ Critical
SQL Injection Semgrep πŸ”΄ Critical
Command Injection Semgrep πŸ”΄ Critical
XSS Semgrep πŸ”΄ Critical
Hardcoded Secrets Semgrep + TruffleHog πŸ”΄ Critical
Path Traversal Semgrep 🟠 High
Vulnerable Dependencies Trivy 🟠 High
Weak Cryptography Semgrep 🟑 Medium
Security Misconfig Semgrep 🟑 Medium
Template Injection Semgrep πŸ”΄ Critical

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/kksr1994/SecureFlow.git
cd SecureFlow

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Verify all tools
python3 cli/main.py check

CLI Usage

# Check tools
python3 cli/main.py check

# Scan with Semgrep (code analysis)
python3 cli/main.py scan -t /path/to/project -s semgrep

# Scan with Trivy (dependencies)
python3 cli/main.py scan -t /path/to/project -s trivy

# Scan with TruffleHog (secrets)
python3 cli/main.py scan -t /path/to/project -s trufflehog

# Run ALL scanners with unified report
python3 cli/main.py scan -t /path/to/project -s all

# Show all findings
python3 cli/main.py scan -t /path/to/project -s all --all

Web Dashboard

# Start dashboard
python3 dashboard/app.py

# Open browser
# http://localhost:5000

πŸ“Š Example Output

╔═══════════════════════════════════════════════════════╗
β•‘              πŸ”’ SECUREFLOW v2.0 πŸ”’                   β•‘
β•‘     Your DevSecOps Security Scanner Orchestrator     β•‘
β•‘              Now with 3 Integrated Scanners!         β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

================================================================================
πŸ“Š SECUREFLOW UNIFIED SECURITY REPORT
================================================================================

πŸ• Scan Time: 2026-02-16T16:24:05
πŸ”§ Scanners Used: Semgrep, Trivy, TruffleHog

πŸ“ˆ OVERALL SUMMARY:
   Total Security Findings: 32

🎯 By Severity:
   πŸ”΄ CRITICAL: 12
   🟠 HIGH:     2
   🟑 MEDIUM:   18
   🟒 LOW:      0

πŸ” By Scanner:
   Semgrep (SAST): 27 findings
   Trivy (SCA): 4 findings
   TruffleHog (Secrets): 1 finding

πŸ’‘ RECOMMENDATIONS:
   ⚠️  12 CRITICAL issues require IMMEDIATE attention!
   🟠 2 HIGH severity issues should be fixed soon
   🟑 18 MEDIUM issues - plan to address
================================================================================

πŸ—οΈ Project Structure

SecureFlow/
β”œβ”€β”€ cli/
β”‚   └── main.py                      # CLI interface
β”œβ”€β”€ scanners/
β”‚   β”œβ”€β”€ semgrep_scanner.py           # SAST scanning
β”‚   β”œβ”€β”€ trivy_scanner.py             # Dependency scanning
β”‚   └── trufflehog_scanner.py        # Secret detection
β”œβ”€β”€ aggregator/
β”‚   └── result_aggregator.py         # Unified reporting
β”œβ”€β”€ dashboard/
β”‚   β”œβ”€β”€ app.py                       # Flask web server
β”‚   β”œβ”€β”€ templates/dashboard.html     # Web UI
β”‚   └── static/css/style.css         # Styling
β”œβ”€β”€ data/scans/                      # JSON results
β”œβ”€β”€ docs/LEARNING_LOG.md             # Dev journey
β”œβ”€β”€ test-apps/
β”‚   β”œβ”€β”€ vulnerable-app/              # Insecure examples
β”‚   └── secure-example/              # Secure examples
└── requirements.txt

πŸ“ˆ Development Journey

Day 1 - Foundation

  • Environment setup (Kali Linux, Python, tools)
  • Project structure and architecture
  • Tool verification

Day 2 - Core Scanner

  • Semgrep SAST integration
  • CLI tool with colored output
  • Found 27 vulnerabilities in test app!

Day 3 - Multi-Scanner

  • Trivy dependency scanner
  • TruffleHog secret scanner
  • Result aggregator and unified report
  • Secure coding examples with encryption
  • Total: 32 vulnerabilities detected!

Day 4 - Web Dashboard

  • Flask web server
  • Interactive HTML dashboard
  • Chart.js visualizations
  • Severity and scanner charts
  • Recommendations display

🚧 Roadmap

Completed

  • Semgrep SAST integration
  • Trivy SCA integration
  • TruffleHog secret detection
  • Multi-scanner orchestration
  • Unified security report
  • Web dashboard with charts
  • Secure coding examples
  • CLI with colored output

Planned

  • PDF report generation
  • GitHub Actions integration
  • Docker containerization
  • Auto-fix suggestions
  • Risk scoring algorithm
  • Slack notifications
  • Custom rule creation
  • SARIF format export

πŸ”’ Security Examples

Vulnerable Code

# SQL Injection - BAD
sql = f"SELECT * FROM users WHERE name = '{user_input}'"

# Command Injection - BAD
os.system(f'ping -c 1 {user_input}')

# Hardcoded Secret - BAD
API_KEY = "sk_live_abc123"

Secure Code

# SQL Injection prevention
cursor.execute("SELECT * FROM users WHERE name = ?", (user_input,))

# Command Injection prevention
subprocess.run(['ping', '-c', '1', host], capture_output=True)

# Secrets management
API_KEY = os.getenv('STRIPE_API_KEY')

🎯 CI/CD Integration

# .github/workflows/security.yml
name: Security Scan
on: [push, pull_request]
jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run SecureFlow
        run: |
          pip install semgrep
          python3 cli/main.py scan -t . -s all

πŸ“Š Statistics

Metric Value
Lines of Code 1,800+
Files Created 20+
Scanners 3
Vulnerabilities Detected 32
Development Days 4
Commits 9+

πŸ›‘οΈ Security Notice

The test-apps/vulnerable-app/ directory contains intentionally vulnerable code for educational purposes. All API keys are FAKE test data. See test-apps/secure-example/ for proper security practices.


🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/AmazingFeature
  3. Commit: git commit -m 'Add AmazingFeature'
  4. Push: git push origin feature/AmazingFeature
  5. Open a Pull Request

πŸ“ License

MIT License - Copyright (c) 2026 kksr1994


πŸ‘¨β€πŸ’» Author

kksr1994 - Security Enthusiast & Developer


πŸ™ Acknowledgments

  • Semgrep, Trivy, TruffleHog teams
  • OWASP for security resources
  • Chart.js for visualizations
Screenshot 2026-02-16 231544 Screenshot 2026-02-16 230825 Screenshot 2026-02-16 230818 Screenshot 2026-02-16 230811

⭐ Star this repo if you found it useful!

Built with ❀️ over 4 intensive days of learning DevSecOps