<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/index.php?action=history&amp;feed=atom&amp;title=OWASP_ModSecurity_rule_evaluation_framework</id>
		<title>OWASP ModSecurity rule evaluation framework - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/index.php?action=history&amp;feed=atom&amp;title=OWASP_ModSecurity_rule_evaluation_framework"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;action=history"/>
		<updated>2026-04-10T15:44:07Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;diff=211881&amp;oldid=prev</id>
		<title>Dune73: Additions here and there</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;diff=211881&amp;oldid=prev"/>
				<updated>2016-03-28T04:42:47Z</updated>
		
		<summary type="html">&lt;p&gt;Additions here and there&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 04:42, 28 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l8&quot; &gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern ''essential'' for detecting the attack?''' That is, is there no other way to detect the attack class? If we have multiple mechanisms in our toolbox (e.g. &amp;lt;code&amp;gt;@detectSQLi&amp;lt;/code&amp;gt; to detect SQLi in addition to regexps), a singular rule may become less important. If this rule is the only way to detect the attack however, the rule becomes more important.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern ''essential'' for detecting the attack?''' That is, is there no other way to detect the attack class? If we have multiple mechanisms in our toolbox (e.g. &amp;lt;code&amp;gt;@detectSQLi&amp;lt;/code&amp;gt; to detect SQLi in addition to regexps), a singular rule may become less important. If this rule is the only way to detect the attack however, the rule becomes more important.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern ''complete'' in detecting the attack?''' For instance, we can completely rule out path traversal attacks by blocking `../` and its encoded forms, which makes it an important pattern. At the other hand, the data file &amp;lt;code&amp;gt;php-variables.data&amp;lt;/code&amp;gt; indicates PHP code, but it's possible to inject PHP variables while bypassing this data file, so it contributes less.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern ''complete'' in detecting the attack?''' For instance, we can completely rule out path traversal attacks by blocking `../` and its encoded forms, which makes it an important pattern. At the other hand, the data file &amp;lt;code&amp;gt;php-variables.data&amp;lt;/code&amp;gt; indicates PHP code, but it's possible to inject PHP variables while bypassing this data file, so it contributes less.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How common is the attack?''' Are the attacks seen in the wild? Do we have examples of mass scans or use in vulnerability scanners? Grep audit logs.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How common is the attack?''' Are the attacks seen in the wild? Do we have examples of mass scans or use in vulnerability scanners? Grep &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;error- and &lt;/ins&gt;audit&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;-&lt;/ins&gt;logs.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How severe would it be for a user if we would remove this rule?''' If the attack is 'omitting an Accept header', the user loses only a signal for unusual activity. If the attack is a reliable remote code injection, the user loses a lot of security.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How severe would it be for a user if we would remove this rule?''' If the attack is 'omitting an Accept header', the user loses only a signal for unusual activity. If the attack is a reliable remote code injection, the user loses a lot of security.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot; &gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How big do we judge the chance of false positives?''' Can we come up with reasonable examples of bona fide traffic that triggers the pattern?&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How big do we judge the chance of false positives?''' Can we come up with reasonable examples of bona fide traffic that triggers the pattern?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Can we find false-positive matches in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;audit &lt;/del&gt;logs?''' Grep audit logs for a rule ID.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Can we find false-positive matches in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;logs?''' Grep &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;error- and &lt;/ins&gt;audit&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;-&lt;/ins&gt;logs for a rule ID.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Do people often write exceptions for the rule?''' Grep configurations for whitelistings and exceptions. Mailinglist posts and forum posts can be found in Google too.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Do people often write exceptions for the rule?''' Grep configurations for whitelistings and exceptions. Mailinglist posts and forum posts can be found in Google too.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How high is the rule severity?''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;A false positive of a rule &lt;/del&gt;with &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;anomaly&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;' severity will not lead to downtime&lt;/del&gt;. A false positive of a rule with 'critical' severity will cause downtime.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How high is the rule severity?''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Moat rules are written &lt;/ins&gt;with &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;severity &amp;quot;critical&amp;quot;. But &amp;quot;notice&amp;quot; and &amp;quot;&lt;/ins&gt;anomaly&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot; can be used alternatively. If you are running in scoring mode, this makes a substantial difference&lt;/ins&gt;. A false positive of a rule with 'critical' severity will cause downtime &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;quickly&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Strategies for resolution of false negatives==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Strategies for resolution of false negatives==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Improve completeness by adding alternative patterns.''' For a rule detecting shell command injection, compile a list of possible other shell commands. For a rule detecting LFI injection, compile a list of high-value local files such as web application configuration files.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Improve completeness by adding alternative patterns.''' For a rule detecting shell command injection, compile a list of possible other shell commands. For a rule detecting LFI injection, compile a list of high-value local files such as web application configuration files.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Create additional rule(s) to detect evasion techniques.''' For example, attackers often hide PHP code by encoding it, but in this case they need a decoding function like &amp;lt;code&amp;gt;gzdecode&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;base64_decode&amp;lt;/code&amp;gt; which we may be able to detect.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Create additional rule(s) to detect evasion techniques.''' For example, attackers often hide PHP code by encoding it, but in this case they need a decoding function like &amp;lt;code&amp;gt;gzdecode&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;base64_decode&amp;lt;/code&amp;gt; which we may be able to detect&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Many more evasion methods exist and it takes a lot of experience to detect them as &amp;quot;WAF evasion&amp;quot; is an attack discpline on its own&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Make the rule more sensitive.''' Some rules may count a number of characters. We might have the rule trigger at a lower number of characters.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Make the rule more sensitive.''' Some rules may count a number of characters. We might have the rule trigger at a lower number of characters&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Or we can add more character to the list&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Increase potential total score.''' If a rule does fire, but the total score remains low, consider partitioning patterns/data file entries into multiple rules. Each separate rule hit would increase the total attack score.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Increase potential total score.''' If a rule does fire, but the total score remains low, consider partitioning patterns/data file entries into multiple rules. Each separate rule hit would increase the total attack score.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dune73</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;diff=211778&amp;oldid=prev</id>
		<title>Lifeforms: /* Contribution of a rule to user security */</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;diff=211778&amp;oldid=prev"/>
				<updated>2016-03-25T17:02:49Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Contribution of a rule to user security&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:02, 25 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot; &gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern useful for detecting attacks?''' Can we find good example of attack requests?&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern useful for detecting attacks?''' Can we find good example of attack requests?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;_essential_ &lt;/del&gt;for detecting the attack?''' That is, is there no other way to detect the attack class? If we have multiple mechanisms in our toolbox (e.g. &amp;lt;code&amp;gt;@detectSQLi&amp;lt;/code&amp;gt; to detect SQLi in addition to regexps), a singular rule may become less important. If this rule is the only way to detect the attack however, the rule becomes more important.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''essential'' &lt;/ins&gt;for detecting the attack?''' That is, is there no other way to detect the attack class? If we have multiple mechanisms in our toolbox (e.g. &amp;lt;code&amp;gt;@detectSQLi&amp;lt;/code&amp;gt; to detect SQLi in addition to regexps), a singular rule may become less important. If this rule is the only way to detect the attack however, the rule becomes more important.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;_complete_ for &lt;/del&gt;detecting the attack?''' For instance, we can completely rule out path traversal attacks by blocking `../` and its encoded forms, which makes it an important pattern. At the other hand, the data file &amp;lt;code&amp;gt;php-variables.data&amp;lt;/code&amp;gt; indicates PHP code, but it's possible to inject PHP variables while bypassing this data file, so it contributes less.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''Is the rule or pattern &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''complete'' in &lt;/ins&gt;detecting the attack?''' For instance, we can completely rule out path traversal attacks by blocking `../` and its encoded forms, which makes it an important pattern. At the other hand, the data file &amp;lt;code&amp;gt;php-variables.data&amp;lt;/code&amp;gt; indicates PHP code, but it's possible to inject PHP variables while bypassing this data file, so it contributes less.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How common is the attack?''' Are the attacks seen in the wild? Do we have examples of mass scans or use in vulnerability scanners? Grep audit logs.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How common is the attack?''' Are the attacks seen in the wild? Do we have examples of mass scans or use in vulnerability scanners? Grep audit logs.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How severe would it be for a user if we would remove this rule?''' If the attack is 'omitting an Accept header', the user loses only a signal for unusual activity. If the attack is a reliable remote code injection, the user loses a lot of security.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# '''How severe would it be for a user if we would remove this rule?''' If the attack is 'omitting an Accept header', the user loses only a signal for unusual activity. If the attack is a reliable remote code injection, the user loses a lot of security.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lifeforms</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;diff=211776&amp;oldid=prev</id>
		<title>Lifeforms: Created page with &quot;During development of the OWASP ModSec CRS Paranoia Mode, there have been discussions about various individual CRS rules, but they are mostly unstructured.  This framework...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_ModSecurity_rule_evaluation_framework&amp;diff=211776&amp;oldid=prev"/>
				<updated>2016-03-25T16:59:15Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;During development of the &lt;a href=&quot;/index.php/OWASP_ModSec_CRS_Paranoia_Mode&quot; title=&quot;OWASP ModSec CRS Paranoia Mode&quot;&gt;OWASP ModSec CRS Paranoia Mode&lt;/a&gt;, there have been discussions about various individual CRS rules, but they are mostly unstructured.  This framework...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;During development of the [[OWASP ModSec CRS Paranoia Mode]], there have been discussions about various individual CRS rules, but they are mostly unstructured.&lt;br /&gt;
