Research Article
Web Application Firewall Using Machine Learning and Features Engineering
Algorithm 1
Units of proposal WAF (detailed algorithm).
| Input of data: d (dataset), a (algorithm), p1 (web server port), i1 (web server IP), p2 (WAF port), i2 (WAF IP). | (1) | Start | (2) | Connect to database to initialize Inputs (d, a, p1, i1, p2, i2) | (3) | Start WAF listener using Inputs (p1, i1, p2, i2) | (4) | Training WAF using Inputs (d, a) | (5) | While WAF listener is “ON”: | (6) | If new request arrived R: | (7) | Parse R | (8) | Compute basic features vector B from parsed R | (9) | Compute V Final features vector from B | (10) | Compute C (class) of parsed request R by classify based on V | (11) | If C = “anomal” | (12) | Drop request | (13) | Redirect to custom page with message “Attack” | (14) | Else//C = ‘normal’ | (15) | pass request to web server | (16) | Store V and C in database | (17) | Endif | (18) | Endif | (19) | EndWhile | (20) | End |
|