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.

Authorizations:

Responses

Response Schema: application/json
object
object

Request samples

whmapi1 --output=jsonpretty \
  modsec_get_settings

Response samples

Content type
application/json
{
  • "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",
        },
      • {
        • "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",
        • "validation": [
          • {
            • "arg": "[|]",
            • "name": "startsWith"
            },
          • "path"
          ]
        }
      ]
    },
  • "metadata": {
    • "command": "modsec_get_settings",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}