How to Keep Your Site Secure Using a Web Application Firewall (WAF)

Category: Security
Author: Tom Rankin
web-application-firewall

If there’s one phrase more prevalent than ‘website security‘ in the conversations about running a WordPress site, we’re yet to find it. You may already know the ins and outs of protecting your site using security plugins. However, that’s not the only step you can take, especially if you want to leave no stone unturned when it comes to locking down your site.

For instance, a Web Application Firewall (WAF) is a vital tool for ensuring that your site can stand up to malicious users and bots. However, on many sites, it’s either not implemented in the most optimal way or even worse, not considered at all. That’s unfortunate since this valuable security solution is surprisingly easy to take advantage of.

In this article, we’ll discuss WAFs and the variations they come in. We’ll also talk about the importance of using one, and explain how you can implement the technology on your website. Let’s jump right in!

How Most WordPress Users Currently Secure Their Websites

There are a lot of ways to secure a WordPress site, and different users apply various strategies. However, the most popular method of shoring up a website’s defenses is, of course, plugins.

WordPress users are well accustomed to bolstering their sites’ functionality through plugins, after all, and security is a perfect example. This is because a single plugin can implement a number of solutions, such as preventing brute force attacks, IP blocking, downtime monitoring, and much more.

In fact, Jetpack includes one-click tools for each of those fixes, and is completely free:

The Jetpack plugin.

Other plugins, such as Wordfence and iThemes Security, offer a suite of tools that go above and beyond the usual feature set. The latter even takes care of some advanced under-the-hood security tasks, such as resetting salts.

Of course, you don’t even need a plugin to implement certain security techniques. WordPress gives you easy access to some powerful options out of the box. For example, you can easily change salts via the wp-config.php file, and the .htaccess file can also be used to add URL redirections, change file permission settings, hide folders and files, and much more besides.

Finally, a Content Security Policy (CSP) technically falls into the category of encryption techniques. However, it’s still worth mentioning here, as it’s a code-centric way of authenticating files and scripts for safer use on your site. It’s an immensely powerful and flexible tool, so if you don’t already implement a CSP, it’s well worth considering.

The Importance of Protecting Your Site’s Server

You’ll notice that so far we’ve talked about plugins, file tweaks, and custom coding. As you’ll no doubt realize, these are all application-level solutions to security. This is not necessarily an issue, and they’re essential to the smooth running of your site. However, while your ultimate problem is to make sure malicious users can’t access your site, only providing application-level security doesn’t solve the issue completely.

Putting the ‘morality’ of a particular user to one side for a moment, all visitors will have an impact on server resources whenever they access your website. For an example, consider your site’s login page. Browsing to this section of your site will take up bandwidth and resources (such as scripts, style sheets, and fonts) – even more so if you choose to forgo caching for back-end pages.

For legitimate users, this is not an issue per se. You’ll still want to encourage as many of those people to log into your site as possible. The issues arise when malicious users also begin to access your pages. A generic brute force or Direct Denial of Service (DDoS) attack can cripple an otherwise stable site. This is because there are so many ‘users’ accessing your site that its resources are completely eaten up.

In other words, while your site may be locked up tight, its server still remains accessible unless you do something about it. We’ve already mentioned the solution to this problem, which we’ll look more closely at now.

Introducing the Web Application Firewall (WAF)

You’ll likely already know what a firewall is in a general sense. It’s essentially a barrier between two elements – in this case, between the ‘outside’ world and your website’s server. In very basic terms, a Web Application Firewall (WAF) stops bad traffic but lets good traffic through.

To make a comparison, WAFs are to servers as proxies are to clients. In fact, a WAF can be considered a ‘reverse proxy’. It’s designed to protect web applications – hence the name – and halt attacks such as Cross-Site Scripting (XSS) and SQL injections by applying rules to all HTTP transfers.

This type of firewall can usually be set up from a dashboard, or may even be built-in under the hood. No matter the form, this is the real solution to stopping harmful traffic from reaching your site. However, it’s important to ensure that you’re using the ‘right’ kind of WAF.

