latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

ModSecurity
Server Settings

Return ModSecurity configuration

This function retrieves the server's ModSecurity™ configuration settings. The system stores these settings in the /usr/local/apache/conf/modsec2.conf file.

Important:

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

get/modsec_get_settings

Response

HTTP Request was successful.

Example response

{
  "data": {
    "settings": [
      {
        "default": "Off",
        "description": "This setting controls the behavior of the audit engine.",
        "directive": "SecAuditEngine",
        "engine": 1,
        "missing": 1,
        "name": "Audit Log Level",
        "radio_options": [
          {
            "name": "Log all transactions.",
            "option": "On"
          },
          {
            "name": "Do not log any transactions.",
            "option": "Off"
          },
          {
            "name": "Only log noteworthy transactions.",
            "option": "RelevantOnly"
          }
        ],
        "setting_id": 0,
        "state": "",
        "type": "radio",
        "url": "https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#secauditengine"
      },
      {
        "description": "Specify an external program to pipe transaction log information to for additional analysis. The syntax is analogous to the .forward file, in which a pipe at the beginning of the field indicates piping to an external program.",
        "directive": "SecGuardianLog",
        "missing": 1,
        "name": "Guardian Log",
        "setting_id": 6,
        "state": "",
        "type": "text",
        "url": "https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#secguardianlog",
        "validation": [
          {
            "arg": "[|]",
            "name": "startsWith"
          },
          "path"
        ]
      }
    ]
  },
  "metadata": {
    "command": "modsec_get_settings",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}