44
Copyright © 2006 - The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License. The OWASP Foundation OWASP AppSec Europe May 2006 http://www.owasp.org / Web Application Firewalls: When Are They Useful? Ivan Ristic Thinking Stone [email protected] +44 7766 508 210

PowerPoint presentation

Embed Size (px)

Citation preview

Page 1: PowerPoint presentation

Copyright © 2006 - The OWASP FoundationPermission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License.

The OWASP Foundation

OWASP

AppSec

Europe

May 2006 http://www.owasp.org/

Web Application Firewalls:When Are They Useful?

Ivan RisticThinking [email protected]+44 7766 508 210

Page 2: PowerPoint presentation

2OWASP AppSec Europe 2006

Ivan Ristic

Web Application Securityspecialist; Developer.

Author of Apache Security.

Founder of Thinking Stone.

Author of ModSecurity.

Page 3: PowerPoint presentation

3OWASP AppSec Europe 2006

Why Use Web Application Firewalls?

In a nutshell:1. Web applications are deployed terribly

insecure.2. Developers should, of course, continue to

strive to build better/more secure software.3. But in the meantime, sysadmins must do

something about it. (Or, as I like to say: We need all the help we can get.)

4. Insecure applications aside, WAFs are an important building block in every HTTP network.

Page 4: PowerPoint presentation

4OWASP AppSec Europe 2006

Network Firewalls Do Not Work For HTTP

Firewall

Port 80HTTP Traffic

WebClient

WebServer

Application

Application

DatabaseServer

Page 5: PowerPoint presentation

5OWASP AppSec Europe 2006

WAFEC (1)

Web Application Firewall Evaluation Criteria.

Project of the Web Application Security Consortium (webappsec.org).

It's an open project. Nine WAF vendors on board, but I'd like

to see more users on the list. WAFEC v1.0 published in January. We are about to start work on v1.1.

Page 6: PowerPoint presentation

6OWASP AppSec Europe 2006

WAFEC (2)

Nine sections:1. Deployment Architecture2. HTTP and HTML Support3. Detection Techniques4. Prevention Techniques5. Logging6. Reporting7. Management8. Performance9. XML

Page 7: PowerPoint presentation

7OWASP AppSec Europe 2006

WAFEC (3)

WAFEC is not forthe vendors.

It's for the users.(So please voice your opinions!)

http://www.webappsec.org/projects/wafec/

Page 8: PowerPoint presentation

8OWASP AppSec Europe 2006

WAF Identity Problem (1)

There is a long-standing WAF identity problem.

With the name, first of all:Web Adaptive FirewallWeb Application FirewallWeb Application Security DeviceWeb Application ProxyWeb Application ShieldWeb ShieldWeb Security FirewallWeb Security GatewayWeb Security ProxyWeb Intrusion Detection SystemWeb Intrusion Prevention System

Adaptive FirewallAdaptive ProxyAdaptive GatewayApplication FirewallApplication-level FirewallApplication-layer FirewallApplication-level Security

GatewayApplication Level GatewayApplication Security DeviceApplication Security GatewayStateful Multilayer Inspection

Firewall

Page 9: PowerPoint presentation

9OWASP AppSec Europe 2006

WAF Identity Problem (2)

There are four aspects to consider:1. Audit device2. Access control device3. Layer 7 router/switch4. Web Application Hardening tool

These are all valid requirements but the name Web Application Firewall is not suitable.

On the lower network layers we have a different name for each function.

Page 10: PowerPoint presentation

10OWASP AppSec Europe 2006

WAF Identity Problem (3)

Appliance-oriented web application firewalls clash with the Application Assurance market.

Problems solved long time ago: Load balancing Clustering SSL termination and acceleration Caching and transparent compression URL rewriting …and so on

Page 11: PowerPoint presentation

11OWASP AppSec Europe 2006

WAF Identity Problem (4)

Key factors:1. Application Assurance vendors are very strong.2. Web Application Firewall vendors not as much.

Result: Appliance-oriented WAFs are being

assimilated by the Application Assurance market.

In the meantime: Embedded WAFs are left alone because they

are not an all-or-nothing proposition.

Page 12: PowerPoint presentation

