Create a machine rule
Creates a rule (JSON body) in the given scope (machine = a machine public_id, '' = global). A rule only ever affects the events its event_pattern matches: 1 hides them from the list, 2 shows only them, 3 raises on them, 4 stops them being sent. mode defaults to 2 (Show) and must be 1-4 (mode 3/Raise requires the raise grant, admins always allowed; else 403); event_pattern (empty = all events) must be a valid regex; source defaults to any, and scoping a rule to a source is open to every user. polarity is vestigial: it is validated if supplied but the stored value always follows the mode (4 = blacklist, else whitelist). A Raise rule (mode 3) takes neither a sanitize_scope other than any nor a match_on: each is a 400. from_event makes the rule from one of your events; match_on or event_machine without it is a 400, and an event that is not yours is a 404. Returns 201 with the created rule. Cookie callers must pass CSRF.
This is a write: a read-only API key is refused with 403.
Request
- Base URL: https://eyalsec.com
- URL: https://eyalsec.com/api/machine_rules/create/
- Auth: one of:
- API key in header X-API-Key
- API key in cookie __Host-es2session
Request body
Response
Created.
Changes
No recorded changes to this operation across all 1 revision of this API.