ModSecurity
Sign in to saveAlso known as mod_security, mod-security
ModSecurity, sometimes called Modsec, is an open-source web application firewall (WAF). Originally designed as a module for the Apache HTTP Server, it has evolved to provide an array of Hypertext Transfer Protocol request and response filtering capabilities along with other security features across a number of different platforms including Apache HTTP Server, Microsoft IIS and Nginx. It is free software released under the Apache license 2.0.
Source code
Libmodsecurity is one component of the ModSecurity v3 project. The library codebase serves as an interface to ModSecurity Connectors taking in web traffic and applying traditional ModSecurity processing. In general, it provides the capability to load/interpret rules written in the ModSecurity SecRules format and apply them to HTTP content provided by your application via Connectors. If you are looking for ModSecurity for Apache (aka ModSecurity v2.x), it is still under maintenance and available: here. What is the difference between this project and the old ModSecurity (v2.x.x)? Libmodsecurity is a complete rewrite of the ModSecurity platform. When it was first devised the ModSecurity project started as just an Apache module. Over time the project has been extended, due to popular demand, to support other platforms including (but not limited to) Nginx and IIS. In order to provide for the growing demand for additional platform support, it has became necessary to remove the Apache dependencies underlying this project, making it more platform independent. As a result of this goal we have rearchitected Libmodsecurity such that it is no longer dependent on the Apache web server (both at compilation and during runtime). One side effect of this is that across all platforms users can expect increased performance. Additionally, we have taken this opportunity to lay the groundwork for some new features that users have been long seeking. For example we are looking to natively support auditlogs in the JSON format, along with a host of other functionality in future versions. The 'ModSecurity' branch no longer contains the traditional module logic (for Nginx, Apache, and IIS) that has traditionally been packaged all together. Instead, this branch only contains the library portion (libmodsecurity) for this project. This library is consumed by what we have termed 'Connectors' these connectors will interface with your webserver and provide the library with a common format that it understands. Each of these connectors is maintained as a separate GitHub project. For instance, the Nginx connector is supplied by the ModSecurity-nginx project ( Keeping these connectors separated allows each project to have different release cycles, issues and development trees. Additionally, it means that when you install ModSecurity v3 you only get exactly what you need, no extras you won't be using. Before starting the compilation process, make sure that all required dependencies are installed. See the Dependencies and Git submodules section for further information. After compilation, make sure that there are no issues on your build/platform. We strongly recommend running the unit tests and regression tests. These test utilities are located in the tests/ subfolder. This repository uses git submodules. After cloning, make sure to initialize and fetch all submodules: Submodules that are correctly initialized show a commit hash. A leading - indicates that the submodule has not been initialized. This library is written in C++ using the C++17 standard. It uses Flex and Bison (Yacc) to produce the “Sec Rules Language” parser. Mandatory dependencies include YAJL, as ModSecurity uses JSON for logging and its testing framework. libXML2 (optional) is used for parsing XML requests. Default: PCRE2 is detected and used. Fallback: legacy PCRE can be used if --with-pcre is explicitly provided ( WITH PCRE ). In other words, current builds expect PCRE2 unless explicitly configured otherwise. All other dependencies are related to operators specified within SecRules or configuration directives and may not be required for compilation. libinjection is required for the operators @detectXSS and @detectSQL . curl is required for the directive SecRemoteRules . If those libraries are missing, ModSecurity will be compiled without support for the respective operators or directives. others/mbedtls (TF-PSA-Crypto subset) – used for cryptographic functions and helpers (e.g. hash
Excerpt from the source-code README · 19,428 chars · not written by Vinony
Wikidata facts
- Official website
- www.modsecurity.org
Show 3 more facts
- software version identifier
- 3.0.14
- source code repository URL
- github.com/SpiderLabs/ModSecurity
- social media followers
- 5023
via Wikidata · CC0
~4 min read
Article
3 sectionsContents
- History
- References
- External links
ModSecurity, sometimes called Modsec, is an open-source web application firewall (WAF). Originally designed as a module for the Apache HTTP Server, it has evolved to provide an array of Hypertext Transfer Protocol request and response filtering capabilities along with other security features across a number of different platforms including Apache HTTP Server, Microsoft IIS and Nginx. It is free software released under the Apache license 2.0.
The platform provides a rule configuration language known as 'SecRules' for real-time monitoring, logging, and filtering of Hypertext Transfer Protocol communications based on user-defined rules.