Skip to main content

Enterprise Security Framework for DevSecOps Integration

Project description

๐Ÿ›ก๏ธ SecFlow

Enterprise Security Framework for DevSecOps Integration

Python License Version Status

๐Ÿš€ New: Complete enterprise-ready security framework with advanced threat modeling, plugin system, and web interface!

โœจ Features

๐Ÿ”Œ Plugin System

  • Extensible architecture with custom scanners
  • Automatic plugin discovery and registration
  • Version management and dependencies

๐Ÿ“Š Elasticsearch Integration

  • Centralized result storage and analytics
  • Automatic index creation and mapping
  • Ready-to-use Kibana dashboards

๐Ÿ“ฌ Multi-Channel Notifications

  • Slack - Rich formatting with attachments
  • Microsoft Teams - Interactive cards
  • Email - HTML/text notifications

๐Ÿ›ก๏ธ Advanced Threat Modeling

  • Automatic codebase analysis
  • STRIDE threat generation
  • Mitigation recommendations
  • JSON/YAML export

๐ŸŒ Web Management Interface

  • Interactive dashboard
  • REST API for integrations
  • Real-time scan monitoring
  • CORS support for frontends

๐Ÿ” Security Scanners

  • SAST: Bandit, Semgrep, CodeQL
  • DAST: OWASP ZAP, Nuclei
  • Secrets: GitLeaks, TruffleHog
  • Dependencies: Safety, Snyk
  • Infrastructure: Checkov, Terrascan

๐Ÿš€ Quick Start

Installation

# Install from PyPI
pip install secflow

# Or install from source
git clone https://github.com/WaiperOK/SecFlow.git
cd SecFlow
pip install -e .

Basic Usage

from pyseckit import SecFlow

# Initialize SecFlow
sf = SecFlow()

# Run security scan
results = sf.scan(target="./my-project")

# Generate threat model
threat_model = sf.generate_threat_model("./my-project")

# Start web interface
sf.start_web_interface(port=8080)

CLI Usage

# Initialize configuration
secflow init

# Run comprehensive scan
secflow scan --target ./project --format json,html

# Start web interface
secflow web --port 8080

# Generate threat model
secflow threat-model --target ./project --output threats.json

# Test notifications
secflow test-notifications

๐Ÿ“‹ Configuration

Create .secflow.yml in your project root:

# Core settings
project_name: "My Secure Project"
target_directories: ["."]

# Scanners configuration
scanners:
  bandit:
    enabled: true
    severity_threshold: "medium"
  semgrep:
    enabled: true
    rules: ["security", "owasp-top-10"]

# Integrations
elasticsearch:
  enabled: true
  hosts: ["localhost:9200"]

# Notifications
notifications:
  slack:
    enabled: true
    webhook_url: "https://hooks.slack.com/..."
    channel: "#security"

# Web interface
web:
  enabled: true
  host: "0.0.0.0"
  port: 8080

# Plugins
plugins:
  discovery_paths: ["./plugins", "~/.secflow/plugins"]

๐Ÿ—๏ธ Architecture

SecFlow/
โ”œโ”€โ”€ ๐Ÿ“ฆ Core Modules
โ”‚   โ”œโ”€โ”€ pyseckit/core/          # Base functionality
โ”‚   โ”œโ”€โ”€ pyseckit/sast/          # Static analysis
โ”‚   โ”œโ”€โ”€ pyseckit/dast/          # Dynamic testing
โ”‚   โ”œโ”€โ”€ pyseckit/secret_scan/   # Secret detection
โ”‚   โ””โ”€โ”€ pyseckit/cloud/         # Infrastructure analysis
โ”‚
โ”œโ”€โ”€ ๐Ÿ”Œ Advanced Modules
โ”‚   โ”œโ”€โ”€ pyseckit/plugins/       # Plugin system
โ”‚   โ”œโ”€โ”€ pyseckit/integrations/  # External integrations
โ”‚   โ”œโ”€โ”€ pyseckit/threat_model/  # Threat modeling
โ”‚   โ””โ”€โ”€ pyseckit/web/           # Web interface
โ”‚
โ””โ”€โ”€ ๐Ÿ“Š Outputs
    โ”œโ”€โ”€ reports/                # Generated reports
    โ”œโ”€โ”€ dashboards/             # Kibana dashboards
    โ””โ”€โ”€ threat_models/          # Threat models

๐Ÿ”Œ Plugin Development

Create custom security scanners:

from pyseckit.plugins import ScannerPlugin, PluginMetadata

class MyCustomScanner(ScannerPlugin):
    def __init__(self, config):
        metadata = PluginMetadata(
            name="my-scanner",
            version="1.0.0",
            description="Custom security scanner",
            author="Your Name"
        )
        super().__init__(config, metadata)
    
    def scan(self, target):
        # Your scanning logic here
        return scan_results

๐ŸŒ REST API

SecFlow provides a comprehensive REST API:

# System status
GET /api/status

# Start scan
POST /api/scan
{
  "target": "./project",
  "scanners": ["bandit", "semgrep"]
}

# Get results
GET /api/results/{scan_id}

# Generate threat model
POST /api/threat-model
{
  "target": "./project",
  "format": "json"
}

๐Ÿš€ CI/CD Integration

GitHub Actions

name: SecFlow Security Scan
on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run SecFlow
        run: |
          pip install secflow
          secflow scan --target . --fail-on-critical

GitLab CI

security_scan:
  stage: test
  script:
    - pip install secflow
    - secflow scan --target . --format gitlab-sast
  artifacts:
    reports:
      sast: gl-sast-report.json

๐Ÿ“Š Enterprise Features

  • Multi-tenant support with role-based access
  • LDAP/SSO integration for enterprise authentication
  • Compliance reporting (SOC2, PCI-DSS, GDPR)
  • Custom rule engines for organization-specific policies
  • Audit trails and compliance tracking
  • High availability deployment options

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐ŸŒŸ Support

๐Ÿ† Acknowledgments

Built with โค๏ธ by the SecFlow team and contributors.


โญ Star us on GitHub if SecFlow helps secure your projects!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secflow-1.0.0.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secflow-1.0.0-py3-none-any.whl (74.3 kB view details)

Uploaded Python 3

File details

Details for the file secflow-1.0.0.tar.gz.

File metadata

  • Download URL: secflow-1.0.0.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for secflow-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e4b46d9c61bfbc42f7ed7f3d2783811e5b7930b04e88ce1061b2a48eb94665bd
MD5 5f7128aede3317652607812e3215569d
BLAKE2b-256 44bad2a20308d8574ba7611de6458c1c409e172cc10286c65b6882ea12d62862

See more details on using hashes here.

File details

Details for the file secflow-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: secflow-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 74.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for secflow-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed909be26e75b248ed644736d1ef50d0f9eb25b6ee65450b0166bf17142ee5ab
MD5 7cfd2fb3a4c9674616b4c8d529d1f836
BLAKE2b-256 42ad1e538f88341fd7905cf91f15e6ff9865fba7c439310ce567f21d6796d97d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page