MODRACXKENNETH D'SILVA

← Archive & Insights

Implementing a Web Application Firewall (WAF) for Ecommerce

A Web Application Firewall filters malicious HTTP traffic before it reaches your application servers. Learn how to construct Cloudflare Custom WAF Expression Rules to block SQLi, XSS, and bot scraping.

By Kenneth D'SilvaReading Time: 36 min readCategory: Security & Compliance

Cloudflare WAF Expression Rule Example

# Cloudflare WAF Expression Rule for Blocking Magento Admin Scrapers
(http.request.uri.path contains "/admin_" and ip.geoip.country ne "US" and not ip.src in {192.0.2.1 198.51.100.2})
or (http.request.uri.path contains "/customer/account/loginPost" and http.request.rate_limit.exceeded)

Suggested & Related Reading

Explore related engineering guides from Kenneth D'Silva: