Return ModSecurity configuration file

This function retrieves a ModSecurity™ configuration file's contents.

Important:

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

SecurityBasicAuth
Request
query Parameters
config
required
string

The ModSecurity configuration file's name.

Example: config=modsec2.example.conf
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/modsec_get_config_text
Request samples
whmapi1 --output=jsonpretty \
  modsec_get_config_text \
  config='modsec2.example.conf'
Response samples
application/json
{
  • "data": {
    • "text": "SecRule REQUEST_URI \"example\" \"deny:id:123456789\" SecAction \"pass:auditlog:id:444444444\""
    },
  • "metadata": {
    • "command": "modsec_get_config_text",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}