Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/3-reference-manual/3-2-configuration-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ Every rule following a previous `SecDefaultAction` directive in the same configu

{{% notice warning %}}

`SecDefaultAction` is not inherited across configuration contexts. (For an example of why this may be a problem, read the following ModSecurity Blog entry <https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/three-modsecurity-rule-language-annoyances/> .)
`SecDefaultAction` is not inherited across configuration contexts. (For an example of why this may be a problem, read the following ModSecurity Blog entry <https://web.archive.org/web/20250822051720/https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/three-modsecurity-rule-language-annoyances/> .)

{{% /notice %}}

Expand Down Expand Up @@ -572,7 +572,7 @@ ModSecurity relies on the free Google Safe Browsing database that can be obtaine

{{% notice note %}}

Deprecated in 2.7.0 after Google dev team decided to not allow the database download anymore. After registering and obtaining a Safe Browsing API key, you can automatically download the GSB using a tool like wget. For further information on how to proceed with the download, please visit Google's website: <https://developers.google.com/safe-browsing/v3/update-guide>
Deprecated in 2.7.0 after Google dev team decided to not allow the database download anymore. After registering and obtaining a Safe Browsing API key, you can automatically download the GSB using a tool like wget. For further information on how to proceed with the download, please visit Google's website: <https://developers.google.com/safe-browsing>

{{% /notice %}}

Expand All @@ -584,7 +584,7 @@ Configures an external program that will receive the information about every tra

libModSecurity v3 rejects this directive with a configuration error, so a configuration containing it cannot be shared between v2 and v3. Guardian logging is designed to send the information about every request to an external program. Because Apache is typically deployed in a multiprocess fashion, which makes information sharing between processes difficult, the idea is to deploy a single external process to observe all requests in a stateful manner, providing additional protection.

Currently the only tool known to work with guardian logging is httpd-guardian, which is part of the Apache httpd tools project [1](http://apache-tools.cvs.sourceforge.net/viewvc/apache-tools/apache-tools/). The httpd-guardian tool is designed to defend against denial of service attacks. It uses the blacklist tool (from the same project) to interact with an iptables-based (on a Linux system) or pf-based (on a BSD system) firewall, dynamically blacklisting the offending IP addresses. It can also interact with SnortSam [2](http://www.snortsam.net). Assuming httpd-guardian is already configured (look into the source code for the detailed instructions), you only need to add one line to your Apache configuration to deploy it. The optional second parameter restricts guardian logging to requests for which the given environment variable is set (or, with the `!` prefix, not set), as with Apache's `CustomLog`:
Currently the only tool known to work with guardian logging is httpd-guardian, which is part of the Apache httpd tools project [1](http://apache-tools.cvs.sourceforge.net/viewvc/apache-tools/apache-tools/). The httpd-guardian tool is designed to defend against denial of service attacks. It uses the blacklist tool (from the same project) to interact with an iptables-based (on a Linux system) or pf-based (on a BSD system) firewall, dynamically blacklisting the offending IP addresses. It can also interact with SnortSam [2](https://web.archive.org/web/20230328075006/http://snortsam.net/). Assuming httpd-guardian is already configured (look into the source code for the detailed instructions), you only need to add one line to your Apache configuration to deploy it. The optional second parameter restricts guardian logging to requests for which the given environment variable is set (or, with the `!` prefix, not set), as with Apache's `CustomLog`:

``` seclang
SecGuardianLog |/path/to/httpd-guardian
Expand Down Expand Up @@ -704,7 +704,7 @@ Establishes a per-IP address limit of how many connections are allowed to be in

{{< secmeta syntax="SecConnReadStateLimit LIMIT OPTIONAL_IP_MATCH_OPERATOR" example=`SecConnReadStateLimit 50 "!@ipMatch 127.0.0.1"` default="0 (no limit)" scope="Any" v2="2.8.0" v3="no" >}}

This measure is effective against Slowloris-style attacks from a single IP address, but it may not be as good against modified attacks that work by slowly sending request body content. This is because Apache to switches state to SERVER_BUSY_WRITE once request headers have been read. As an alternative, consider mod_reqtimeout (part of Apache as of 2.2.15), which is expected be effective against both attack types. See Blog post on mitigating slow DoS attacks - <http://blog.spiderlabs.com/2010/11/advanced-topic-of-the-week-mitigating-slow-http-dos-attacks.html>. v2.8.0 and newest supports the @ipMatch, @ipMatchF and @ipMatchFromFile operator along with the its negative (e.g. !@ipMatch) these were used to create suspicious or whitelist. When a suspicious list is informed, just the IPs that belongs to the list will be filtered. A combination of suspicious and whitelist is possible by using multiple definitions of SecConnReadStateLimit, note, however, that the limit will be always overwrite by its successor.
This measure is effective against Slowloris-style attacks from a single IP address, but it may not be as good against modified attacks that work by slowly sending request body content. This is because Apache to switches state to SERVER_BUSY_WRITE once request headers have been read. As an alternative, consider mod_reqtimeout (part of Apache as of 2.2.15), which is expected be effective against both attack types. See Blog post on mitigating slow DoS attacks - <https://web.archive.org/web/20110330162606/http://blog.spiderlabs.com/2010/11/advanced-topic-of-the-week-mitigating-slow-http-dos-attacks.html>. v2.8.0 and newest supports the @ipMatch, @ipMatchF and @ipMatchFromFile operator along with the its negative (e.g. !@ipMatch) these were used to create suspicious or whitelist. When a suspicious list is informed, just the IPs that belongs to the list will be filtered. A combination of suspicious and whitelist is possible by using multiple definitions of SecConnReadStateLimit, note, however, that the limit will be always overwrite by its successor.

LIMIT must be greater than zero.

Expand Down
2 changes: 1 addition & 1 deletion content/3-reference-manual/3-4-transformation-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Decodes a Base64-encoded string. Unlike base64Decode, this version uses a more f

Both engines accept the URL-safe alphabet (`-` and `_`) since ModSecurity 2.9.15 and libModSecurity 3.0.17. ModSecurity v2 skips only space, tab, CR, LF and padding (`=`) characters: any other byte outside the Base64 alphabet makes the whole decode fail and the output is an empty string. It also stops decoding at the first NUL byte in the input. libModSecurity v3 skips every byte outside the alphabet and processes every byte.

See blog post on Base64Decoding evasion issues on PHP sites - <http://blog.spiderlabs.com/2010/04/impedance-mismatch-and-base64.html>
See the blog post on Base64 decoding evasion issues on PHP sites, [Impedance Mismatch and Base64](https://web.archive.org/web/20110713164920/http://blog.spiderlabs.com/2010/04/impedance-mismatch-and-base64.html) (Internet Archive copy; the original SpiderLabs blog is offline).

## base64Encode

Expand Down
6 changes: 3 additions & 3 deletions content/3-reference-manual/3-5-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,17 +441,17 @@ These are the reserved ranges:
- 200,000–299,999: reserved for rules published Comodo
- 300,000–399,999: reserved for rules published at gotroot.com
- 400,000–419,999: unused (available for reservation)
- 420,000–429,999: reserved for ScallyWhack [1](http://projects.otaku42.de/wiki/Scally-Whack)
- 420,000–429,999: reserved for ScallyWhack [1](https://web.archive.org/web/20120807063638/http://projects.otaku42.de:80/wiki/Scally-Whack)
- 430,000–439,999: reserved for rules published by Flameeyes [2](http://www.flameeyes.eu/projects/modsec)
- 440.000-599,999: unused (available for reservation)
- 600,000-699,999: reserved for use by Akamai [3](http://www.akamai.com/html/solutions/waf.html)
- 700,000–799,999: reserved for Ivan Ristic
- 900,000–999,999: reserved for the OWASP CRS [4](http://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project) project
- 900,000–999,999: reserved for the OWASP CRS [4](https://coreruleset.org/) project
- 1,000,000-1,009,999: reserved for rules published by Redhat Security Team
- 1,010,000-1,999,999: reserved for WAF \| Web Application Firewall and Load Balancer Security (kemptechnologies.com) [5](https://kemptechnologies.com/solutions/waf/)
- 2,000,000-2,999,999: reserved for rules from Trustwave's SpiderLabs Research team
- 3,000,000-3,999,999: reserved for use by Akamai [6](http://www.akamai.com/html/solutions/waf.html)
- 4,000,000-4,099,999 reserved: in use by AviNetworks [7](https://kb.avinetworks.com/docs/latest/vantage-web-app-firewall-beta/)
- 4,000,000-4,099,999 reserved: in use by AviNetworks
- 4,100,000-4,199,999 reserved: in use by Fastly [8](https://www.fastly.com/products/cloud-security/#products-cloud-security-web-application-firewall)
- 4,200,000-4,299,999 reserved: in use by CMS-Garden [9](https://www.cms-garden.org/en)
- 4,300,000-4,300,999 reserved: in use by Ensim.hu [10](http://ensim.hu/)
Expand Down
2 changes: 1 addition & 1 deletion content/3-reference-manual/3-6-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Use @inspectFile with caution. It may not be safe to use @inspectFile with varia

{{% /notice %}}

**Reference:** <http://blog.spiderlabs.com/2010/10/advanced-topic-of-the-week-preventing-malicious-pdf-file-uploads.html>
**Reference:** <https://web.archive.org/web/20121227063516/http://blog.spiderlabs.com:80/2010/10/advanced-topic-of-the-week-preventing-malicious-pdf-file-uploads.html>

**Reference:** <http://sourceforge.net/p/mod-security/mailman/mod-security-users/?viewmonth=201512>

Expand Down
4 changes: 2 additions & 2 deletions content/5-troubleshooting/5-2-iis-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ In order to use the _Microsoft FixIt_ visit the website: [http://support.microso

## Looking for missing dependencies

ModSecurity itself is distributed along with some dependencies, as an example but not limited to the libapr. Dependencies may changed according to the version. Not all dependencies are part of ModSecurity as an example of the Visual C++ Redistribution files which is not part of the currently release (see bug [#627](https://github.com/SpiderLabs/ModSecurity/issues/628), to check if your version contains those C++ Redistribution files). Some dependencies are expected to be loaded from the system but sometimes, due to version changes or specific configuration of the server those dependencies are not found, leading ModSecurity to fail to be loaded. While not loaded the error messages are not verbose enough to help the user to identify the missing symbol or library.
ModSecurity itself is distributed along with some dependencies, as an example but not limited to the libapr. Dependencies may changed according to the version. Not all dependencies are part of ModSecurity as an example of the Visual C++ Redistribution files which is not part of the currently release (see bug [#627](https://github.com/owasp-modsecurity/ModSecurity/issues/628), to check if your version contains those C++ Redistribution files). Some dependencies are expected to be loaded from the system but sometimes, due to version changes or specific configuration of the server those dependencies are not found, leading ModSecurity to fail to be loaded. While not loaded the error messages are not verbose enough to help the user to identify the missing symbol or library.

In order to identify that all dependencies are match, we recommend the utilization of [dumpbin](http://support.microsoft.com/kb/177429/en-us). _Dumpbin_ is a utility that is part of the Visual Studio package and it should be in your path after the execution of the _vcvars_ batch script. The path to the script and the mane may vary from version to version of Visual Studio, on Win 8.1 using Visual Studio 2013, here is the path:
In order to identify that all dependencies are match, we recommend the utilization of [dumpbin](https://learn.microsoft.com/en-us/cpp/build/reference/dumpbin-reference). _Dumpbin_ is a utility that is part of the Visual Studio package and it should be in your path after the execution of the _vcvars_ batch script. The path to the script and the mane may vary from version to version of Visual Studio, on Win 8.1 using Visual Studio 2013, here is the path:
```
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat
```
Expand Down
2 changes: 1 addition & 1 deletion content/6-migration/6-2-migrating-from-1x-to-2x.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ In Mod 2.x, using the “allow” action may not be enough to truly let a reques

**How To Upgrade**

See Blog post on handling false positives and creating custom rules - http://blog.spiderlabs.com/2010/11/modsecurity-advanced-topic-of-the-week-exception-handling.html
See Blog post on handling false positives and creating custom rules - https://web.archive.org/web/20110612004522/http://blog.spiderlabs.com:80/2010/11/modsecurity-advanced-topic-of-the-week-exception-handling.html

## Directive to control rule inheritance to Apache Scope locations (Virtual Hosts, Location, Directory)

Expand Down
3 changes: 1 addition & 2 deletions content/7-development/7-1-contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ what a good contribution looks like.
[ModSecurity-apache](https://github.com/owasp-modsecurity/ModSecurity-apache).
- This documentation: <https://github.com/owasp-modsecurity/documentation> (every page has an edit link).
- Discussion: the `#project-modsecurity` channel on the [OWASP Slack](https://owasp.org/slack/invite) and
the GitHub issue tracker. Questions about configuration and rules are best asked on Slack or as a
[GitHub discussion](https://github.com/owasp-modsecurity/ModSecurity/discussions) before opening an issue.
the GitHub issue tracker. Questions about configuration and rules are best asked on Slack before opening an issue.
- Project page: <https://owasp.org/www-project-modsecurity/>, which lists the project leaders. They review
and merge every pull request.

Expand Down
2 changes: 1 addition & 1 deletion content/7-development/7-3-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ maintainers) produce most of the current tooling.
[plugin registry](https://github.com/coreruleset/plugin-registry) for application-specific exclusions
(WordPress, Nextcloud, Drupal, phpBB, phpMyAdmin, DokuWiki, cPanel, XenForo) and add-ons such as the
DoS-protection, antivirus, body-decompress, fake-bot and auto-decoding plugins.
- [Comodo free ModSecurity rules](https://waf.comodo.com/) - a commercial vendor's free rule set.
- [Comodo free ModSecurity rules](https://web.archive.org/web/20260212164915/https://waf.comodo.com/) - a commercial vendor's free rule set.

## Writing and checking rules

Expand Down
8 changes: 4 additions & 4 deletions content/8-archive/8-1-gsoc-2016-ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Below are a number of suggestions for students interested in the ModSecurity pro
**Brief explanation:** Adding the capability of rapid prototyping to ModSecurity functionalities through scripts will open the possibility for easy rules production and customization, It also opens the possibility for a large community such as Ruby developers to create their own customization on the top of ModSecurity and so customize their own rules, analogous of today's Lua support.
**Expected results:** An implementation able to handle Ruby scripts which will interact to ModSecurity as Lua does.
**References:**
- Embedding Ruby into C++ (ModSecurity is C, using C++ as reference): http://aeditor.rubyforge.org/ruby_cplusplus/index.html
- Embedding Ruby into C++ (ModSecurity is C, using C++ as reference): https://web.archive.org/web/20160415222459/http://aeditor.rubyforge.org/ruby_cplusplus/index.html
- ModSecurity Reference Manual, Lua:{{% relref "3-reference-manual/3-2-configuration-directives#secrulescript" %}}"

###ModSecurity JavaScript support
Expand All @@ -24,7 +24,7 @@ Below are a number of suggestions for students interested in the ModSecurity pro
Expected results: A connector which will allow ModSecurity to be used inside node.js
**References:**
- ModSecurity version 3.0:
https://www.trustwave.com/Resources/SpiderLabs-Blog/An-Overview-of-the-Upcoming-libModSecurity/?page=1&year=0&month=0
https://web.archive.org/web/20180313114027/https://www.trustwave.com/Resources/SpiderLabs-Blog/An-Overview-of-the-Upcoming-libModSecurity/
- ModSecurity nginx connector:
https://github.com/SpiderLabs/ModSecurity-nginx"

Expand All @@ -33,7 +33,7 @@ https://github.com/SpiderLabs/ModSecurity-nginx"
Expected results: A workable but no feature complete connector which will allow ModSecurity v3 to be used inside Apache
**References:**
- ModSecurity version 3.0:
https://www.trustwave.com/Resources/SpiderLabs-Blog/An-Overview-of-the-Upcoming-libModSecurity/?page=1&year=0&month=0
https://web.archive.org/web/20180313114027/https://www.trustwave.com/Resources/SpiderLabs-Blog/An-Overview-of-the-Upcoming-libModSecurity/
- ModSecurity nginx connector:
https://github.com/SpiderLabs/ModSecurity-nginx"

Expand Down Expand Up @@ -70,7 +70,7 @@ t:encrypt(%{TX.mykey}%)
###ModSecurity sub-phases
**Brief explanation:** ModSecurity supports real phases 1-4 and the 'virtual' one 5. Having intermediate virtual phases, like phase:2.2, would allow to order rules inside a real phase. This is especially useful for configurations integrating rules provided, for example, by a hoster and customs ones.
**Expected results:** Rules will be ordered, inside a phase, not only based on their occurence but also based on their sub-phase.
**References:** https://github.com/SpiderLabs/ModSecurity/issues/371
**References:** https://github.com/owasp-modsecurity/ModSecurity/issues/371
**Example:**
- SecRule ... phase:2.6,id:1
- SecRule ... phase:2,id:2
Expand Down
Loading
Loading