WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function returns the metadata for a ModSecurity™ vendor rule set.
Important:
When you disable the Web Server role, the system disables this function.
The YAML metadata's URL, which describes the vendor and how to obtain its rules.
Note:
- The file uses YAML format.
- The filename must use the
meta_prefix. - The filename must match the
vendor_idvalue for your vendor. - The filename must end with the
.yamlextension.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_preview_vendor
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_preview_vendor
- 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_preview_vendor?url=https%3A%2F%2Fwww.example.com%2Fvendor1rules%2Fmeta_vendor1.yaml'{ "data": { "archive_url": "https://www.example.com/vendor1.zip", "cpanel_provided": 0, "description": "This is the Vendor1 ModSecurity Core Rule Set.", "dist_md5": "307cb5320441ebd712e5581d12100dc9", "dist_sha512": "b55c09bb1835ed4209f0f3ea4a70d099665363f23d3819c0369be429438d675ba2c749dcefdb85cee682ee0bf485558e67d0b0965fe4799865529d943e8e14cb", "installed": 1, "installed_from": "https://www.example.com/vendor1rules/meta_vendor1.yaml", "name": "Vendor1 ModSecurity Core Rule Set", "path": "/usr/local/apache/conf/modsec_vendor_configs/vendor1", "report_url": "https://waf.example.com/api/cpanel_feedback?source=1&rule_set=1.229", "supported_versions": [ … ], "vendor_id": "vendor1", "vendor_url": "http://www.example.com" }, "metadata": { "command": "modsec_preview_vendor", "reason": "OK", "result": 1, "version": 1 } }
Request
This function removes a ModSecurity™ vendor. When you call this function, the system removes the vendor's includes, disablement directives, configuration files, and metadata 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_vendor
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_remove_vendor
- 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_vendor?vendor_id=SomeVendor'{ "metadata": { "command": "modsec_remove_vendor", "reason": "OK", "result": 1, "version": 1 } }
Request
This function updates a vendor with the current version of the rule set.
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_update_vendor
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_update_vendor
- 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_update_vendor?url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml'{ "data": { "diagnostics": { … }, "vendor": { … } }, "metadata": { "command": "modsec_update_vendor", "reason": "OK", "result": 1, "version": 1 } }