The Difference Between Server-Side and Application-Level WAFs

All WAFs aren’t created equal. There are two versions of the technology, and here’s a quick summary of each:

  • Application-level firewall. An application-level WAF only acts on your site and has minimal (if any) impact on your server. Nor does it provide any defenses for your server.
  • Server-side firewall. This style of WAF acts as a first-line barrier between traffic and your server. As such, it’s more costly to implement but offers greater security.

In layman’s terms, a server-side WAF stops traffic from getting to your site’s files – for example, your login page – based on the rules you set. This keeps your resources free, analytical metrics ‘clean’, and users well-protected.

In contrast, an application-level WAF can still benefit your site, but it doesn’t protect your server. Simply put, this means traffic is filtered at a later point, potentially giving malicious users access to the server itself. This makes it less ideal than a server-side solution since all those visitors (good or bad) are still using up your server’s resources.

In a nutshell, plugin-based firewalls added by solutions such as Wordfence are application-level WAFs, while server-side WAFs can be implemented through companies like Sucuri or Cloudflare. This is an important distinction to make, as many users install a plugin WAF and assume they’re completely protected when that might not be the case at all.

How to Install a WAF on Your Website

Installing either type of WAF is usually very simple. In the case of application-level firewalls, they’re typically made live once the plugin in question is activated. In Wordfence, for example, there’s a toggle for this option in the dedicated plugin settings within WordPress:

Wordfence's firewall settings.

As for server-side WAFs, they usually have similar settings within their own control panels, although they may not always be accessible through WordPress. Regardless of your choice of WAF solution, it should be simple to set up. Once your WAF is in place, your site will be both watertight and adaptable, in case you need to readdress the traffic you’re restricting in the future.

Conclusion

We make no excuses for bringing up site security once again, as it’s such a vital component to any website. If you’re running some kind of business site, security is even more necessary. After all, a lapse involving user data can land you in severely hot water.

Throughout this post, we’ve looked at a front-line defensive tactic that is, unfortunately, a low priority for many website owners. A WAF is a vital tool that can be found in plugins such as Wordfence, but not if you’re looking to fully protect your site. A server-side solution from the likes of Sucuri or Cloudflare is a better solution and can have you protected in minutes with little setup required.

Do you have any questions about how to implement a WAF in WordPress? Share your thoughts in the comments section below!

Featured image: Pexels.

Other posts

9 Common Website Security Threats (And How to Counter Them)

Sorry to break it to you, but your website is not safe. That’s not necessarily because of something you did but simply because nothing on the Internet is ever completely secure. Every single website faces security threats that can take them down, damage them, or worse. That’s the bad news. The silver lining is, there are many things you can do to tackle these threats and the first step is to be aware they exist. After all, you can only protect yourself from something that you know could pose a risk. To help you do exactly that, this article will […]

Read more

How to Implement Domain Privacy in WordPress (3 Tips)

If you’ve ever registered a domain, you most likely had to provide your contact information, including phone number, email, and home address. Unfortunately, this information isn’t private by default. If you don’t take certain measures to protect your details, it could lead to spam, cyberattacks, and data breaches.  Fortunately, implementing domain privacy is relatively easy. There are WordPress hosting providers and domain registrars that offer this service. Taking the necessary steps to protect your domain can be an effective way to safeguard your personal information.  In this post, we’ll discuss what domain privacy is and why it’s important. Then, we’ll […]

Read more

WordPress Logging: What It Is & Why You Should Use It

Your site can sometimes feel confusing if you run an eCommerce store with more than one contributor. When a problem arises, it can be hard to trace who made particular changes and fix the issue efficiently. Fortunately, you can use a WordPress logging plugin to track user activity on your website. Tracing modifications can unearth the root of issues and tell you the who, what, and when behind problematic changes. Overall, logging enables you to more easily resolve any complications.  In this post, we’ll explain WordPress logging and why eCommerce site owners should consider using it. Then, we’ll walk you […]

