ModSecurity WAF
In this section, we will learn about the ModSecurity WAF.
Before we begin, it should be noted that this section is intended to be an introduction to using ModSecurity with Moodle and not a comprehensive instruction manual. For that, please check out ModSecurity 2.5, also published by Packt (see https://www.packtpub.com/product/modsecurity-25/9781847194749).
It is also worth noting that support for the ModSecurity engine is being passed back to the open source community from its current owners in mid-2024 (see https://coreruleset.org/20211222/talking-about-modsecurity-and-the-new-coraza-waf/).
However, the value of a ModSecurity implementation is found in the rules and not in the engine. For the remainder of this chapter, we will focus on understanding how ModSecurity WAF rules are created and how they can be applied to Moodle as, once we’ve gained this understanding, we can apply it to other similar WAFs (the AWS WAF or Cloudflare WAF, for example).
...