Save ModSecurity rule copy

This function copies a ModSecurity™ rule with a new rule ID.

Important:

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

SecurityBasicAuth
Request
query Parameters
config
required
string

The rule's ModSecurity configuration file.

Example: config=modsec2.user.conf
id
required
integer >= 1

The existing rule's ID.

Example: id=123456789
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/modsec_clone_rule
Request samples
whmapi1 --output=jsonpretty \
  modsec_clone_rule \
  config='modsec2.user.conf' \
  id='123456789'
Response samples
application/json
{
  • "data": {
    • "rule": {
      • "config": "modsec2.user.conf",
      • "config_active": 1,
      • "disabled": 0,
      • "id": 123456789,
      • "meta_msg": "Rejected request",
      • "rule": "SecRule REQUEST_URI \"/rejected.php\" \"deny,auditlog,msg:'Rejected request',id:'1'\"",
      • "staged": 1,
      • "vendor_active": 0,
      • "vendor_id": "YourVendor"
      }
    },
  • "metadata": {
    • "command": "modsec_clone_rule",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}