WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function removes a rule from a ModSecurity™ configuration file.
Important:
When you disable the Web Server role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_remove_rule
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_remove_rule
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_remove_rule?config=modsec_vendor_configs%2Fexample.conf&id=1234567890'{ "data": {}, "metadata": { "command": "modsec_remove_rule", "reason": "OK", "result": 1, "version": 1 } }
Request
This function submits ModSecurity™ rule error reports to a remote receiver. The third party rule vendors use these error reports to identify problems with their rule sets.
Important:
When you disable the Web Server role, the system disables this function.
The contact email address to send with the error report. This allows the rule's vendor to reply to the user directly.
A short message that explains the reason for the report.
The MySQL® row IDs from the hits table in the modsec database for the audit log event to report.
Note:
If you specify more than one row ID:
- You must comma-separate the rule IDs.
- The rule IDs must all correspond to the same ModSecurity rule.
Whether the function sends the report to the rule's vendor.
1— Send the report.0— Do not send the report.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_report_rule
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_report_rule
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_report_rule?email=john.doe%40example.com&message=Hi.+We%27re+having+some+trouble+with+this+rule.+It+seems+to+be%0Ablocking+all+requests.&row_ids=0&send=1&type=false+positive'{ "data": { "report": [ … ] }, "metadata": { "command": "modsec_report_rule", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_undisable_rule
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_undisable_rule
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_undisable_rule?config=modsec_vendor_configs%2Fexample.conf&id=1234567890'{ "metadata": { "command": "modsec_undisable_rule", "reason": "OK", "result": 1, "version": 1 } }