<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://wiki.cless.pro/index.php?action=history&amp;feed=atom&amp;title=Nginx._AlmaLinux_8._ModSecurity</id>
	<title>Nginx. AlmaLinux 8. ModSecurity - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cless.pro/index.php?action=history&amp;feed=atom&amp;title=Nginx._AlmaLinux_8._ModSecurity"/>
	<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;action=history"/>
	<updated>2026-10-22T22:02:17Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1600&amp;oldid=prev</id>
		<title>Cless в 10:30, 16 июля 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1600&amp;oldid=prev"/>
		<updated>2023-07-16T10:30:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия 10:30, 16 июля 2023&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-l335&quot;&gt;Строка 335:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 335:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Custom rules =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Custom rules =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== Block request by special parameter in a '''Query string''' ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;mkdir /usr/local/nginx/conf/modsec-rules&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;nano /usr/local/nginx/conf/modsec-rules/custom01.conf&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; SecRule ARGS:'''''testparam''''' &quot;@contains '''''test123'''''&quot; &quot;id:1234,deny,log,status:403&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;nano /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Include modsec-rules/*.conf&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;nginx -t&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;systemctl restart nginx&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Try to connect via browser to '''&amp;lt;nowiki&gt;https://cless.pro/index.html?testparam=test123&amp;lt;/nowiki&gt;''' with '''testparam=test123'''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You will get &quot;'''403 Forbidden'''&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BUT try to connect via browser to '''&amp;lt;nowiki&gt;https://cless.pro/index.html?testparam=test&amp;lt;/nowiki&gt;'''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You will get &quot;'''200 OK'''&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== SRC-IP block ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== SRC-IP block ===&lt;/div&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-l343&quot;&gt;Строка 343:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 363:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsec-rules/custom01.conf&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsec-rules/custom01.conf&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;  SecRule REMOTE_ADDR &amp;quot;@ipMatchFromFile /usr/local/nginx/conf/blacklist.txt&amp;quot; &amp;quot;id:1,phase:1,deny,status:403,msg:\'blacklist\'&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;  SecRule REMOTE_ADDR &amp;quot;@ipMatchFromFile &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;'''''&lt;/ins&gt;/usr/local/nginx/conf/blacklist.txt&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;'''''&lt;/ins&gt;&amp;quot; &amp;quot;id:1,phase:1,deny,status:403,msg:\'blacklist\'&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cless</name></author>
	</entry>
	<entry>
		<id>https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1597&amp;oldid=prev</id>
		<title>Cless в 07:12, 14 июля 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1597&amp;oldid=prev"/>
		<updated>2023-07-14T07:12:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия 07:12, 14 июля 2023&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-l333&quot;&gt;Строка 333:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 333:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ModSecurity: '''''Access denied with code 403''''' (phase 2). Matched &amp;quot;Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file &amp;quot;/usr/local/nginx/conf/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf&amp;quot;] [line &amp;quot;80&amp;quot;] [id &amp;quot;949110&amp;quot;] [rev &amp;quot;&amp;quot;] [msg &amp;quot;Inbound Anomaly Score Exceeded (Total Score: 5)&amp;quot;] [data &amp;quot;&amp;quot;] [severity &amp;quot;2&amp;quot;] [ver &amp;quot;OWASP_CRS/3.2.0&amp;quot;] [maturity &amp;quot;0&amp;quot;] [accuracy &amp;quot;0&amp;quot;] [tag &amp;quot;application-multi&amp;quot;] [tag &amp;quot;language-multi&amp;quot;] [tag &amp;quot;platform-multi&amp;quot;] [tag &amp;quot;attack-generic&amp;quot;] [hostname &amp;quot;192.168.199.187&amp;quot;] [uri &amp;quot;/index.html&amp;quot;] [unique_id &amp;quot;168927339520.223489&amp;quot;] [ref &amp;quot;&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ModSecurity: '''''Access denied with code 403''''' (phase 2). Matched &amp;quot;Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file &amp;quot;/usr/local/nginx/conf/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf&amp;quot;] [line &amp;quot;80&amp;quot;] [id &amp;quot;949110&amp;quot;] [rev &amp;quot;&amp;quot;] [msg &amp;quot;Inbound Anomaly Score Exceeded (Total Score: 5)&amp;quot;] [data &amp;quot;&amp;quot;] [severity &amp;quot;2&amp;quot;] [ver &amp;quot;OWASP_CRS/3.2.0&amp;quot;] [maturity &amp;quot;0&amp;quot;] [accuracy &amp;quot;0&amp;quot;] [tag &amp;quot;application-multi&amp;quot;] [tag &amp;quot;language-multi&amp;quot;] [tag &amp;quot;platform-multi&amp;quot;] [tag &amp;quot;attack-generic&amp;quot;] [hostname &amp;quot;192.168.199.187&amp;quot;] [uri &amp;quot;/index.html&amp;quot;] [unique_id &amp;quot;168927339520.223489&amp;quot;] [ref &amp;quot;&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Custom rules =&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== SRC-IP block ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/blacklist.txt&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1.2.3.4&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 5.6.7.8&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;mkdir /usr/local/nginx/conf/modsec-rules&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsec-rules/custom01.conf&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; SecRule REMOTE_ADDR &amp;quot;@ipMatchFromFile /usr/local/nginx/conf/blacklist.txt&amp;quot; &amp;quot;id:1,phase:1,deny,status:403,msg:\'blacklist\'&amp;quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Include modsec-rules/*.conf&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;nginx -t&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;systemctl restart nginx&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Try to connect via browser to '''&amp;lt;nowiki&amp;gt;https://cless.pro/index.html&amp;lt;/nowiki&amp;gt;''' via SRC-IP from '''blacklist.txt'''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You will get &amp;quot;'''403 Forbidden'''&amp;quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Nginx]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Nginx]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:AlmaLinux 8]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:AlmaLinux 8]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Web Application Firewall (WAF)]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Web Application Firewall (WAF)]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cless</name></author>
	</entry>
	<entry>
		<id>https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1593&amp;oldid=prev</id>
		<title>Cless в 19:04, 13 июля 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1593&amp;oldid=prev"/>
		<updated>2023-07-13T19:04:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия 19:04, 13 июля 2023&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-l333&quot;&gt;Строка 333:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 333:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ModSecurity: '''''Access denied with code 403''''' (phase 2). Matched &amp;quot;Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file &amp;quot;/usr/local/nginx/conf/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf&amp;quot;] [line &amp;quot;80&amp;quot;] [id &amp;quot;949110&amp;quot;] [rev &amp;quot;&amp;quot;] [msg &amp;quot;Inbound Anomaly Score Exceeded (Total Score: 5)&amp;quot;] [data &amp;quot;&amp;quot;] [severity &amp;quot;2&amp;quot;] [ver &amp;quot;OWASP_CRS/3.2.0&amp;quot;] [maturity &amp;quot;0&amp;quot;] [accuracy &amp;quot;0&amp;quot;] [tag &amp;quot;application-multi&amp;quot;] [tag &amp;quot;language-multi&amp;quot;] [tag &amp;quot;platform-multi&amp;quot;] [tag &amp;quot;attack-generic&amp;quot;] [hostname &amp;quot;192.168.199.187&amp;quot;] [uri &amp;quot;/index.html&amp;quot;] [unique_id &amp;quot;168927339520.223489&amp;quot;] [ref &amp;quot;&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ModSecurity: '''''Access denied with code 403''''' (phase 2). Matched &amp;quot;Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file &amp;quot;/usr/local/nginx/conf/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf&amp;quot;] [line &amp;quot;80&amp;quot;] [id &amp;quot;949110&amp;quot;] [rev &amp;quot;&amp;quot;] [msg &amp;quot;Inbound Anomaly Score Exceeded (Total Score: 5)&amp;quot;] [data &amp;quot;&amp;quot;] [severity &amp;quot;2&amp;quot;] [ver &amp;quot;OWASP_CRS/3.2.0&amp;quot;] [maturity &amp;quot;0&amp;quot;] [accuracy &amp;quot;0&amp;quot;] [tag &amp;quot;application-multi&amp;quot;] [tag &amp;quot;language-multi&amp;quot;] [tag &amp;quot;platform-multi&amp;quot;] [tag &amp;quot;attack-generic&amp;quot;] [hostname &amp;quot;192.168.199.187&amp;quot;] [uri &amp;quot;/index.html&amp;quot;] [unique_id &amp;quot;168927339520.223489&amp;quot;] [ref &amp;quot;&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Nginx]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Nginx]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:AlmaLinux 8]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:AlmaLinux 8]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Категория:Web Application Firewall (WAF)]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cless</name></author>
	</entry>
	<entry>
		<id>https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1592&amp;oldid=prev</id>
		<title>Cless: Новая страница: «= Description = ModSecurity, sometimes called Modsec, is an open-source web application firewall (WAF) to provide protections against generic classes of vulnerabi...»</title>
		<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Nginx._AlmaLinux_8._ModSecurity&amp;diff=1592&amp;oldid=prev"/>
		<updated>2023-07-13T18:59:06Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: «= Description = ModSecurity, sometimes called Modsec, is an open-source web application firewall (WAF) to provide protections against generic classes of vulnerabi...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Description =&lt;br /&gt;
ModSecurity, sometimes called Modsec, is an open-source web application firewall (WAF) to provide protections against generic classes of vulnerabilities using the OWASP ModSecurity Core Rule Set (CRS)&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
https://aventistech.com/kb/modsecurity-with-nginx-on-centos-8/&lt;br /&gt;
&lt;br /&gt;
= Common Installation =&lt;br /&gt;
Perform System Update&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf check-update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Free up disk space by deleting all downloaded software package and all cached repository &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf clean all&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install required build tools and dependencies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf install -y gcc-c++ flex bison yajl curl-devel curl zlib-devel pcre-devel autoconf automake git curl make libxml2-devel pkgconfig libtool httpd-devel redhat-rpm-config git wget openssl openssl-devel vim nano&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf install -y &amp;lt;nowiki&amp;gt;https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf install -y &amp;lt;nowiki&amp;gt;https://rpms.remirepo.net/enterprise/remi-release-8.rpm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf --enablerepo=powertools install -y doxygen yajl-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf --enablerepo=remi install -y GeoIP-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ModSecurity Compile =&lt;br /&gt;
Clone the latest LibModsecurity GitHub repository to /opt/modsec&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /opt/modsec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/modsec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git clone --depth 1 -b v3/master --single-branch &amp;lt;nowiki&amp;gt;https://github.com/SpiderLabs/ModSecurity&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile and install ModSecurity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd ModSecurity&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git submodule init&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git submodule update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./build.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./configure&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Nginx Compile to support ModSecurity =&lt;br /&gt;
Download the ModSecurity-nginx connector which provides a communication channel between Nginx and LibModsecurity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/modsec&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/SpiderLabs/ModSecurity-nginx.git&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a non-privileged system user and group for Nginx&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;useradd -r -M -s /sbin/nologin -d /usr/local/nginx nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download Nginx and extract it to /opt/nginx&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;wget &amp;lt;nowiki&amp;gt;http://nginx.org/download/nginx-1.17.6.tar.gz&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tar xzf nginx-1.17.6.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile Nginx from source code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd nginx-1.17.6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./configure --user=nginx --group=nginx --with-pcre-jit --with-debug --with-http_ssl_module --with-http_v2_module --with-http_realip_module --add-module=/opt/modsec/ModSecurity-nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a systemd service for Nginx&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /etc/systemd/system/nginx.service&amp;lt;/code&amp;gt;&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=The nginx HTTP and reverse proxy server&lt;br /&gt;
 After=network.target remote-fs.target nss-lookup.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=forking&lt;br /&gt;
 PIDFile=/run/nginx.pid&lt;br /&gt;
 ExecStartPre=/usr/bin/rm -f /run/nginx.pid&lt;br /&gt;
 ExecStartPre=/usr/sbin/nginx -t&lt;br /&gt;
 ExecStart=/usr/sbin/nginx&lt;br /&gt;
 ExecReload=/bin/kill -s HUP $MAINPID&lt;br /&gt;
 KillSignal=SIGQUIT&lt;br /&gt;
 TimeoutStopSec=5&lt;br /&gt;
 KillMode=mixed&lt;br /&gt;
 PrivateTmp=true&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
Create a symbolic link of Nginx binary to /usr/sbin/ path.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s /usr/local/nginx/sbin/nginx /usr/sbin/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the location of pid to /run/nginx.pid in Nginx config file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/nginx.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 pid        /run/nginx.pid;&lt;br /&gt;
 ...&lt;br /&gt;
Enable and start Nginx service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl enable --now nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allow Firewalld for HTTP &amp;amp; HTTPS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;firewall-cmd --permanent --zone=public --add-service=http&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;firewall-cmd --permanent --zone=public --add-service=https&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart firewalld.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify HTTP &amp;amp; HTTPS is allowed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;firewall-cmd --list-all&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be able to access to Nginx Web Server via &amp;lt;nowiki&amp;gt;http://IP-ADDRESS&amp;lt;/nowiki&amp;gt; now&lt;br /&gt;
&lt;br /&gt;
= Let’s Encrypt Wildcard SSL Certificate =&lt;br /&gt;
'''''&amp;lt;ADD LINK TO LETSENCRYPT MANUAL&amp;gt;'''''&lt;br /&gt;
&lt;br /&gt;
Let’s Encrypt wildcard SSL Certificate is stored in /etc/letsencrypt/live/cless.pro&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ls  /etc/letsencrypt/live/cless.pro&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 cert.pem  chain.pem  fullchain.pem  privkey.pem  README&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
= Enable SSL &amp;amp; HTTP/2 Support =&lt;br /&gt;
Copy the cert.pem &amp;amp; privkey.pem to /usr/local/nginx/ssl/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /usr/local/nginx/ssl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /etc/letsencrypt/live/cless.pro/cert.pem  /usr/local/nginx/ssl/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /etc/letsencrypt/live/cless.pro/privkey.pem  /usr/local/nginx/ssl/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add HTTPS config into Nginx configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/nginx.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 server {&lt;br /&gt;
         # Enable SSL&lt;br /&gt;
         listen       443 ssl http2;&lt;br /&gt;
         server_name  localhost uat.aventis.dev;&lt;br /&gt;
 &lt;br /&gt;
         # Letsencrypt enable&lt;br /&gt;
         ssl_certificate /usr/local/nginx/ssl/cert.pem;&lt;br /&gt;
         ssl_certificate_key /usr/local/nginx/ssl/privkey.pem;&lt;br /&gt;
 }&lt;br /&gt;
 ...&lt;br /&gt;
Verify the configuration file of Nginx and restart the service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nginx -t&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to '''&amp;lt;nowiki&amp;gt;https://cless.pro&amp;lt;/nowiki&amp;gt;''' and verify that HTTP/2 is enabled&lt;br /&gt;
&lt;br /&gt;
= PHP-FPM with NGINX =&lt;br /&gt;
&amp;lt;code&amp;gt;dnf module list php&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the latest PHP 7.4 Module&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf module reset php&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf module enable -y php:remi-7.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dnf install -y php php-opcache php-gd php-curl php-mysqlnd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;php -v&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the PHP-FPM to use nginx instead of Apache user in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /etc/php-fpm.d/www.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 user = nginx&lt;br /&gt;
 group = nginx&lt;br /&gt;
 ...&lt;br /&gt;
Enable and start PHP-FPM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl enable php-fpm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl start php-fpm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure PHP-FPM with Nginx by modifying /usr/local/nginx/conf/nginx.conf&amp;lt;blockquote&amp;gt;!!! ADD FOLLOWING INTO HTTPS SECTION: server { listen 443 ssl http2; &amp;lt;...&amp;gt; }&amp;lt;/blockquote&amp;gt;&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/nginx.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 http {&lt;br /&gt;
     server {&lt;br /&gt;
         listen 443 ssl http2;&lt;br /&gt;
         ...&lt;br /&gt;
         '''''location ~ \.php$ {&lt;br /&gt;
             root           html;&lt;br /&gt;
             fastcgi_pass  unix:/run/php-fpm/www.sock;&lt;br /&gt;
             fastcgi_index  index.php;&lt;br /&gt;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
             include        fastcgi_params;'''''&lt;br /&gt;
         }&lt;br /&gt;
     ...&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 ...&lt;br /&gt;
Restart Nginx &amp;amp; PHP-FPM services&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart php-fpm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create '''info.php''' in '''/usr/local/nginx/html''' (Default Root Directory for Nginx)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /usr/local/nginx/html/info.php&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
  phpinfo();&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
Go to '''&amp;lt;nowiki&amp;gt;https://cless.pro/info.php&amp;lt;/nowiki&amp;gt;''' to verify PHP is installed successfully&lt;br /&gt;
&lt;br /&gt;
= Confgure Nginx with ModSecurity =&lt;br /&gt;
Copy the Sample ModSecurity config file and unicode.mapping from ModSecurity source directory to Nginx configuration directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /opt/modsec/ModSecurity/modsecurity.conf-recommended /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /opt/modsec/ModSecurity/unicode.mapping /usr/local/nginx/conf/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a backup for Nginx config file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create /var/log/nginx to keep all the access &amp;amp; error log&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /var/log/nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following to the '''nginx.conf''' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/nginx.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 '''''user nginx;'''''&lt;br /&gt;
 ...&lt;br /&gt;
 # !!! ADD FOLLOWING INTO HTTPS SECTION: server { listen 443 ssl http2; &amp;lt;...&amp;gt; }&lt;br /&gt;
 ...&lt;br /&gt;
 http {&lt;br /&gt;
     server {&lt;br /&gt;
         listen 443 ssl http2;&lt;br /&gt;
         ...&lt;br /&gt;
         '''''modsecurity  on;&lt;br /&gt;
         modsecurity_rules_file  /usr/local/nginx/conf/modsecurity.conf;&lt;br /&gt;
         access_log /var/log/nginx/access.log;&lt;br /&gt;
         error_log /var/log/nginx/error.log;'''''&lt;br /&gt;
         ...&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 ...&lt;br /&gt;
Restart Nginx service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turn On ModSecurity Rule Engine and change the default log directory for ModSecurity to /var/log/nginx/modsec_audit.log&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 # Enable ModSecurity, attaching it to every transaction. Use detection&lt;br /&gt;
 # only to start with, because that minimises the chances of post-installation&lt;br /&gt;
 # disruption.&lt;br /&gt;
 #&lt;br /&gt;
 # By default, ModSecurity is set on detection only mode where it only logs the requests based on the triggered rules without blocking anything&lt;br /&gt;
 # DEFAULT - ONLY DETECTION&lt;br /&gt;
 # TURN IT ON IF YOU WANT TO BLOCK REQUESTS&lt;br /&gt;
 &lt;br /&gt;
 #SecRuleEngine DetectionOnly&lt;br /&gt;
 '''''SecRuleEngine On'''''&lt;br /&gt;
 &lt;br /&gt;
 # Use a single file for logging. This is much easier to look at, but&lt;br /&gt;
 # assumes that you will use the audit log only ocassionally.&lt;br /&gt;
 &lt;br /&gt;
 '''''SecAuditLogType Serial&lt;br /&gt;
 SecAuditLog /var/log/nginx/modsec_audit.log'''''&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
= Install OWASP ModSecurity Core Rule Set (CRS) =&lt;br /&gt;
The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with ModSecurity. It aims at protecting the web applications from a wide range of attacks, including the OWASP Top Ten, minimum of false alerts.&lt;br /&gt;
&lt;br /&gt;
Clone the CRS from GitHub Repository to /usr/local/nginx/conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/SpiderLabs/owasp-modsecurity-crs.git&amp;lt;/nowiki&amp;gt; /usr/local/nginx/conf/owasp-crs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rename the crs-setup.conf.example to crs-setup.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /usr/local/nginx/conf/owasp-crs/crs-setup.conf.example /usr/local/nginx/conf/owasp-crs/crs-setup.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include the OWASP rule to /usr/local/nginx/conf/modsecurity.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /usr/local/nginx/conf/modsecurity.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 Include owasp-crs/crs-setup.conf&lt;br /&gt;
 Include owasp-crs/rules/*.conf&lt;br /&gt;
Verify Nginx configuration file and restart Nginx service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nginx -t&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
systemctl restart nginx&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
=== On arbitrary client in CLI or in GUI Browser ===&lt;br /&gt;
&amp;lt;code&amp;gt;curl -k &amp;lt;nowiki&amp;gt;https://cless.pro/index.html?exec=/bin/bash&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;lt;html&amp;gt;&lt;br /&gt;
     &amp;lt;head&amp;gt;&amp;lt;title&amp;gt;403 Forbidden&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;center&amp;gt;&amp;lt;h1&amp;gt;403 Forbidden&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;hr&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;center&amp;gt;nginx/1.17.6&amp;lt;/center&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;/body&amp;gt;&lt;br /&gt;
     &amp;lt;/html&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
&lt;br /&gt;
=== On Nginx server ===&lt;br /&gt;
&amp;lt;code&amp;gt;tail /var/log/nginx/modsec_audit.log&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 ModSecurity: '''''Warning. Matched &amp;quot;Operator `PmFromFile' with parameter `unix-shell.data' against variable `ARGS:exec' (Value: `/bin/bash' )''''' [file &amp;quot;/usr/local/nginx/conf/owasp-crs/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf&amp;quot;] [line &amp;quot;496&amp;quot;] [id &amp;quot;932160&amp;quot;] [rev &amp;quot;&amp;quot;] [msg &amp;quot;Remote Command Execution: Unix Shell Code Found&amp;quot;] [data &amp;quot;Matched Data: bin/bash found within ARGS:exec: /bin/bash&amp;quot;] [severity &amp;quot;2&amp;quot;] [ver &amp;quot;OWASP_CRS/3.2.0&amp;quot;] [maturity &amp;quot;0&amp;quot;] [accuracy &amp;quot;0&amp;quot;] [tag &amp;quot;application-multi&amp;quot;] [tag &amp;quot;language-shell&amp;quot;] [tag &amp;quot;platform-unix&amp;quot;] [tag &amp;quot;attack-rce&amp;quot;] [tag &amp;quot;paranoia-level/1&amp;quot;] [tag &amp;quot;OWASP_CRS&amp;quot;] [tag &amp;quot;OWASP_CRS/WEB_ATTACK/COMMAND_INJECTION&amp;quot;] [tag &amp;quot;WASCTC/WASC-31&amp;quot;] [tag &amp;quot;OWASP_TOP_10/A1&amp;quot;] [tag &amp;quot;PCI/6.5.2&amp;quot;] [hostname &amp;quot;192.168.199.187&amp;quot;] [uri &amp;quot;/index.html&amp;quot;] [unique_id &amp;quot;168927378047.184148&amp;quot;] [ref &amp;quot;o1,8v21,9t:urlDecodeUni,t:cmdLine,t:normalizePath,t:lowercase&amp;quot;]&lt;br /&gt;
 &lt;br /&gt;
 ModSecurity: '''''Access denied with code 403''''' (phase 2). Matched &amp;quot;Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file &amp;quot;/usr/local/nginx/conf/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf&amp;quot;] [line &amp;quot;80&amp;quot;] [id &amp;quot;949110&amp;quot;] [rev &amp;quot;&amp;quot;] [msg &amp;quot;Inbound Anomaly Score Exceeded (Total Score: 5)&amp;quot;] [data &amp;quot;&amp;quot;] [severity &amp;quot;2&amp;quot;] [ver &amp;quot;OWASP_CRS/3.2.0&amp;quot;] [maturity &amp;quot;0&amp;quot;] [accuracy &amp;quot;0&amp;quot;] [tag &amp;quot;application-multi&amp;quot;] [tag &amp;quot;language-multi&amp;quot;] [tag &amp;quot;platform-multi&amp;quot;] [tag &amp;quot;attack-generic&amp;quot;] [hostname &amp;quot;192.168.199.187&amp;quot;] [uri &amp;quot;/index.html&amp;quot;] [unique_id &amp;quot;168927339520.223489&amp;quot;] [ref &amp;quot;&amp;quot;]&lt;br /&gt;
 ...&lt;br /&gt;
[[Категория:Nginx]]&lt;br /&gt;
[[Категория:AlmaLinux 8]]&lt;br /&gt;
__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;</summary>
		<author><name>Cless</name></author>
	</entry>
</feed>