Question
How to manage Web Application Firewall (ModSecurity) via CLI?
Answer
Web Application Firewall (ModSecurity) management is available within the
and
server_pref
utilities.
subscription
For example:
- In order to check ModSecurity status:
# plesk bin server_pref --show-web-app-firewall
- To turn ModSecurity on:
# plesk bin server_pref --update-web-app-firewall -waf-rule-engine on
- To turn ModSecurity on and select the OWASP ModSecurity Core Rule Set (CRS) rule set:
# plesk bin server_pref --update-web-app-firewall -waf-rule-engine on -waf-rule-set crs
- To turn on the web application firewall settings for the website example.com:
# plesk bin subscription --update-web-app-firewall example.com -waf-rule-engine on
- To update ModSecurity ruleset
# plesk daily UpdateModSecurityRuleSet
Refer to the following documentation articles for additional details:
Using command line utilities - server_pref
Using command line utilities - subscription