kb: how-to
Plesk Obsidian for Linux
Plesk Obsidian for Windows
ABT: Group B
Applicable to:
- Plesk Obsidian for Linux
- Plesk Obsidian for Windows
- Plesk for Linux
Question
How to manage Web Application Firewall (ModSecurity) via CLI?
Answer
Web Application Firewall (ModSecurity) management is available within the
server_pref
and
subscription
utilities.
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
Comments
2 comments
Hi Stefan Yakubov ,
May I ask, what would be the CLI for ModSecurity status, disable and enable, stop, start and restart?
Hi, Ehud Ziegelman
Modsecurity doesn't have a systemd unit, since it's managed as an included configuration of a webserver instead.
Hence the commands in the article are the only avaiable in the built-in Plesk CLI.
Please sign in to leave a comment.