&lt;br /&gt;
This framework can be used to guide those discussions, and might provide a checklist for a thorough evaluation of a CRS rule, and possible actions to improve the rule.&lt;br /&gt;
&lt;br /&gt;
==Contribution of a rule to user security==&lt;br /&gt;
&lt;br /&gt;
# '''Is the rule or pattern useful for detecting attacks?''' Can we find good example of attack requests?&lt;br /&gt;
# '''Is the rule or pattern _essential_ for detecting the attack?''' That is, is there no other way to detect the attack class? If we have multiple mechanisms in our toolbox (e.g. &amp;lt;code&amp;gt;@detectSQLi&amp;lt;/code&amp;gt; to detect SQLi in addition to regexps), a singular rule may become less important. If this rule is the only way to detect the attack however, the rule becomes more important.&lt;br /&gt;
# '''Is the rule or pattern _complete_ for detecting the attack?''' For instance, we can completely rule out path traversal attacks by blocking `../` and its encoded forms, which makes it an important pattern. At the other hand, the data file &amp;lt;code&amp;gt;php-variables.data&amp;lt;/code&amp;gt; indicates PHP code, but it's possible to inject PHP variables while bypassing this data file, so it contributes less.&lt;br /&gt;
# '''How common is the attack?''' Are the attacks seen in the wild? Do we have examples of mass scans or use in vulnerability scanners? Grep audit logs.&lt;br /&gt;
# '''How severe would it be for a user if we would remove this rule?''' If the attack is 'omitting an Accept header', the user loses only a signal for unusual activity. If the attack is a reliable remote code injection, the user loses a lot of security.&lt;br /&gt;
&lt;br /&gt;
==Contribution of a rule to false positives==&lt;br /&gt;
&lt;br /&gt;
# '''How big do we judge the chance of false positives?''' Can we come up with reasonable examples of bona fide traffic that triggers the pattern?&lt;br /&gt;
# '''Can we find false-positive matches in audit logs?''' Grep audit logs for a rule ID.&lt;br /&gt;
# '''Do people often write exceptions for the rule?''' Grep configurations for whitelistings and exceptions. Mailinglist posts and forum posts can be found in Google too.&lt;br /&gt;
# '''How high is the rule severity?''' A false positive of a rule with 'anomaly' severity will not lead to downtime. A false positive of a rule with 'critical' severity will cause downtime.&lt;br /&gt;
&lt;br /&gt;
==Strategies for resolution of false negatives==&lt;br /&gt;
&lt;br /&gt;
# '''Improve completeness by adding alternative patterns.''' For a rule detecting shell command injection, compile a list of possible other shell commands. For a rule detecting LFI injection, compile a list of high-value local files such as web application configuration files.&lt;br /&gt;
# '''Create additional rule(s) to detect evasion techniques.''' For example, attackers often hide PHP code by encoding it, but in this case they need a decoding function like &amp;lt;code&amp;gt;gzdecode&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;base64_decode&amp;lt;/code&amp;gt; which we may be able to detect.&lt;br /&gt;
# '''Make the rule more sensitive.''' Some rules may count a number of characters. We might have the rule trigger at a lower number of characters.&lt;br /&gt;
# '''Increase potential total score.''' If a rule does fire, but the total score remains low, consider partitioning patterns/data file entries into multiple rules. Each separate rule hit would increase the total attack score.&lt;br /&gt;
&lt;br /&gt;
==Strategies for resolution of false positives==&lt;br /&gt;
&lt;br /&gt;
# '''Keep the rule, but document.''' If the rule is extremely important, and the level of false positives is not too high, we can consider to accept a false positive. We can possibly add a documentation example about whitelisting.&lt;br /&gt;
# '''Make rule or pattern more specific.''' For instance, instead of matching &amp;lt;code&amp;gt;sh&amp;lt;/code&amp;gt; (which causes false positives in text) we can reason that an attacker likely wants to access &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; or puts &amp;lt;code&amp;gt;sh&amp;lt;/code&amp;gt; at the beginning of a string, so we can look for such patterns instead. This may allow us to keep the modified rule at original paranoia level so it protects as many users as possible.&lt;br /&gt;
# '''Exclude some variables from checking.''' For instance, if a rule checks cookies as well as parameters, and we find many false positives in cookies, we might consider excluding cookies from this rule, or splitting the cookie check into another rule.&lt;br /&gt;
# '''Make the rule less sensitive, but create a more sensitive sibling at higher paranoia level.''' If the rule or pattern is useful, and we can devise a less-sensitive version with less FP that would still contribute positively, we may adjust the rule in-place, and move the original rule to a higher paranoia level, so power users still can enjoy the full security offered by the original rule.&lt;br /&gt;
# '''Move the whole rule to a higher paranoia level.''' If we find the rule or pattern has a medium (but not high) contribution, and a high false positive rate, and we cannot separate or split the rule, we can consider moving the rule to a higher paranoia level. We will have to accept that novice users won't be protected.&lt;br /&gt;
# '''Remove the rule completely.''' If the rule's contribution is too low to justify the cost, even at high paranoia level, consider removing it.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP ModSecurity Core Rule Set Project]]&lt;/div&gt;</summary>
		<author><name>Lifeforms</name></author>	</entry>

	</feed>