Skip to content

Latest commit

Β 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI-Augmented DevSecOps Framework

MIT License Python 3.8+ IEEE SOSE 2025

An AI-enhanced security automation framework for cloud-native applications, featuring real-time threat detection and automated response capabilities. This implementation accompanies the IEEE SOSE 2025 paper: "AI-Augmented DevSecOps Pipelines for Secure and Scalable Service-Oriented Architectures in Cloud-Native Systems".

🎯 Key Achievements

  • 95% attack detection rate with sub-2 second latency
  • 98% accuracy retention over 6 months with adaptive training
  • 10,000 events/sec throughput with optimized processing
  • Complete open-source implementation with reproducible results

πŸš€ Features

Core AI Components

  • LSTM Threat Detection Engine: 64-unit architecture with sliding window analysis
  • Zero-Day Behavioral Analysis: Isolation Forest with 25+ behavioral indicators
  • Security Orchestrator: Confidence-weighted conflict resolution
  • API Security Validator: BOLA detection and fuzzing capabilities
  • Business Logic Validator: Race condition and state violation detection

Integration & Deployment

  • Kubernetes Native: NetworkPolicy generation and pod isolation
  • CI/CD Integration: Jenkins pipeline with security gates
  • Prometheus Monitoring: Custom metrics and alerting
  • Helm Charts: Production-ready deployment
  • Terraform Infrastructure: Complete IaC setup

πŸ“Š Performance Benchmarks

System Precision Recall Latency(s) Throughput(eps) Resource Efficiency
Our Framework 0.95Β±0.02 0.94Β±0.03 1.5Β±0.2 10K 33% less CPU
Suricata 6.0.9 0.88Β±0.04 0.85Β±0.05 2.3Β±0.3 8K Baseline
Prisma Cloud 22.12 0.92Β±0.02 0.89Β±0.03 1.9Β±0.3 9K 16% more CPU

Statistical significance: p < 0.05, 95% confidence intervals

πŸ— Architecture

System Components

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   CI/CD Pipeline β”‚    β”‚  LSTM Detector  β”‚    β”‚ Zero-Day Engine β”‚
β”‚   (Jenkins)     │────│   (64 units)    │────│  (Behavioral)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Security Gates  β”‚    β”‚  Orchestrator   β”‚    β”‚ Policy Engine   β”‚
β”‚ (SAST/DAST)     │────│ (Conflict Res.) │────│ (NetworkPolicy) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Kubernetes    β”‚    β”‚   Prometheus    β”‚    β”‚  Message Bus    β”‚
β”‚   (Runtime)     │────│  (Monitoring)   │────│ (Event-Driven)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Prerequisites

  • Python 3.8+ with asyncio support
  • Docker 20.10+ and Docker Compose
  • Kubernetes 1.19+ cluster access
  • Jenkins 2.3x+ for CI/CD integration
  • Prometheus 2.30+ for monitoring
  • Helm 3.x+ for deployment
  • Terraform 1.0+ for infrastructure

Hardware Requirements:

  • CPU: 8+ cores (Intel/AMD x64)
  • RAM: 16+ GB
  • Storage: 100+ GB SSD
  • GPU: Optional (NVIDIA Tesla V100 recommended)

πŸš€ Quick Start

1. Clone and Setup

git clone https://github.com/akshaymittal143/ai-devsecops-framework.git
cd ai-devsecops-framework

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

2. Configuration

# Copy example configuration
cp config/settings.yaml.example config/settings.yaml

# Edit configuration for your environment
vim config/settings.yaml

3. Deploy Infrastructure

# Deploy with Terraform
cd terraform/
terraform init
terraform plan
terraform apply

# Deploy with Helm
cd ../helm/
helm install ai-devsecops ./ai-devsecops-framework

# Or deploy with kubectl
kubectl apply -f deploy/kubernetes/

4. Start Services

# Development environment
docker-compose -f docker-compose.dev.yml up -d

# Production environment
docker-compose up -d

# Verify deployment
kubectl get pods -l app=ai-devsecops

πŸ’» Usage Examples

Basic Framework Usage

from src.main import AIDevSecOpsFramework
import asyncio

async def main():
    # Initialize framework
    framework = AIDevSecOpsFramework()
    
    # Start monitoring
    await framework.start_monitoring()
    
    # Process security event
    event = {
        "timestamp": time.time(),
        "event_type": "api_call",
        "source_ip": "192.168.1.100",
        "endpoint": "/api/admin/users",
        "method": "GET"
    }
    
    result = await framework.process_event(event)
    print(f"Threat detected: {result['is_threat']}")
    print(f"Confidence: {result['confidence']:.2f}")
    print(f"Processing time: {result['processing_time_ms']:.1f}ms")

asyncio.run(main())

