Balancing Security and Performance with Web Application Firewalls

F5 Ecosystem | March 26, 2018
  • Security is important, but so is performance.
  • More than half (57%) of organizations use web application firewalls to protect apps in the cloud and on-premises (State of Application Delivery 2018)
  • Scanning an outbound response is one of the last opportunities to detect a breach in progress – and stop it.
  • You can have “too much of a good thing.” Carefully consider how to balance security with performance to optimize both.

We (as in everyone) know how important performance is to the continued success of the digital business. While those of us who were weaned on dial-up connections and hours-long downloads are tend to be more forgiving when it comes to performance, our digital native children are not so generous. They expect instantaneous responses and quick downloads.

The proof of our impatience is in the numbers – more than 80% of us have deleted an application because of poor performance. Some of us – three in ten – are even willing to pay for the privilege of our apps being lightning fast.

But we’re hard to please, no matter what technology generation we’re from. Don’t you dare ignore security while you’re making that app go faster. If you do, and our data is breached, we’ll do more than just delete your app.

It is left, then, to IT professionals – particularly those who practice security – to balance the demand for performance with the need for security. Apps must be fast and secure.

One of the ways more than half of organizations achieve safer apps is by using a web application firewall (WAF) – amongst other application services – to protect applications against attack. They do this in two ways:

First, they scan inbound requests to detect any malicious activity. Second, they inspect outbound responses. It is no surprise that organizations that always apply these security tactics are amongst those with the highest confidence in withstanding an application attack.

Using a WAF you can inspect every last bit of a request and a response. You can parse, pull apart, twist, and modify content however you want.

But just because you can, doesn’t mean you should.

Security is not free. It takes CPU cycles and memory to inspect application traffic with the kind of attention required to find attacks or evidence of a breach.

That’s why it’s important to balance security with performance. Every extra microsecond you spend scanning or scrubbing is an extra microsecond users must wait for that response.

And they add up.

After all, it’s a matter of physics that it takes a number of microseconds for packets to pass through a network and back. It takes another few microseconds to establish a connection. Another few to process… you get the picture. Everything you do takes time, and the more time you take, the more impatient your users are growing.

Some have traditionally thrown the baby out with the bathwater when it comes to this conflict. They turn off security until performance is acceptable. But that’s not the right answer. There is a balance that can satisfy both the need for security and the demand for performance.

On the request, feel free to perform protocol-level parsing and verification. Inspect the payload and seek out any signs of an attack. Go with signature based scans first and text-based comparisons second. Signature-based scans when possible improve the performance of security because you don’t have to parse and compare. It’s just a straight comparison, and it’s a pretty fast process.

On the response, don’t succumb to the temptation to parse and put the content under a microscope. There has to be some level of trust with developers, here, that the JSON is formatted correctly or the XML follows the appropriate schema. Face it, if there’s a protocol or format error here, the user will find out about it. That’s a developer concern, it’s not generally a security risk.

What is a security risk is the inclusion of sensitive data – credit card or account numbers, social security numbers, e-mail addresses, perhaps. Numbers and data with well-defined patterns that can be quickly scanned for and obscured in the data. Like signature-based scans, you’re doing pattern matching here and security services have gotten really good at performing them as fast as they can.

Content length, too, is something you’ll want to check if you can. A number of high-profile exploits were identifiable simply by the amount of content returned. If you know a specific request should only return about 1K of data, then a 4K response should probably set of alarm bells somewhere. It’s a simple check that takes far less time than parsing and counting data records.

A good rule of thumb is to always obey Security Rule Zero on the request and check everything you can when there is user input present. On the outbound, look for indicators of an ongoing breach and obfuscate sensitive data, but don’t spend time worrying about data formats and schema compliance. Let developers worry about whether they formatted the response correctly. That is their purview, not yours.

Security and performance can be balanced, as long as you don’t sacrifice one for the other. And that means in both directions. Don’t give up security for performance, but don’t throw performance under the bus for the sake of (potentially unnecessary) security.

If you use security strategically to prevent exploitation and detect breaches you can achieve the balance with performance you need to keep users happy and data and applications safe.

Share
Tags: 2018

About the Author

Lori Mac Vittie
Lori Mac VittieDistinguished Engineer and Chief Evangelist

More blogs by Lori Mac Vittie

Related Blog Posts

SaaS-first strategies reshape cloud-native application delivery
F5 Ecosystem | 12/03/2025

SaaS-first strategies reshape cloud-native application delivery

F5 NGINXaaS empowers cloud and platform architects to unify operations, reduce complexity, and deliver exceptional digital experiences at scale.

F5 ADSP Partner Program streamlines adoption of F5 platform
F5 Ecosystem | 11/19/2025

F5 ADSP Partner Program streamlines adoption of F5 platform

The new F5 ADSP Partner Program creates a dynamic ecosystem that drives growth and success for our partners and customers.

Accelerate Kubernetes and AI workloads with F5 BIG-IP and AWS EKS
F5 Ecosystem | 11/17/2025

Accelerate Kubernetes and AI workloads with F5 BIG-IP and AWS EKS

The F5 BIG-IP Next for Kubernetes software will soon be available in AWS Marketplace to accelerate managed Kubernetes performance on AWS EKS.

F5 NGINX Gateway Fabric is a certified solution for Red Hat OpenShift
F5 Ecosystem | 11/11/2025

F5 NGINX Gateway Fabric is a certified solution for Red Hat OpenShift

F5 collaborates with Red Hat to deliver a solution that combines the high-performance app delivery of F5 NGINX with Red Hat OpenShift’s enterprise Kubernetes capabilities.

F5 Silverline Mitigates Record-Breaking DDoS Attacks
F5 Ecosystem | 08/26/2021

F5 Silverline Mitigates Record-Breaking DDoS Attacks

Malicious attacks are increasing in scale and complexity, threatening to overwhelm and breach the internal resources of businesses globally. Often, these attacks combine high-volume traffic with stealthy, low-and-slow, application-targeted attack techniques, powered by either automated botnets or human-driven tools.

Phishing Attacks Soar 220% During COVID-19 Peak as Cybercriminal Opportunism Intensifies
F5 Ecosystem | 12/08/2020

Phishing Attacks Soar 220% During COVID-19 Peak as Cybercriminal Opportunism Intensifies

David Warburton, author of the F5 Labs 2020 Phishing and Fraud Report, describes how fraudsters are adapting to the pandemic and maps out the trends ahead in this video, with summary comments.

Deliver and Secure Every App
F5 application delivery and security solutions are built to ensure that every app and API deployed anywhere is fast, available, and secure. Learn how we can partner to deliver exceptional experiences every time.
Connect With Us
Balancing Security and Performance with Web Application Firewalls | F5