12OWASP AppSec Europe 2006

WAF Functionality Overview

Page 13: PowerPoint presentation

13OWASP AppSec Europe 2006

The Essentials (1)

Full support for HTTP: Access to individual fields (field content,

length, field count, etc). Entire transaction (both request and

response). Uploaded files.

Anti-evasion features (also known as normalisation/canonicalisation/transformation features).

Page 14: PowerPoint presentation

14OWASP AppSec Europe 2006

The Essentials (2)

Blocking features: Transaction Connection IP Address Session User Honeypot redirection TCP/IP resets (connection) Blocking via external device

What happens upon detection?

Page 15: PowerPoint presentation

15OWASP AppSec Europe 2006

Fancy Features

Stateful operation: IP Address data Session data User data

Event Correlation High availability:

Failover Load-balancing Clustering State replication

Page 16: PowerPoint presentation

16OWASP AppSec Europe 2006

Hard-Coded Protection Techniques (1)

Cookie protection Sign/encrypt/virtualise

Hidden field protection Sign/encrypt/virtualise

Session management protection Enforce session duration timeout, inactivity

timeout. Prevent fixation. Virtualise session management. Prevent hijacking or at least warn about it.

Page 17: PowerPoint presentation

17OWASP AppSec Europe 2006

Hard-Coded Protection Techniques (2)

Brute-force protection Link validation

Signing Virtualisation

Request flow enforcement Statically Dynamically

Page 18: PowerPoint presentation

18OWASP AppSec Europe 2006

Other Things To Consider (1)

Management: Is it possible to manage multiple sensors from one

place? Support for administrative accounts with different

privileges (both horisontal and vertical).

Reporting (giving Management what it wants): On-demand and scheduled reports with support for

customisation

XML: WAFs are expected to provide basic support for XML

parsing and validation. Full XML support is usually available as an option, or as

a completely separate product.

Page 19: PowerPoint presentation

19OWASP AppSec Europe 2006

Other Things To Consider (2)

Extensibility: Is it possible to add custom functionality to

the firewall? Is the source code available? (But not as a

replacement for a proper API.)

Performance: New connections per second. Maximum concurrent connections. Transactions per second. Throughput. Latency.

Page 20: PowerPoint presentation

20OWASP AppSec Europe 2006

Signatures and Rules

Page 21: PowerPoint presentation

21OWASP AppSec Europe 2006

Signatures or Rules?

1. Signatures Simple text strings or regular expression

patterns matched against input data. Not very flexible.

2. Rules1. Flexible.2. Multiple operators.3. Rule groups.4. Anti-evasion functions.5. Logical expressions.6. Custom variables.

Page 22: PowerPoint presentation

22OWASP AppSec Europe 2006

Three Protection Strategies

1. External patching Also known as "just-in-time patching" or "virtual

patching").

2. Negative security model Looking for bad stuff. Typically used for Web Intrusion Detection. Easy to start with but difficult to get right.

3. Positive security model Verifying input is correct. Usually automated, but very difficult to get right with

applications that change. It's very good but you need to set your expectations

accordingly.

Page 23: PowerPoint presentation

23OWASP AppSec Europe 2006

Auditing and HTTP Traffic Monitoring

Page 24: PowerPoint presentation

24OWASP AppSec Europe 2006

Web Intrusion Detection

Often forgotten because of marketing pressures: Detection is so last year (decade). Prevention sounds and sells much better!

The problem with prevention is that it is bound to fail given sufficiently determined attacker.

Monitoring (logging and detection) is actually more important as it allows you to independently audit traffic, and go back in time.

Page 25: PowerPoint presentation

25OWASP AppSec Europe 2006

Monitoring Requirements

Centralisation. Transaction data storage. Control over which transactions are

logged and which parts of each transaction are logged, dynamically on the per-transaction basis. Minimal information (session data). Partial transaction data. Full transaction data.

Support for data sanitisation. Can implement your retention policy.

Page 26: PowerPoint presentation

26OWASP AppSec Europe 2006

Deployment

Page 27: PowerPoint presentation

27OWASP AppSec Europe 2006

Deployment

Three choices when it comes to deployment:

1. Network-level device.2. Reverse proxy.3. Embedded in web server.