Component-Specific Usage

# LSTM Threat Detection
from src.detection.lstm_detector import LSTMDetector

detector = LSTMDetector(units=64, window_size=10, threshold=0.95)
threat_probability = detector.predict(sequence_data)

# Zero-Day Detection
from src.detection.zero_day_detector import ZeroDayDetector

zero_day = ZeroDayDetector()
zero_day.train_baseline(benign_data)
anomaly_score = zero_day.analyze_behavior(sample)

# Security Orchestration
from src.orchestration.orchestrator import SecurityOrchestrator

orchestrator = SecurityOrchestrator(
    strategy=ConflictResolutionStrategy.CONFIDENCE_WEIGHTED
)
action = await orchestrator.process_security_signal(signal)

πŸ“ Repository Structure

ai-devsecops-framework/
β”œβ”€β”€ src/                          # Core implementation
β”‚   β”œβ”€β”€ detection/                # AI detection engines
β”‚   β”‚   β”œβ”€β”€ lstm_detector.py      # LSTM threat detection
β”‚   β”‚   β”œβ”€β”€ zero_day_detector.py  # Zero-day behavioral analysis
β”‚   β”‚   β”œβ”€β”€ attack_generator.py   # Synthetic attack generation
β”‚   β”‚   └── zero_day/             # Zero-day specific modules
β”‚   β”‚       └── behavioral_analyzer.py
β”‚   β”œβ”€β”€ orchestration/            # Security orchestration
β”‚   β”‚   └── orchestrator.py       # Conflict resolution & coordination
β”‚   β”œβ”€β”€ api/                      # API security components
β”‚   β”‚   β”œβ”€β”€ security_validator.py # API fuzzing & validation
β”‚   β”‚   └── test_runner.py        # Security test execution
β”‚   β”œβ”€β”€ validation/               # Business logic validation
β”‚   β”‚   └── business_logic_validator.py
β”‚   β”œβ”€β”€ pipeline/                 # Data pipeline components
β”‚   β”‚   β”œβ”€β”€ message_bus.py        # Event-driven communication
β”‚   β”‚   β”œβ”€β”€ policy_engine.py      # Dynamic policy generation
β”‚   β”‚   β”œβ”€β”€ preprocessor.py       # Data preprocessing
β”‚   β”‚   └── k8s_integration.py    # Kubernetes integration
β”‚   └── telemetry/                # Monitoring & telemetry
β”‚       └── collector.py          # Metrics collection
β”œβ”€β”€ config/                       # Configuration files
β”‚   β”œβ”€β”€ settings.yaml             # Main configuration
β”‚   β”œβ”€β”€ logging.yaml              # Logging configuration
β”‚   └── policies/                 # Security policies
β”‚       └── network-policies.yaml # Kubernetes NetworkPolicies
β”œβ”€β”€ deploy/                       # Deployment configurations
β”‚   β”œβ”€β”€ kubernetes/               # K8s manifests
β”‚   β”œβ”€β”€ terraform/                # Infrastructure as Code
β”‚   └── helm/                     # Helm charts
β”œβ”€β”€ evaluation/                   # Performance evaluation
β”‚   └── benchmarking.py           # Comprehensive benchmarking
β”œβ”€β”€ examples/                     # Usage examples
β”‚   └── basic_usage.py            # Basic framework usage
β”œβ”€β”€ models/                       # Model artifacts & results
β”‚   └── results.md                # Detailed performance results
β”œβ”€β”€ docs/                         # Documentation
β”‚   └── API_REFERENCE.md          # Complete API reference
β”œβ”€β”€ tests/                        # Test suites
β”œβ”€β”€ notebooks/                    # Jupyter analysis notebooks
└── data/                         # Datasets & samples

πŸ”§ Configuration

Core Settings (config/settings.yaml)

detection:
  model:
    type: lstm
    units: 64
    window_size: 10
    dropout_rate: 0.2
  threshold:
    anomaly: 0.95
    confidence: 0.85
  hyperparameters:
    learning_rate: 0.001
    batch_size: 64
    epochs: 100

orchestration:
  strategy: confidence-weighted  # conservative, majority, confidence-weighted
  retry_attempts: 3
  timeout: 30s
  component_weights:
    lstm_detector: 0.8
    zero_day_detector: 0.9
    api_validator: 0.7

monitoring:
  prometheus:
    scrape_interval: 15s
    retention: 30d
  logging:
    level: info
    format: json
  metrics:
    - ai_devsecops_threats_detected_total
    - ai_devsecops_detection_latency_seconds
    - ai_devsecops_model_accuracy

πŸ“Š Monitoring & Metrics

Prometheus Metrics

The framework exposes comprehensive metrics for monitoring:

