28.10.2014 Views

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

386 Chapter 9 • Platform-Level <strong>Defense</strong>s<br />

ModSecurity <strong>and</strong> WAFs in general, we’re going to look at some solutions that could be<br />

considered a WAF but are not as robust. However, they can be just as effective depending on<br />

the scenario, <strong>and</strong> they can be potentially cheaper in cost <strong>and</strong> resource requirements to deploy.<br />

Intercepting Filters<br />

Most WAFs implement the Intercepting Filter pattern or include one or more implementations<br />

in their overall architecture. Filters are a series of independent modules that you can chain<br />

together to perform processing before <strong>and</strong> after the core processing of a requested resource (Web<br />

page, URL, script, etc.). Filters do not have explicit dependencies on each other; this allows you<br />

to add new filters without affecting existing filters. This modularity makes filters reusable across<br />

applications. You can add filters to applications at deployment when implemented as a Web<br />

server plug-in or when activated dynamically within an application configuration file.<br />

Filters are ideal for performing centralized, repeatable tasks across requests <strong>and</strong> responses<br />

that are loosely coupled with core application logic. They are also good for security functions<br />

such as input validation, request/response logging, <strong>and</strong> transforming outgoing responses.<br />

In the next two sections, we’re going to look at two common filter implementations:<br />

Web server plug-ins <strong>and</strong> application framework modules. You can use both of them for<br />

runtime <strong>SQL</strong> injection protection. Figure 9.7 shows where each is executed as the HTTP<br />

request <strong>and</strong> response passes to/from the Web browser.<br />

Figure 9.7 Diagram Depicting<br />

Web Server <strong>and</strong> Application Filters<br />

Web Server Filters<br />

You can implement filters as Web server modules/plug-ins, which extend the core request<br />

<strong>and</strong> response h<strong>and</strong>ling application program interface (API) of the Web server platform.<br />

Basically, requests <strong>and</strong> responses h<strong>and</strong>led by the Web server pass through a series of phases,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!