OWASP NYC 2008-Web Intrusion Detection With ModSecurity
OWASP NYC 2008-Web Intrusion Detection With ModSecurity
NYC 2008
ModSecurity
The Open Source Web
Application Firewall
Ivan Ristić
Vice President, Security Research
Breach Security
1/46
Introduction
Ivan Ristić
2/46
Part 1
What are Web Application Firewalls?
3/46
Problems with web applications
5/46
Why use web application firewalls?
6/46
Network firewalls do not work
Firewall
Application
Web Web Database
Client Server Application
Server
Neither do IDS/IPS
solutions.
7/46
WAF identity problem: Naming
8/46
WAF identity problem: Purpose
11/46
What is ModSecurity?
12/46
History of ModSecurity
14/46
ModSecurity philosophy
No surprises.
► Document everything and tell it like it is.
15/46
Request lifecycle (I)
17/46
Streaming Data Analysis v3.0
Streams
► One per data source (e.g. request body)
► Transformation pipeline
► Streaming operators
► Process as data arrives
18/46
Transaction logging
20/46
Rules
Generic syntax:
SecRule TARGETS OPERATOR [ACTIONS]
For example:
SecRule ARGS|REQUEST_HEADERS "<script" \
"id:1001,msg:'XSS Attack', \
severity:ERROR,deny,status:404"
For example:
» ARGS
» ARGS_COMBINED_SIZE
» ARGS_NAMES
» ARGS_GET
» ARGS_POST
» …
22/46
Operators
For example:
► Strings (rx, pm, beginsWith, contains,
endsWith, streq, within).
► Numerical (eq, ge, gt, le, lt).
► XML (validateDTD, validateSchema).
► Other (rbl, geoLookup, inspectFile, verifyCC).
23/46
Actions
25/46
Ignore static content
27/46
White-list IP address or IP range
29/46
Associate session with request
Or based on content:
SecRule ARGS "@verifyCC CCREGEX" \
phase:5,nolog,pass,sanitiseMatched
31/46
Dealing with evasion
32/46
Decisions based on client location
33/46
Capture and transform data
34/46
Write rule in Lua (experimental)
36/46
ModSecurity Core Rules
Coherent set of rules designed to detect
generic web application security attacks.
Bundled with ModSecurity, but
with a separate release cycle.
Design goals:
Performance. Automated updates
supported since
Quality. ModSecurity 2.5.
Stability.
Plug and Play.
37/46
ModSecurity Community Console
38/46
ModProfiler NEW
Research project and open source tool that
generates positive security models out of the
traffic recorded by ModSecurity.
Portable (Java).
Current version: 0.2.0
Whitepaper: Enough With Default
Allow in Web Applications!
39/46
REMO
A project to build a graphical rule editor for
ModSecurity with a positive / whitelist
approach.
REMO stands for
Rule Editor for
ModSecurity.
Community
project run by
Christian Folini.
40/46
Distributed Open Proxy Honeypots
41/46
Questions?
Thank you!
Ivan Ristić
[email protected]
42/46
Appendix A
Roadmap
43/46
Portability