Page 28: PowerPoint presentation

28OWASP AppSec Europe 2006

Deployment (2)

1. Network-level device

Does not require network re-configuration.

Page 29: PowerPoint presentation

29OWASP AppSec Europe 2006

Deployment (3)

2. Reverse proxy

Typically requires network re-configuration.

Page 30: PowerPoint presentation

30OWASP AppSec Europe 2006

Deployment (4)

3. Embedded

Does not require network re-configuration.

Page 31: PowerPoint presentation

31OWASP AppSec Europe 2006

Deployment (5)

1. Network passive Does not affect performance. Easy to add. Not a bottleneck or a point of failure. Limited prevention options. Must have copies of SSL keys.

2. Network in-line A potential bottleneck. Point of failure. Must have copies of SSL keys. Easy to add.

Page 32: PowerPoint presentation

32OWASP AppSec Europe 2006

Deployment (6)

3. Reverse proxy A potential bottleneck. Point of failure. Requires changes to network (unless it's a

transparent reverse proxy). Must terminate SSL (can be a problem if

application needs to access client certificate data).

It's a separate architecture/security layer.

4. Embedded Easy to add (and usually much cheaper). Not a point of failure. Uses web server resources.

Page 33: PowerPoint presentation

33OWASP AppSec Europe 2006

Reverse Proxy As a Building Block

Reverse proxy patterns:1. Front door2. Integration reverse proxy3. Protection reverse proxy4. Performance reverse proxy5. Scalability reverse proxy

Logical patterns, orthogonal toeach other.

Often deployed as a single physicalreverse proxy.

Page 34: PowerPoint presentation

34OWASP AppSec Europe 2006

Front Door (1/5)

Make all HTTP traffic go through the proxy Centralisation makes access control,

logging, and monitoring easier

Page 35: PowerPoint presentation

35OWASP AppSec Europe 2006

Integration Reverse Proxy (2/5)

Combine multiple web servers into one Hide the internals Decouple interface from implementation

Page 36: PowerPoint presentation

36OWASP AppSec Europe 2006

Protection Reverse Proxy (3/5)

Observes traffic in and out Blocks invalid requests and attacks Prevents information disclosure

Page 37: PowerPoint presentation

37OWASP AppSec Europe 2006

Performance Reverse Proxy (4/5)

Transparent caching Transparent response compression SSL termination

Page 38: PowerPoint presentation

38OWASP AppSec Europe 2006

Scalability Reverse Proxy (5/5)

Load balancing

Fault tolerance

Clustering

Page 39: PowerPoint presentation

39OWASP AppSec Europe 2006

Open Source Approach: Apache

+ ModSecurity

Page 40: PowerPoint presentation

40OWASP AppSec Europe 2006

Apache

One of the most used open source products.

Available on many platforms. Free, fast, stable and reliable. Expertise widely available. Apache 2.2.x (finally!) released with many

improvements: Improved authentication. Improved support for caching. Significant improvements to the mod_proxy

code (and load balancing support). Ideal reverse proxy.

Page 41: PowerPoint presentation

41OWASP AppSec Europe 2006

ModSecurity

Adds WAF functionality to Apache. In the 4th year of development. Free, open source, commercially

supported. Implements most WAF features (and the

remaining ones are coming soon). Popular and very widely used. Fast, reliable and predictable.

Page 42: PowerPoint presentation

42OWASP AppSec Europe 2006

Apache + ModSecurity

Deploy as reverse proxy: Pick a nice server (I am quite

fond of Sun's hardwareofferings myself).

Install Apache 2.2.x. Add ModSecurity. Add SSL acceleration card

(optional).

Or simply run ModSecurity in embedded mode.

Page 43: PowerPoint presentation

43OWASP AppSec Europe 2006

ModSecurity

Strong areas: Auditing/logging support. Real-time traffic monitoring. Just-in-time patching. Prevention. Very configurable/programmable.

Weak areas: No automation of the positive security

model approach yet.

Page 44: PowerPoint presentation

44OWASP AppSec Europe 2006

Thank you!Download this presentation from

http://www.owasp.org/index.php/AppSec_Europe_2006

Questions?