Skip to content

High-performance Open Source API security middleware in Rust with configurable rate limiting, protecting against SQL injection, XSS, CSRF, and other OWASP Top 10 threats, ensuring the coverage of almost 17+ possible vulnerabilities. Supported in Python, .Net Core, Nodejs

License

Notifications You must be signed in to change notification settings

ActuallyIR/Securityval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SecureAPIs πŸ›‘οΈ

A high-performance, open-source API security middleware layer written in Rust. Designed to protect against vulnerability assessments, penetration testing attacks, and common API security threats with minimal latency.

Now includes a comprehensive web-based UI dashboard for real-time monitoring, request tracking, alert management, and dynamic configuration!

✨ What's New: Complete UI Layer

The SecureAPIs project now features a production-ready UI layer with:

  • 🎯 Real-Time Dashboard - Threat levels, metrics, and system health
  • πŸ” Request Tracking - Track 1000+ requests with detailed analytics
  • 🚨 Smart Alerts - Automatic alert generation with multiple severity levels
  • βš™οΈ Dynamic Settings - Modify all security settings without restart
  • πŸ“Š Metrics Collection - Comprehensive performance and security metrics
  • 🌐 Web API - REST endpoints for frontend integration
  • πŸ“± Frontend Ready - Blueprint for React/Vue/Svelte integration

Learn More:

Try It Out:

# Quick start - minimal example
cargo run --example simple_example

# Full-featured with UI dashboard
cargo run --example ui_dashboard

# See all examples and learn more
# β†’ Check out EXAMPLES.md for complete guide

Features

  • πŸš€ Ultra-Low Latency: Built in Rust for maximum performance (~microseconds overhead)
  • πŸ”’ Comprehensive Security: Protection against OWASP Top 10 and API Security Top 10
  • πŸ”„ Framework Agnostic: Works with Axum, Actix-Web, and custom implementations
  • πŸ“Š Real-time Monitoring: Built-in metrics, logging, and web dashboard
  • 🎯 Zero-Copy Where Possible: Optimized for minimal allocations
  • ⚑ Async First: Built on Tokio for high concurrency
  • πŸ› οΈ Fully Dynamic: Modify all settings on the fly without restart

Security Features

1. Rate Limiting & DDoS Protection

  • Token bucket algorithm with configurable limits
  • Per-IP, per-user, and global rate limiting
  • Adaptive rate limiting based on threat levels

2. Input Validation & Sanitization

  • SQL injection detection and prevention
  • XSS (Cross-Site Scripting) protection
  • Command injection prevention
  • Path traversal protection
  • JSON/XML bomb detection

3. Authentication & Authorization

  • JWT validation with custom claims
  • API key management
  • OAuth2 support
  • Role-based access control (RBAC)
  • Multi-factor authentication (MFA) support

4. Request/Response Security

  • CORS policy enforcement
  • Content Security Policy (CSP)
  • Security headers injection
  • Request signature validation
  • Response tampering detection

5. Threat Detection

  • Anomaly detection
  • Bot detection
  • Known vulnerability pattern matching
  • Suspicious activity logging

6. Web Dashboard & Monitoring ⭐ NEW

  • Real-time threat level assessment
  • Request tracking and filtering
  • Dynamic alert system
  • Security metrics and analytics
  • Configuration management UI
  • User preference settings

Quick Start

use secureapis::{SecurityLayer, SecurityConfig};
use axum::{Router, routing::get};

#[tokio::main]
async fn main() {
    // Configure security layer
    let security_config = SecurityConfig::default()
        .with_rate_limit(100, 60) // 100 requests per 60 seconds
        .with_jwt_validation("your-secret-key")
        .with_input_sanitization(true);
    
    let security_layer = SecurityLayer::new(security_config);
    
    // Create your API routes
    let app = Router::new()
        .route("/api/data", get(handler))
        .layer(security_layer);
    
    // Run server
    axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}

async fn handler() -> &'static str {
    "Secure API Response"
}

🌍 Works with ANY Language!

SecureAPIs provides language bindings and middleware that integrate directly into your API - it doesn't matter what language your backend is written in:

Client β†’ Your API (ANY Language) β†’ SecureAPIs Middleware (Rust)
         .NET, Java, Node.js, Python, Go, Ruby, PHP...

Native performance with zero code changes needed!

Language-Specific Setup:

Getting Started

πŸ“– Documentation Map: See docs/INDEX.md for the complete guide to all documentation.

❓ Have Questions? Start Here:

οΏ½ Ready to Set Up?

πŸ“š Understanding SecureAPIs:

  1. FAQ (10 min) - Q&A format
  2. Multi-Language Integration (15 min) - Deep dive
  3. Architecture Diagrams (10 min) - Visual explanations
  4. The Complete Story (15 min) - Full overview

πŸš€ Deployment:

Key Concept: SecureAPIs provides middleware and language bindings that protect your API regardless of language:

Client β†’ Your API (Any Language) β†’ SecureAPIs Middleware
         .NET, Java, Python, Go...     Security checks

Works with ANY languageβ€”native performance with minimal integration!

πŸ‘‰ New to SecureAPIs? Start with docs/FAQ.md - Most common questions answered!

Benchmarks

Typical overhead per request:

  • Rate limiting: ~2-5 ΞΌs
  • Input validation: ~10-50 ΞΌs (depending on payload size)
  • JWT validation: ~20-30 ΞΌs
  • Full security stack: ~50-100 ΞΌs

Installation

Add to your Cargo.toml:

[dependencies]
secureapis = "0.1.0"

Architecture

Request β†’ Security Layer β†’ Your API
            ↓
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Rate Limiter  β”‚
    β”‚  Input Filter  β”‚
    β”‚  Auth Check    β”‚
    β”‚  Logger        β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Configuration

See examples/ directory for detailed configuration options.

Contributing

Contributions are welcome! Please read our contributing guidelines.

License

MIT License - see LICENSE file for details.

Security

Report security vulnerabilities to security@secureapis.org

About

High-performance Open Source API security middleware in Rust with configurable rate limiting, protecting against SQL injection, XSS, CSRF, and other OWASP Top 10 threats, ensuring the coverage of almost 17+ possible vulnerabilities. Supported in Python, .Net Core, Nodejs

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published