# GET /security/modsec

First published 19 Nov 2026 (release 0.2.30) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the security group.

Get the server's ModSecurity status

- Who may call it: administrator
- Token scope, any of: security, read, all
- Answers: 200 OK

Returns who manages ModSecurity, the configured server mode, and whether the module is installed and loaded by Apache. The response includes the module's package and installed version, the versions of the bundled OWASP CRS and WordPress exclusions, whether OWASP CRS is included, and the request body limits.

The response identifies UrbeStack's configuration file, the administrator's configuration file, the package's configuration file, and the module loader. It reports whether the package settings are active and gives the file and line of any SecRuleEngine directive in the administrator's file that sets the mode for domains that follow the server mode. It also gives domain and rule counts and, if the server mode has been set, who last set it and when.

The state is not_managed when the administrator controls ModSecurity, missing when UrbeStack manages it and the module is absent, or not_loaded when the installed module is unloaded. The conflict state identifies a file whose overlapping rule numbers prevent UrbeStack from including OWASP CRS. The by_hand state means the administrator's configuration sets SecRuleEngine. The managed state means UrbeStack's configuration applies.

## As a command

- [urbestack-modsec-status](https://urbestack.com/docs/commands/urbestack-modsec-status.md): Reports whether UrbeStack manages ModSecurity, the configured server mode, and whether the module is installed and loaded by Apache.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X GET "$API/security/modsec" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "by_hand": {
    "directive": "text",
    "file": "urbestack-panel-20260909T101500Z.json.enc",
    "line": 1,
    "mode": "text"
  },
  "decided": true,
  "disabled_rules": {
    "by_administrators": 1,
    "by_owners": 1,
    "domains": 1,
    "gone": 1,
    "server": 1,
    "total": 1
  },
  "domains": {
    "customized": 1,
    "in_force": {
      "blocking": 1,
      "logging": 1,
      "off": 1
    },
    "lowered": 1,
    "own_mode": 1,
    "total": 1
  },
  "files": {
    "loader": "text",
    "ours": "text",
    "ours_written_at": "text",
    "packaged": "text",
    "yours": "text"
  },
  "installed": true,
  "limits": {
    "request": 1,
    "request_without_files": 1
  },
  "loaded": true,
  "managed": true,
  "mode": "off",
  "mode_set": {
    "at": "text",
    "by": "text"
  },
  "module": {
    "file": "urbestack-panel-20260909T101500Z.json.enc",
    "package": "basic",
    "version": "0.0.1"
  },
  "other_rule_set": {
    "file": "urbestack-panel-20260909T101500Z.json.enc"
  },
  "own_rules": {
    "enabled": 1,
    "file": "urbestack-panel-20260909T101500Z.json.enc",
    "total": 1
  },
  "packaged_active": true,
  "rule_set": {
    "included": true,
    "name": "alice",
    "version": "0.0.1"
  },
  "state": "managed",
  "wordpress_exclusions": {
    "version": "0.0.1"
  }
}
```

## Errors

- 401: Authentication required
