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.

Authorizations:
query Parameters
config
required
string

The ModSecurity configuration file's name.

Example: config=modsec2.example.conf

Responses

Response Schema: application/json
object
object

Request samples

whmapi1 --output=jsonpretty \
  modsec_get_config_text \
  config='modsec2.example.conf'

Response samples

Content type
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
    }
}