# Threat detection metrics
ai_devsecops_threats_detected_total{component="lstm_detector"}
ai_devsecops_detection_latency_seconds{component="zero_day_detector"}
ai_devsecops_model_accuracy{model="lstm"}
ai_devsecops_false_positives_total

# Resource utilization
ai_devsecops_cpu_usage_percent
ai_devsecops_memory_usage_bytes
ai_devsecops_network_io_bytes_total

# Business metrics
ai_devsecops_events_processed_total
ai_devsecops_policy_actions_total{action="isolate_pod"}
ai_devsecops_api_vulnerabilities_detected{type="bola"}

Grafana Dashboards

Pre-configured dashboards available in monitoring/grafana/:

  • Security Overview: High-level threat landscape
  • Performance Metrics: Latency, throughput, resource usage
  • Model Performance: Accuracy, drift, retraining status
  • Incident Response: Policy actions, remediation status

πŸ§ͺ Evaluation & Benchmarking

Run Comprehensive Evaluation

cd evaluation/
python benchmarking.py --full-evaluation --output results.csv

# Statistical validation
python statistical_validation.py --confidence 0.95

# Attack-specific evaluation
python attack_evaluation.py --attack-types container,api,privilege

Performance Testing

# Load testing
python load_test.py --events 10000 --rate 1000

# Latency benchmarking
python latency_benchmark.py --duration 300

# Resource profiling
python resource_profiler.py --profile-duration 600

πŸ”¬ Research & Validation

Statistical Rigor

  • Cross-Validation: 10-fold stratified validation
  • Confidence Intervals: 95% CI for all metrics
  • Significance Testing: Paired t-tests (p < 0.05)
  • Bootstrap Sampling: 1000 iterations for robustness

Datasets Used

  • CloudStrike 2024: 2.1M flows (Container, API attacks)
  • MITRE Cloud: 1.5M events (Privilege, Lateral attacks)
  • Synthetic K8s: 500K traces (Pod, Mesh attacks)
  • CICIDS2017: Network intrusion detection baseline

Hyperparameter Optimization

  • Method: Bayesian optimization with TPE
  • Trials: 100 optimization trials
  • Search Space: LSTM units, learning rate, batch size, dropout
  • Validation: 5-fold cross-validation

πŸ›‘οΈ Security Features

Attack Detection Capabilities

Attack Type Detection Rate False Positive Rate Avg. Detection Time
Container Escape 96% 3% 1.2s
API Abuse (BOLA) 94% 4% 0.8s
Privilege Escalation 95% 5% 1.5s
Service Mesh Hijack 93% 6% 2.1s
Supply Chain Attacks 97% 4% 1.7s
Zero-Day Variants 85% 3% 1.8s

Automated Response Actions

  • Pod Isolation: Immediate network quarantine
  • Network Restriction: Granular traffic control
  • Enhanced Monitoring: Increased telemetry collection
  • Alert Generation: Multi-channel notifications
  • Policy Enforcement: Dynamic rule application

πŸ”„ Concept Drift & Adaptation

Adaptive Learning

  • Sliding Window Retraining: Weekly model updates
  • Accuracy Retention: 98% over 6 months
  • Drift Detection: Statistical change point analysis
  • Incremental Learning: Online adaptation capabilities

Adversarial Robustness

  • Adversarial Training: Ξ΅-bounded perturbations
  • Ensemble Methods: Multi-model voting
  • Robustness Testing: FGSM, PGD, C&W attacks
  • Improvement: 18% reduction in misclassification

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest tests/ -v

# Code formatting
black src/ tests/
flake8 src/ tests/

# Type checking
mypy src/

Research Collaboration

This framework supports ongoing research in:

  • Federated Learning: Cross-organization threat intelligence
  • Service Mesh Security: Istio/Linkerd integration
  • Explainable AI: Interpretable security decisions
  • Edge Computing: Distributed deployment optimization

πŸ“„ Citation

If you use this framework in your research, please cite our paper:

@inproceedings{mittal2025ai,
  title={AI-Augmented DevSecOps Pipelines for Secure and Scalable Service-Oriented Architectures in Cloud-Native Systems},
  author={Mittal, Akshay},
  booktitle={IEEE International Conference on Service-Oriented System Engineering (SOSE)},
  year={2025},
  organization={IEEE}
}

πŸ“ž Support

πŸ“œ License

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

πŸ™ Acknowledgments

  • University of the Cumberlands - Research support
  • IEEE SOSE 2025 - Conference publication
  • Open Source Community - Tool and library contributions
  • CICIDS2017 Dataset - Evaluation baseline data

⭐ Star this repository if you find it useful!

Built with ❀️ for the cloud-native security community

About

An AI-enhanced security automation framework for cloud-native applications, featuring real-time threat detection and automated response capabilities.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages