This function checks a ModSecurity™ rule's validity.
Important:
When you disable the Web Server role, the system disables this function.
HTTP Request was successful.
object | |
object |
whmapi1 --output=jsonpretty \ modsec_check_rule \ rule='SecAction "pass,id:1234567"'
{- "data": {
- "problem": "The rule is invalid. Apache returned the following error: AH00526: Syntax error on line 1 of /var/tmp/15500._USR_LOCAL_CPANEL_WHOSTMGR_BIN_XML_API__.gl2t8wZ1.tmp/validate.conf:\nInvalid command ''OWASP'', perhaps misspelled or defined by a module not included in the server configuration\n'",
- "valid": 0
}, - "metadata": {
- "command": "modsec_check_rule",
- "reason": "OK Invalid Rule",
- "result": 1,
- "version": 1
}
}