Read more

How to Fix the ERR_SSL_PROTOCOL Error

If you’re familiar with Secure Sockets Layer (SSL) certificates, you should recognize that the ERR_SSL_PROTOCOL error is related to them. Seeing this message means the website has an SSL certificate, but the browser can’t validate it. In practice, there are many reasons why an SSL certificate might not work correctly. Understanding the causes behind problems with SSL certificates will make it easier to troubleshoot this error. Then you’ll be able to regain access to your website and ensure that visitors don’t run into scary browser warnings. In this article, we’ll talk about the ERR_SSL_PROTOCOL error and what causes it. Then […]

Read more

The Benefits of Using 2FA for WordPress Websites

If you don’t add an extra layer of security to your WordPress login page, your website could be more vulnerable to hacks and data leaks. Even if you and your users are creating strong passwords, this may not provide enough protection against brute force attacks. By implementing two-factor authentication (2FA), you can easily improve the security of your website. This will give your users multiple ways to verify identity, preventing any unwanted entry. Ultimately, 2FA can increase security, accountability, and compliance for WordPress websites.   In this post, we’ll explain what two-factor authentication is. Then, we’ll show you the benefits of […]

Read more

Improving Security for Your WordPress Sites (And Your Visitors)

WordPress cybersecurity must be a top priority for all site administrators today. A secure WordPress site is crucial for protecting your own data as well as the data and privacy of your site’s visitors. In fact, poor security can even hurt your site’s search engine rankings and Google reputation. Luckily, strengthening your WordPress site’s cybersecurity starts with a few easy steps that anyone can use. Here’s an overview of the key risks facing WordPress sites and what you can do to defend against them. Common WordPress Cybersecurity Risks Cyber threats have been on the rise across the board over the […]

Read more

How WordPress Managed Hosting Can Boost Your Website Security (4 Ways)

If you’re a website owner, you probably already know that online security is key. Cyber attacks and data leaks are becoming increasingly common. Therefore, you may be wondering how you can protect your WordPress site from both malicious interferences and potential accidents.  The answer to your worries might be WordPress managed hosting. It has many benefits over shared hosting, including increased security. Managed hosting can help prevent attacks on your site and add extra protections in case of disaster. In this article, we’ll provide an overview of what managed hosting is, as well as its benefits. Then, we’ll look at […]

Read more

What Is a Web Application Firewall (WAF) and Do You Need One?

You might come across the concept of a web application firewall (WAF) and not think much of it. After all, it’s easy to assume it’s something you don’t need or that is already part of your hosting package. However, there’s a bit more to it than that.  In fact, it’s important to understand precisely what a WAF is so you can decide if it’s a good idea for you.  Today, we’ll explain all the finer details of web application firewalls. We will provide a definition, explain their benefits, the different types available, as well as how to select one should […]

Read more

How to Protect Your Site Against Remote Code Execution Attacks (5 Ways)

If you run a WordPress site, you might be aware of the many security risks that could threaten your business. For example, Remote Code Execution (RCE) attacks can exploit your website vulnerabilities to steal data, destroy your content, or take over your site altogether.  Fortunately, you can easily protect your website by understanding the ins and outs of this kind of attack. With proper knowledge, you can take the necessary steps toward securing your website against RCE hacks. In this post, we’ll discuss RCE attacks and how they can harm your website. Then, we’ll discuss five ways you can protect […]

Read more

4 Best SSL Certificate Providers for WordPress Websites

A Secure Sockets Layer (SSL) certificate is essential for protecting your website and your customers. However, the world of SSL is often full of confusing jargon. That’s why we’ve put together this complete guide to the best SSL certificate providers. By exploring the validation times, costs, and type of products each company provides, you should have no problems finding the option that’s right for you. In this post, we’ll discuss why SSL certification is important for all websites and is absolutely crucial for eCommerce sites. We’ll then explore four of the industry-leading SSL providers and debate their strengths and weaknesses. […]

Read more