@@ -683,6 +683,192 @@ See [mcp.md](mcp.md) for integration details.
683683
684684---
685685
686+ # # Profiling
687+
688+ Go runtime profiling via pprof HTTP endpoint.
689+
690+ ` ` ` yaml
691+ profiling:
692+ enabled: true
693+ pprof_addr: "localhost:6060" # pprof HTTP endpoint (localhost only recommended)
694+ cpu_profile_path: "" # Write CPU profile to file on shutdown
695+ mem_profile_path: "" # Write heap profile to file on shutdown
696+ block_profile_rate: 0 # Fraction of goroutine blocking events to report (0 = off)
697+ mutex_profile_fraction: 0 # Fraction of mutex contention events to report (0 = off)
698+ token: "" # Bearer token for pprof auth (empty = no auth, localhost-only recommended)
699+ ` ` `
700+
701+ When `token` is set, all pprof endpoints require `Authorization : Bearer <token>`.
702+
703+ ---
704+
705+ # # WAF (Web Application Firewall)
706+
707+ Six-layer security pipeline : SQLi, XSS, CMDi, XXE, SSRF, and Path Traversal detection.
708+
709+ ` ` ` yaml
710+ waf:
711+ enabled: true
712+ mode: enforce # "enforce" (block), "monitor" (log only), "disabled"
713+
714+ ip_acl:
715+ enabled: true
716+ whitelist: # Always allowed, bypasses all checks
717+ - cidr: "10.0.0.0/8"
718+ blacklist: # Always blocked
719+ - cidr: "192.168.1.100/32"
720+ auto_ban:
721+ enabled: true
722+ threshold: 100 # Requests in window before auto-ban
723+ window: "60s" # Time window for threshold counting
724+ duration: "3600s" # How long the ban lasts
725+
726+ rate_limit:
727+ enabled: true
728+ requests_per_second: 100 # Max requests per second per IP
729+ burst: 200 # Burst allowance
730+ window: "60s" # Fixed window duration
731+
732+ sanitizer:
733+ enabled: true
734+ strip_null_bytes: true
735+ normalize_unicode: true
736+ max_header_value_length: 8192
737+
738+ detection:
739+ enabled: true
740+ sqli:
741+ enabled: true
742+ mode: pattern # "pattern" or "semantic"
743+ xss:
744+ enabled: true
745+ mode: pattern
746+ cmdi:
747+ enabled: true
748+ xxe:
749+ enabled: true
750+ ssrf:
751+ enabled: true
752+ blocked_cidrs:
753+ - "127.0.0.0/8"
754+ - "10.0.0.0/8"
755+ - "172.16.0.0/12"
756+ - "192.168.0.0/16"
757+ - "169.254.0.0/16"
758+ - "0.0.0.0/0"
759+ path_traversal:
760+ enabled: true
761+
762+ bot_detection:
763+ enabled: true
764+ user_agent_blacklist:
765+ - "malicious-bot"
766+ challenge_mode: "none" # "none", "captcha", "javascript"
767+
768+ response:
769+ enabled: true
770+ hide_server_header: true
771+ hide_powered_by: true
772+
773+ logging:
774+ enabled: true
775+ log_body: false # Log request body (may contain sensitive data)
776+ max_body_log_size: 1024
777+ ` ` `
778+
779+ ---
780+
781+ # # GeoDNS
782+
783+ Geographic DNS routing based on client IP location.
784+
785+ ` ` ` yaml
786+ geodns:
787+ enabled: true
788+ default_pool: "us-east-pool" # Fallback pool when no rule matches
789+ db_path: "/etc/olb/GeoLite2-City.mmdb" # MaxMind GeoLite2 database
790+
791+ rules:
792+ - id: "eu-rule"
793+ country: "DE" # ISO 3166-1 alpha-2 country code
794+ pool: "eu-west-pool" # Route to this pool
795+ weight: 100 # Routing weight
796+
797+ - id: "asia-rule"
798+ country: "JP"
799+ pool: "ap-northeast-pool"
800+ weight: 100
801+
802+ - id: "fallback-rule"
803+ country: "*" # Wildcard matches all
804+ pool: "us-east-pool"
805+ weight: 50
806+ ` ` `
807+
808+ Requires a MaxMind GeoLite2 City database (MMDB format). Download from [MaxMind](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data).
809+
810+ ---
811+
812+ # # Shadow Traffic
813+
814+ Mirror production traffic to a shadow backend for testing and analysis. Shadow responses are discarded — never returned to the client.
815+
816+ ` ` ` yaml
817+ shadow:
818+ enabled: true
819+ percentage: 10.0 # Percentage of traffic to mirror (0-100)
820+ copy_headers: true # Copy request headers to shadow
821+ copy_body: true # Copy request body to shadow
822+ timeout: "5s" # Shadow request timeout
823+
824+ targets:
825+ - pool: "shadow-pool" # Target pool for mirrored traffic
826+ percentage: 100.0 # Percentage of shadowed traffic to this target
827+ ` ` `
828+
829+ Sensitive headers (Authorization, Cookie, Proxy-Authorization, X-Session-ID, X-CSRF-Token) are automatically stripped from shadow requests.
830+
831+ ---
832+
833+ # # Service Discovery
834+
835+ Service discovery is configured per-pool, not at the top level. Each pool can use one or more discovery providers.
836+
837+ ` ` ` yaml
838+ pools:
839+ - name: "api-pool"
840+ algorithm: round_robin
841+
842+ discovery:
843+ type: "dns" # "dns", "docker", "consul", "static", "file"
844+ interval: "30s" # Refresh interval
845+
846+ # DNS discovery
847+ domain: "_api._tcp.example.com"
848+ nameserver: "8.8.8.8:53"
849+
850+ # Docker discovery
851+ # docker_host: "unix:///var/run/docker.sock"
852+ # docker_label_filter: "com.example.service=api"
853+
854+ # Consul discovery
855+ # consul_addr: "http://127.0.0.1:8500"
856+ # consul_service: "api"
857+ # consul_tag: "production"
858+
859+ backends: [] # Optional static backends merged with discovered ones
860+ ` ` `
861+
862+ | Provider | Config Key | Notes |
863+ |----------|-----------|-------|
864+ | DNS | `dns` | SRV record lookup. Queries over plaintext — see warnings at startup. |
865+ | Docker | `docker` | Docker daemon API. Use TLS for remote connections. |
866+ | Consul | `consul` | Consul catalog API. HTTP only. |
867+ | Static | (none) | Uses `backends` list directly. No auto-discovery. |
868+ | File | `file` | Read backends from a JSON/YAML file. |
869+
870+ ---
871+
686872# # Complete Example
687873
688874See [configs/olb.yaml](../configs/olb.yaml) for a full annotated configuration example.
0 commit comments