Remove staged ModSecurity rule changes

This function discards staged rule changes for a ModSecurity™ configuration file. Staged rule changes reside in a .STAGE file (for example, the staged changes for the example.conf file exist in the example.conf.STAGE file). This function deletes the .STAGE file that corresponds to the configuration file that you specify.

Note:

To stage rule changes, call WHM API 1's modsec_add_rule function.

Important:

When you disable the Web Server role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
config
required
string

The ModSecurity configuration file in the /usr/local/cpanel/apache/conf/ directory.

Example: config=modsec2.example.conf
Responses
200

HTTP Request was successful.

Response Schema: application/json
data
object
object
get/modsec_discard_rule_changes
Request samples
whmapi1 --output=jsonpretty \
  modsec_discard_rule_changes \
  config='modsec2.example.conf'
Response samples
application/json
{
  • "data": { },
  • "metadata": {
    • "command": "modsec_discard_rule_changes",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}