Skip to content

kwafhq/kwaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KWAF - Kubernetes Web Application Firewall

License Go Report Card Release Go Version

A modern, cloud-native Web Application Firewall (WAF) designed for Kubernetes environments. KWAF provides enterprise-grade security features with high performance, scalability, and ease of management.

πŸš€ Features

Core Security Features

  • πŸ›‘οΈ Web Application Firewall: Advanced request filtering and threat detection
  • πŸ”’ API Security: Comprehensive API protection with OpenAPI validation, JWT/OAuth support
  • 🚨 DDoS Protection: Multi-layered DDoS mitigation with adaptive algorithms
  • ⚑ Rate Limiting: Flexible rate limiting with multiple algorithms
  • 🎯 Rule Engine: Powerful rule-based security policy engine
  • 🌍 Geo-blocking: Geographic access control
  • πŸ€– Bot Detection: Advanced bot detection and mitigation

API Security

  • OpenAPI Validation: Automatic API schema validation
  • JWT & OAuth: Token-based authentication and authorization
  • API Key Management: Secure API key validation and management
  • GraphQL Security: GraphQL-specific threat detection and validation
  • API Versioning: Multi-version API support and management

Management & Operations

  • πŸŽ›οΈ Web Admin Panel: Modern React-based management interface
  • πŸ“Š Real-time Metrics: Comprehensive monitoring and alerting
  • πŸ”§ Multi-tenancy: Enterprise-grade tenant isolation
  • πŸ“ˆ Observability: Distributed tracing and structured logging
  • 🎯 Exception Management: Fine-grained exception handling

Architecture

  • Control Plane: Centralized policy management and configuration
  • Data Plane: High-performance request processing engine
  • CLI Management: Command-line tool for automation and DevOps
  • Cloud-native: Kubernetes-first design with Helm charts

πŸ“‹ Requirements

  • Go: 1.25 or higher
  • Kubernetes: 1.24 or higher (for production deployment)
  • PostgreSQL: 12 or higher (for persistent storage)
  • Redis: 6 or higher (for caching and rate limiting)

πŸš€ Quick Start

Using Docker Compose (Development)

git clone https://github.com/kwaf-project/kwaf.git
cd kwaf

# Start all components
docker-compose up -d

# Access admin panel
open http://localhost:8080

Using Pre-built Binaries

# Download latest release
curl -L https://github.com/kwaf-project/kwaf/releases/latest/download/kwaf-linux-amd64.tar.gz | tar xz

# Install components
sudo mv kwaf* /usr/local/bin/

# Start control plane
kwafcp --config config/controlplane.yaml

# Start data plane
kwafd --config config/dataplane.yaml

Building from Source

git clone https://github.com/kwaf-project/kwaf.git
cd kwaf

# Build all components
make build

# Run tests
make test

# Build Docker images
make docker-build

πŸ› οΈ Components

KWAF Control Plane (kwafcp)

Centralized management server responsible for:

  • Policy configuration and distribution
  • Rule management and compilation
  • Multi-tenant administration
  • Metrics collection and aggregation

KWAF Data Plane (kwafd)

High-performance proxy server that:

  • Processes HTTP/HTTPS requests
  • Applies security policies in real-time
  • Enforces rate limits and access controls
  • Provides DDoS protection

KWAF CLI (kwafctl)

Command-line interface for:

  • Configuration management
  • Policy deployment
  • Monitoring and troubleshooting
  • Automation and CI/CD integration

Admin Panel

Modern web interface featuring:

  • Real-time dashboard and metrics
  • Policy management interface
  • User and tenant administration
  • Security event visualization

πŸ“ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Admin Panel   β”‚    β”‚      kwafctl    β”‚    β”‚   External APIs β”‚
β”‚  (Web UI/API)   β”‚    β”‚   (CLI Tool)    β”‚    β”‚  (Monitoring)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚                      β”‚                      β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     KWAF Control       β”‚
                    β”‚        Plane           β”‚
                    β”‚      (kwafcp)          β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚ gRPC
                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                      β”‚                       β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚ KWAF Data     β”‚    β”‚ KWAF Data       β”‚
            β”‚ Plane (kwafd) β”‚    β”‚ Plane (kwafd)   β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚                  β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   Application  β”‚    β”‚   Application   β”‚
            β”‚    Services    β”‚    β”‚    Services     β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Configuration

Basic Control Plane Configuration

# config/controlplane.yaml
server:
  host: "0.0.0.0"
  port: 8090
  tls:
    enabled: true
    cert_file: "/path/to/cert.pem"
    key_file: "/path/to/key.pem"

database:
  host: "localhost"
  port: 5432
  database: "kwaf"
  username: "kwaf"
  password: "secure_password"

storage:
  type: "postgres"
  max_connections: 100

Basic Data Plane Configuration

# config/dataplane.yaml
server:
  host: "0.0.0.0"
  port: 8080
  admin_port: 8081

controlplane:
  address: "kwafcp:8090"
  tls:
    enabled: true
    ca_file: "/path/to/ca.pem"

upstream:
  default_backend: "http://app:3000"
  timeout: "30s"
  retries: 3

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development

For development setup, building from source, and contribution guidelines, see our Contributing Guide.

πŸ› Issues and Support

πŸ“Š Benchmarks

KWAF is designed for high performance:

  • Throughput: 100K+ requests/second per data plane instance
  • Latency: <10ms additional latency in proxy mode
  • Memory: <100MB base memory footprint
  • CPU: Minimal CPU overhead with optimized rule engine

See our Performance Documentation for detailed benchmarks.

🎯 Roadmap

πŸ“„ License

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

🌟 Acknowledgments


⭐ If you find KWAF useful, please give us a star on GitHub! It helps us understand the community interest and motivates continued development.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published