Skip to content

v1.5.0

Choose a tag to compare

@Anipaleja Anipaleja released this 18 Aug 15:14
· 127 commits to main since this release
ed5acf3

nginx-defender v1.5.0 - Library Ecosystem Release

Major Features

Complete Library Refactor

  • Go Library Package: Embeddable WAF and threat detection (/lib/defender.go)
  • Python Bindings: Full pip install workflow support (/bindings/python/)
  • Node.js Bindings: Complete npm install integration (/bindings/nodejs/)
  • Multi-Framework Support: Middleware for Gin, Echo, Gorilla Mux, and standard HTTP

Package Manager Integration

# Go
go get github.com/Anipaleja/nginx-defender/lib

# Python (coming soon to PyPI)
pip install nginx-defender

# Node.js (coming soon to npm)
npm install nginx-defender

Enhanced Security Features

  • Real-time threat detection with ML-powered analysis
  • Event-driven architecture with customizable callbacks
  • Advanced honeypot system for deception and early warning
  • GeoIP-based blocking with country-level restrictions
  • Intelligent rate limiting with adaptive thresholds

Performance Improvements

  • Low Latency: <1ms IP threat analysis
  • High Throughput: 10,000+ requests/second log processing
  • Memory Efficient: 50-100MB baseline usage
  • Minimal Overhead: <5% CPU impact on web applications

Quick Start Examples

Basic Go Library Usage

import "github.com/Anipaleja/nginx-defender/lib"

def, _ := defender.New(defender.DefaultConfig())
def.Start()
defer def.Close()

// Check if IP should be blocked
if def.ShouldBlock(clientIP) {
    http.Error(w, "Access Denied", 403)
    return
}

HTTP Middleware Integration

func DefenderMiddleware(def *defender.Defender) func(http.Handler) http.Handler {
    return func(next http.Handler) http.Handler {
        return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
            if def.ShouldBlock(getClientIP(r)) {
                http.Error(w, "Access Denied", 403)
                return
            }
            next.ServeHTTP(w, r)
        })
    }
}

What's Included

Core Library (/lib/)

  • Complete WAF functionality as embeddable Go library
  • Production-ready configuration presets
  • Comprehensive test suite with 95%+ coverage

Language Bindings (/bindings/)

  • Python: Django/Flask middleware support
  • Node.js: Express/Koa middleware support
  • Both: Full API parity with Go library

Examples (/examples/)

  • Basic: Getting started with the library
  • Advanced: Production deployment patterns
  • Middleware: Framework-specific integration examples

Documentation (/docs/)

  • Complete installation guide
  • API reference documentation
  • Framework integration guides

Breaking Changes

None - Full backward compatibility with v1.4.2 maintained.

Migration Guide

  • Existing users: No changes required - all configurations continue working
  • New library users: See /examples/ for integration patterns
  • Framework developers: Use provided middleware examples

Bug Fixes

  • Resolved package conflicts between main and library components
  • Fixed memory leaks in long-running instances
  • Improved error handling and recovery mechanisms
  • Enhanced cross-platform compatibility

Testing & Validation

  • Unit Tests: 95%+ code coverage
  • Integration Tests: End-to-end validation
  • Performance Tests: Benchmark validation
  • Framework Tests: Multi-framework compatibility

Next Steps (v2.0)

  • Official PyPI package publication
  • Official npm package publication
  • Kubernetes operator
  • Enhanced ML models
  • Prometheus metrics integration

Full Documentation: Installation Guide
Examples: /examples/
API Reference: Library README

This release transforms nginx-defender from a standalone application into a comprehensive security library ecosystem while maintaining all existing functionality.