This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Category:OWASP ModSecurity Core Rule Set Project"

From OWASP
Jump to: navigation, search
(Project Members)
 
(45 intermediate revisions by 3 users not shown)
Line 8: Line 8:
 
'''The 1st Line of Defense Against Web Application Attacks'''  
 
'''The 1st Line of Defense Against Web Application Attacks'''  
  
The OWASP ModSecurity CRS Project's goal is to provide an easily "pluggable" set of generic attack detection rules that provide a base level of protection for any web application.
+
{| style="width: 100%;"  
The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with [https://www.modsecurity.org ModSecurity] or compatible web application firewalls.  
+
| style="vertical-align:top;" | The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with [https://modsecurity.org ModSecurity] or compatible web application firewalls. The CRS aims to protect web applications from a wide range of attacks, including the [[Top10|OWASP Top Ten]], with a minimum of false alerts. The CRS provides protection against many common attack categories, including SQL Injection, Cross Site Scripting, Locale File Inclusion, etc.
The CRS aims to protect web applications from a wide range of attacks, including the [[Top10|OWASP Top Ten]], with a minimum of false alerts.
 
  
More information at [https://coreruleset.org https://coreruleset.org].
+
[[File:CRS-logo-full_size-512x257.png|512px|link=https://coreruleset.org]]
  
==Description==
+
'''The offical website of the project can be found at [https://coreruleset.org https://coreruleset.org].
 
 
{| style="width: 100%;"
 
| style="vertical-align:top;" | The OWASP ModSecurity CRS provides protections if the following attack/threat categories:
 
* SQL Injection (SQLi)
 
* Cross Site Scripting (XSS)
 
* Local File Inclusion (LFI)
 
* Remote File Inclusion (RFI)
 
* Remote Code Execution (RCE)
 
* PHP Code Injection
 
* HTTP Protocol Violations
 
* Shellshock
 
* Session Fixation
 
* Scanner Detection
 
* Metadata/Error Leakages
 
* Project Honey Pot Blacklist
 
* GeoIP Country Blocking
 
  
More Information at [https://coreruleset.org https://coreruleset.org].
 
  
| style="text-align:right;" | [[File:CRS3-movie-poster-thumb_gray.jpeg|299px|link=https://coreruleset.org/poster]]
+
| style="text-align:right;" | [[File:CRS3-movie-poster-thumb.jpeg|300px|link=https://coreruleset.org/poster]]
 
|}
 
|}
  
Line 40: Line 22:
  
 
The following tutorials will get you started with ModSecurity and the CRS v3.
 
The following tutorials will get you started with ModSecurity and the CRS v3.
 +
 
* [https://www.netnea.com/cms/apache-tutorial-6_embedding-modsecurity/ Installing ModSecurity]
 
* [https://www.netnea.com/cms/apache-tutorial-6_embedding-modsecurity/ Installing ModSecurity]
 
* [https://www.netnea.com/cms/apache-tutorial-7_including-modsecurity-core-rules/ Including the OWASP ModSecurity Core Rule Set]
 
* [https://www.netnea.com/cms/apache-tutorial-7_including-modsecurity-core-rules/ Including the OWASP ModSecurity Core Rule Set]
Line 46: Line 29:
 
These tutorials are part of a big series of Apache / ModSecurity guides published by [https://www.netnea.com/cms/apache-tutorials netnea]. They are written by [[:user:Dune73|Christian Folini]].
 
These tutorials are part of a big series of Apache / ModSecurity guides published by [https://www.netnea.com/cms/apache-tutorials netnea]. They are written by [[:user:Dune73|Christian Folini]].
  
More Information at [https://coreruleset.org https://coreruleset.org].
+
More Information about the rule set is available at the official website, [https://coreruleset.org https://coreruleset.org].
  
 
==Licensing==
 
==Licensing==
 +
 
OWASP ModSecurity CRS is free to use. It is licensed under the [http://www.apache.org/licenses/LICENSE-2.0.txt Apache Software License version 2 (ASLv2)], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
 
OWASP ModSecurity CRS is free to use. It is licensed under the [http://www.apache.org/licenses/LICENSE-2.0.txt Apache Software License version 2 (ASLv2)], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
  
| valign="top"  style="padding-left:25px;width:200px;" |
+
== Reporting Issues ==
  
 +
* If you think you've found a false positive in commercially available software and want us to take a look, submit an issue on [https://github.com/SpiderLabs/owasp-modsecurity-crs/ our Github]
 +
* Have you found a false negative/bypass? We'd love to hear about it - please responsibly disclose it to [mailto:[email protected] [email protected]]
  
  
== Project Members ==
+
== Project Sponsors ==
 +
 
 +
{| class="wikitable"
 +
 
 +
|-
 +
! Trustwave !! Avi Networks || cPanel, Inc
 +
|-
 +
| [[Image:SpiderLabs Logo 2011.JPG|200px|link=https://www.trustwave.com/spiderLabs.php]] || [[Image:Avi_Networks.jpg|200px|link=https://avinetworks.com/]] || [[Image:CPanel logo.svg.png|200px|link=https://cpanel.com/]]
 +
|}
 +
 
 +
| valign="top"  style="padding-left:25px;width:200px;" |
 +
 
 +
== Website ==
  
Project Leader:
+
[https://coreruleset.org https://coreruleset.org]
* [[:User:Chaim_sanders|Chaim Sanders]]
 
  
Contributors:
+
== Social Channels ==
*[[:user:Dune73|Christian Folini]]
 
*[[:User:lifeforms|Walter Hop]]
 
*[[:User:Rcbarnett|Ryan Barnett]]
 
  
== Presentation ==
+
[https://twitter.com/coreruleset?lang=en Twitter @CoreRuleSet]
  
*[https://www.owasp.org/images/a/a9/AppSecDC_2010-ModSecurityCRS_Ryan_Barnett.ppt OWASP ModSecurity CRS Preso - PPT]
+
[https://lists.owasp.org/mailman/listinfo/owasp-modsecurity-core-rule-set OWASP CRS Mailing List]
*[http://vimeo.com/20166971 OWASP ModSecurity CRS Preso - Video]
 
  
== Related Projects ==
+
== Project Members ==
  
*[[http://www.owasp.org/index.php/Category:OWASP_Securing_WebGoat_using_ModSecurity_Project OWASP Securing WebGoat using ModSecurity Project]]  
+
Project Leaders:
*[[http://www.owasp.org/index.php/Category:OWASP_AppSensor_Project OWASP AppSensor Project]]
+
* [[:User:Chaim_sanders|Chaim Sanders]]
*[[https://www.owasp.org/index.php/Category:OWASP_Blacklist_Regex_Repository OWASP Blacklist Regex Repository]]
+
* [[:user:Dune73|Christian Folini]]
 +
* [[:User:lifeforms|Walter Hop]]
 +
Contributors:
 +
* Christoph Hansen
 +
* Felipe 'Zimmerle' Costa
 +
* Franziska Bühler
 +
* Victor Hora
 +
* Federico Schwindt
 +
* Felipe Zipitría
 +
* Manuel Spartan
  
 
== Quick Download ==
 
== Quick Download ==
  
* [https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master Latest CRS (TAR/GZ)] (FIXME)
+
[https://coreruleset.org/installation/ Installation Tutorial]
* [https://github.com/SpiderLabs/owasp-modsecurity-crs/zipball/master Latest CRS (ZIP)] (FIXME)
 
  
| valign="top"  style="padding-left:25px;width:200px;" |
+
[https://hub.docker.com/r/owasp/modsecurity-crs/ Docker Image]
  
 
== Source Code Repo ==
 
== Source Code Repo ==
  
* [https://github.com/SpiderLabs/owasp-modsecurity-crs OWASP ModSecurity CRS on GitHub]
+
[https://github.com/SpiderLabs/owasp-modsecurity-crs GitHub Project]
  
 
== News and Events ==
 
== News and Events ==
* [10 Nov 2016] - CRS3 Released (FIXME: Link to announcement)
 
  
== Mailing List ==
+
We publish a monthly newsletter on the official website at [https://coreruleset.org/ https://coreruleset.org]
 
 
*[https://lists.owasp.org/mailman/listinfo/owasp-modsecurity-core-rule-set OWASP CRS Mail-list]
 
  
 
==Classifications==
 
==Classifications==
Line 110: Line 108:
  
 
|}
 
|}
 
=Getting Started=
 
 
The following tutorials will get you started with ModSecurity and the CRS v3.
 
* [https://www.netnea.com/cms/apache-tutorial-6_embedding-modsecurity/ Installing ModSecurity]
 
* [https://www.netnea.com/cms/apache-tutorial-7_including-modsecurity-core-rules/ Including the OWASP ModSecurity Core Rule Set]
 
* [https://www.netnea.com/cms/apache-tutorial-8_handling-false-positives-modsecurity-core-rule-set/ Handling False Positives with the OWASP ModSecurity Core Rule Set]
 
 
These tutorials are part of a big series of Apache / ModSecurity guides published by [https://www.netnea.com/cms/apache-tutorials netnea]. They are written by [[:user:Dune73|Christian Folini]].
 
 
More Information at [https://coreruleset.org https://coreruleset.org].
 
 
=FAQs=
 
 
== ModSecurity Rules Language ==
 
 
=== What are the OWASP ModSecurity Core Rules (CRS) and why should I use them? ===
 
 
Using ModSecurity requires rules. In order to enable users to take full advantage of ModSecurity immediately, Trustwave's SpiderLabs is sponsoring the OWASP ModSecrity Core Rule Set (CRS) Project. Unlike intrusion detection and prevention systems which rely on signature specific to known vulnerabilities, the Core Rule Set provides generic protection from unknown vulnerabilities often found in web application that are in most cases custom coded. You may also consider writing custom rules for providing a positive security envelope to your application or critical parts of it. The Core Rule Set is heavily commented to allow it to be used as a step-by-step deployment guide for ModSecurity.
 
 
=== What attacks do the Core Rules protect against? ===
 
 
In order to provide generic web applications protection, the Core Rules use the following techniques:
 
 
*HTTP protection - detecting violations of the HTTP protocol and a locally defined usage policy.
 
*Common Web Attacks Protection - detecting common web application security attack.
 
*Automation detection - Detecting bots, crawlers, scanners and other surface malicious activity.
 
*Trojan Protection - Detecting access to Trojans horses.
 
*Errors Hiding – Disguising error messages sent by the server
 
 
In addition the ruleset also hints at the power of ModSecurity beyond providing security by reporting access from the major search engines to your site.
 
 
=== How do I whitelist an IP address so it can pass through ModSecurity? ===
 
 
The first issue to realize is that in ModSecurity 2.0, the allow action is only applied to the current phase. This means that if a rule matches in a subsequent phase it may still take a disruptive action. The recommended rule configuration to allow a remote IP address to bypass ModSecurity rules is to do the following (where 192.168.1.100 should be substituted with the desired IP address):
 
background-color: #ffffcc;
 
SecRule REMOTE_ADDR "@ipMatch 192.168.110" id:1,phase:1,nolog,pass,ctl:ruleEngine=Off
 
 
If you want to allow uninterrupted access to the remote IP address, however you still want to log rule alerts, then you can use this rule -
 
 
SecRule REMOTE_ADDR "@ipMatch 192.168.110" phase:1,nolog,allow,ctl:ruleEngine=DetectionOnly
 
 
If you want to disable both the rule and audit engines, then you can optionally add another ctl action:
 
 
SecRule REMOTE_ADDR "@ipMatch 192.168.110" phase:1,nolog,allow,ctl:ruleEngine=Off,ctl:auditEngine=Off
 
 
=== How do I handle False Positives and creating Custom Rules? ===
 
 
It is inevitable; you will run into some False Positive hits when using web application firewalls. This is not something that is unique to ModSecurity. All web application firewalls will generate false positives from time to time. The following Blog post information will help to guide you through the process of identifying, fixing, implementing and testing new custom rules to address false positives.
 
http://blog.spiderlabs.com/2011/08/modsecurity-advanced-topic-of-the-week-exception-handling.html
 
 
=== Will using a large amount of negative filtering rules impact performance? ===
 
 
Yes. Each and every rule that you implement will consume resources (RAM, CPU, etc...). The two most important factors to consider with creating ModSecurity rules are the total number of rules and the Regular Expression optimizations. A single rule with a complex regular expression is significantly faster than multiple rules with simple regular expressions. Unfortunately, it is quite easy to create inefficient RegEx patterns. Optimizing RegExs by utilizing Grouping Only/Non-Capturing Parentheses can cut the validation time by up to 50%. The Core Ruleset is optimized for performance.
 
background-color: #ffffcc;
 
=== What is a Virtual Patch and why should I care? ===
 
 
Fixing identified vulnerabilities in web applications always requires time. Organizations often do not have access to a commercial application's source code and are at the vendor's mercy while waiting for a patch. Even if they have access to the code, implementing a patch in development takes time. This leaves a window of opportunity for the attacker to exploit. External patching (also called "just-in-time patching" and "virtual patching") is one of the biggest advantages of web application firewalls as they can fix this problem externally. A fix for a specific vulnerability is usually very easy to design and in most cases it can be done in less than 15 minutes.
 
 
https://www.owasp.org/index.php/Virtual_Patching_Cheat_Sheet
 
 
== Managing Alerts ==
 
 
=== How do I manage ModSecurity logs if I have multiple installations? ===
 
 
If you have more then 1 ModSecurity installation, you have undoubtedly run into issues with consolidating, analyzing and responding to alert messages. Unfortunately, the original "Serial" format of the audit log was multi-line with all records held within one file. This made remote logging difficult. What was really needed was to have a mechanism to send logs onto a centralized logging host made specifically for processing ModSecurity Alert data. This is the purpose of the mlogc program. It comes with the ModSecurity source code and can be used to send individual audit log entries to a remote host in near real-time.
 
 
=== Is there an open source Console to send my audit logs to? ===
 
 
Christian Bockermann has developed an outstanding free tool called AuditConsole that allows you to centralize and analyze remote ModSecurity audit log data.
 
 
=== Can I send ModSecurity alert log data through Syslog? ===
 
 
Yes. If you already have a central Syslog infrastructure setup and/or if you are using some sort of SIEM application, then you might want to include the short version ModSecurity alert messages that appear in the Apache error_log file. You can easily reconfigure Apache to send its error logs through Syslog onto a remote, central logging server. However, the data being forwarded is a very small subset of the entire transaction. It is only a warning message and not enough information to conduct proper incident response to determine if there was a false positive or if it was a legitimate attack. In order to determine this information, you need access to the ModSecurity Audit log files.
 
 
= Acknowledgements =
 
 
== Project Leader ==
 
 
[[:User:Chaim_sanders|Chaim Sanders]]
 
 
== Project Contributors ==
 
 
*[[:User:Chaim_sanders|Chaim Sanders]]
 
*[[:User:Rcbarnett|Ryan Barnett]]
 
*[[:user:Dune73|Christian Folini]]
 
*[[:User:lifeforms|Walter Hop]]
 
*[[:User:Josh Amishav-Zlatin|Josh Zlatin]]
 
*[[:User:Brian_Rectanus|Brian Rectanus]]
 
*[[:user:Roberto_Salgado|Roberto Salgado]]
 
*Nick Galbreath (libinjection)
 
 
See changelog for more contributors.
 
 
== Project Users ==
 
 
OWASP/WASC Distributed Web Honeypot Project uses the Core Rule Set -
 
https://www.owasp.org/index.php/OWASP_WASC_Distributed_Web_Honeypots_Project
 
 
cPanel distributes the OWASP CRS with their ModSecurity package -
 
https://documentation.cpanel.net/display/CKB/OWASP+ModSecurity+CRS
 
 
Akamai's WAF Service is based on a previous version of the Core Rule Set -
 
http://www.akamai.com/html/about/press/releases/2009/press_121409.html
 
 
CloudFlare's WAF uses the logic from the OWASP ModSecurity CRS -
 
https://www.cloudflare.com/waf
 
http://blog.cloudflare.com/cloudflares-new-waf-compiling-to-lua/
 
 
Verizon/EdgeCast WAF uses ModSecurity and the OWASP ModSecurity CRS -
 
http://www.edgecast.com/services/security/#waf
 
 
Varnish Web Cache/Accelerator uses a converted version of the CRS -
 
https://github.com/comotion/security.vcl
 
 
== Project Sponsors ==
 
 
[[Image:SpiderLabs Logo 2011.JPG|200px|left|link=https://www.trustwave.com/spiderLabs.php]]
 
<br>
 
 
= Road Map and Getting Involved =
 
This page outlines development projects which would add new functionality to ModSecurity that could be leveraged by the OWASP ModSecurity Core Rule Set.
 
 
== v3.0 Detection Concepts ==
 
This page documents the goals/ideas for the next major version of the CRS.
 
 
== Goals ==
 
These are not listed in any particular order.
 
# '''Add New Detection Logic'''
 
## Fraud Detection (Session Hijacking/CSRF/Banking Trojans)
 
## User Profiling (GeoIP/Browser Fingerprinting)
 
## HoneyTraps
 
# '''Increase Rule Accuracy'''
 
## Reduce False Positives - many users complain about the number of false positives and the negative impacts (breaking functionality) when in blocking mode
 
## Reduce False Negatives - we need to constantly improve detection so that we don't miss attacks (http://blog.spiderlabs.com/2011/07/modsecurity-sql-injection-challenge-lessons-learned.html)
 
# '''Increase Performance/Reduce Latency'''
 
## Utilize set-based pattern matching (@pm/@pmf) for pre-qualification of regular expression checks
 
## Optimize individual @rx SecRules into less optimized versions
 
## Review all regular expression rules for performance (non-capturing/greediness).
 
# '''Improve Rule Management'''
 
## Make it easier for user to enable/disable the desired rules for their platform
 
## Update rule formatting for easier readability
 
## Reorder/Regroup rule into new file names
 
 
== Detection Logic/Flow Concepts ==
 
This section outlines the processing flow and associated points of detection and actions taken.
 
# '''IP Reputation'''
 
## Data inspected: REMOTE_ADDR
 
## Use @rbl to check against remote RBLs
 
## Use @pmf to check a local file if bad IPs
 
## Use GeoIP Data to assign fraud scores
 
## '''Actions'''
 
### Deny
 
### Increase TX anomaly score
 
### Tag client as "suspicious" in IP collection
 
# '''Request Method Analysis'''
 
## Data inspected: REQUEST_METHOD
 
## Compare the REQUEST_METHOD specified against:
 
### Allowed global methods set by the admin in the modsecurity_crs_10_setup.conf file
 
### Request methods allowed per-resource (GET vs. POST)
 
## '''Actions'''
 
### Deny
 
### Increase TX anomaly score
 
### Tag client as "suspicious" in IP collection
 
# '''Request Header Analysis'''
 
## Data inspected: REQUESTE_HEADERS
 
## Check for existence of malicious headers (User-Agent of scanners, etc..)
 
## Check for the absence of required headers (Host, User-Agent, Accept)
 
## Request Header Ordering Anomalies detects non-browsers/bots
 
## '''Actions'''
 
### Deny
 
### Increase TX anomaly score
 
### Tag client as "suspicious" in IP collection
 
 
Involvement in the development and promotion of OWASP ModSecurity CRS is actively encouraged!
 
You do not have to be a security expert in order to contribute.
 
Some of the ways you can help:
 
* Contribute on the mail-list by answering questions from the community
 
* Report issues to our GitHub Issue tracker
 
 
=Upcoming Major Release 3.0.0=
 
 
The upcoming major Core Rules (CRS) release 3.0.0 is currently being developed in a separate branch on [https://github.com/SpiderLabs/owasp-modsecurity-crs/tree/v3.0.0-rc1 github]. The release is planned for the first quarter 2016. It brings incorporation of the <tt>@detectsqli</tt> and <tt>@detectxss</tt> operators and a general reduction of false positives for default setups.
 
 
==Infos about 3.0.0==
 
* [https://www.netnea.com/cms/2015/12/20/modsec-crs-2-2-x-vs-3-0-0-dev/ Blogpost comparing CRS 2.2.x with 3.0.0-dev]
 
 
===Development===
 
 
* [[OWASP_ModSec_CRS_Paranoia_Mode | Paranoia Mode / Bringing back the rules that used to yield a high number of false positives]]
 
 
=Project About=
 
{{:Projects/OWASP ModSecurity Core Rule Set Project | Project About}}} 
 
  
 
__NOTOC__ <headertabs />  
 
__NOTOC__ <headertabs />  
  
 
[[Category:OWASP Project]]  [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:SAMM-EH-3]]
 
[[Category:OWASP Project]]  [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:SAMM-EH-3]]

Latest revision as of 00:15, 10 July 2018

Main

Flagship big.jpg

OWASP ModSecurity Core Rule Set (CRS)

The 1st Line of Defense Against Web Application Attacks

The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with ModSecurity or compatible web application firewalls. The CRS aims to protect web applications from a wide range of attacks, including the OWASP Top Ten, with a minimum of false alerts. The CRS provides protection against many common attack categories, including SQL Injection, Cross Site Scripting, Locale File Inclusion, etc.

CRS-logo-full size-512x257.png

The offical website of the project can be found at https://coreruleset.org.


CRS3-movie-poster-thumb.jpeg

Getting Started / Tutorials

The following tutorials will get you started with ModSecurity and the CRS v3.

These tutorials are part of a big series of Apache / ModSecurity guides published by netnea. They are written by Christian Folini.

More Information about the rule set is available at the official website, https://coreruleset.org.

Licensing

OWASP ModSecurity CRS is free to use. It is licensed under the Apache Software License version 2 (ASLv2), so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Reporting Issues

  • If you think you've found a false positive in commercially available software and want us to take a look, submit an issue on our Github
  • Have you found a false negative/bypass? We'd love to hear about it - please responsibly disclose it to [email protected]


Project Sponsors

Trustwave Avi Networks cPanel, Inc
SpiderLabs Logo 2011.JPG Avi Networks.jpg CPanel logo.svg.png

Website

https://coreruleset.org

Social Channels

Twitter @CoreRuleSet

OWASP CRS Mailing List

Project Members

Project Leaders:

Contributors:

  • Christoph Hansen
  • Felipe 'Zimmerle' Costa
  • Franziska Bühler
  • Victor Hora
  • Federico Schwindt
  • Felipe Zipitría
  • Manuel Spartan

Quick Download

Installation Tutorial

Docker Image

Source Code Repo

GitHub Project

News and Events

We publish a monthly newsletter on the official website at https://coreruleset.org

Classifications

Owasp-flagship-trans-85.png Owasp-defenders-small.png
License: ASLv2
Project Type Files CODE.jpg

<paypal>ModSecurity Core Rule Set Project</paypal>