• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue ModSecurity rule exception not working

benjamin-lgba

New Pleskian
Server operating system version
Windows Server 2019 Standard, Version 1809
Plesk version and microupdate number
Plesk Obsidian Web Host Edition Version 18.0.46 Update #1
I need to make requests to the server via python scripts. This is prevented by default through ModSecurity Rule 913101 (User-Agent associated with scripting/generic HTTP client). To keep the highest level of security, I want to allow python requests only from certain IP addresses. For this reason I have implemented the following rule server-wide (Tools & Settings > Web Application Firewall (ModSecurity) > Settings > Configuration > Custom directives):

SecRule REMOTE_ADDR "^XXX\.XXX\.XXX\.(123|124)$" "id:1,phase:1,nolog,allow,ctl:ruleRemoveById=913101"

I have no experience working with ModSecurity but to my understanding it means that rule 913101 should be ignored when the requests comes from IP addresses matching the regular expression, so XXX.XXX.XXX.123 and XXX.XXX.XXX.124. However, I still get denied when sending requests via python.

Is my rule wrong or is there something else I'm missing?
 
Try to debug it with the ModSecurity log.
ModSecurity audit logs are domain-specific on Windows. They’re found in %plesk_dir%\ModSecurity\vhosts\<domain’s GUID>\logs ( %plesk_dir% is Plesk’s default installation directory).

Domain's GUID can be found with:

C:\> plesk db "select name,guid from domains where name='example.com'"
 
Thanks for the reply but I can't debug like that. We don't have any domains so there are no entries in the vhosts directory. I did however find the rule I added in Plesk/ModSecurity/rules/modsecurity_30_custom.
 
Make use of the ModSecurity log to troubleshoot the issue.
The ModSecurity audit logs on Windows are customised for each domain. They may be located in the directory %plesk dir%ModSecurityvhostsdomain's GUID>logs (the directory %plesk dir% is where Plesk is installed by default).
 
Make use of the ModSecurity log to troubleshoot the issue.
The ModSecurity audit logs on Windows are customised for each domain. They may be located in the directory %plesk dir%ModSecurityvhostsdomain's GUID>logs (the directory %plesk dir% is where Plesk is installed by default).
This is the same answer as @IgorG, which I have already replied to saying that we do not have any domains, so the vhosts directory is empty
 
Back
Top