Architecture Overview

Enterprise WAF admin portal + reverse proxy. Controllers delegate to services — no direct database access from HTTP layer.

Layering

LayerResponsibility
ControllersHTTP, ViewModels, [Authorize] policies
ServicesBusiness logic, EF Core, audit, caching
MiddlewareProxy path, inspection, security headers
InfrastructureYARP forwarder, DI, observability

Enforced by automated architecture tests — controllers must not reference WafDbContext directly.

Proxied request flow

  1. Client → WafReverseProxyMiddleware (resolve application by Host header)
  2. WafRequestInspectionService.InspectAsync
  3. Protocol / smuggling checks (WafProtocolSecurityService)
  4. Geo block rules
  5. API Security layer when enabled (OpenAPI, JWT, BOLA heuristics)
  6. Virtual patches, bot/ML, positive security
  7. Detection modules (SQLi, XSS, SSRF, LFI, RFI, SSTI)
  8. Application rule engine (IWafTrafficAnalysisService)
  9. Rate limits & HTTP flood
  10. Decision: Allow / Block / Challenge → forward via YARP or return block page
  11. Traffic logged via WafTrafficRecorderService

Fail-closed

  • Inspection or rule-engine exceptions → treated as Block, not Allow.
  • Regex evaluation uses WafSafeRegex with ~200ms match timeout (ReDoS mitigation).
  • Invalid OpenAPI schema JSON when configured → fail-closed on API Security layer.

SOC components (separation of concerns)

ComponentRoleDecides?
IncidentRecord — what happenedNo
CampaignCorrelation — grouped narrativeNo
SOC QueuePrioritization — where to startNo
Decision EngineAllow / Block / ChallengeYes
Explanation LayerWhy this decisionNo (never changes enforcement)

Analytics & scale path

Dashboards and geo map read through ITrafficAnalyticsStore (SQL today). Hot table: WafTrafficLogs. Cache tiers: ~60s real-time counters, 1m statistics, 5m attack reports.

Full engineering reference: product repository docs/waf/ARCHITECTURE.md (internal).