Filters, rules and taint API
These endpoints manage what the dashboard shows and what your machines watch: event filters, machine rules, taint source settings, and the definition of what makes two detections the same event. Every change here is a write; every read is allowed to a read-only key.
Filters
A filter is a standing pattern applied to every events query on a product's Filters page: a blacklist filter hides matching events, a whitelist filter shows only them. These endpoints manage the filters listed on the Filters page.
List filters
GET /api/filters/ lists your event filters.
GET /api/filters/?engine=python
{ "filters": [ { "id": 7, "pattern": "^healthcheck$", "label": "noise",
"mode": "blacklist", "target": "where", "enabled": true,
"engine": "any" } ] }
engine is optional. With it you get only the filters shown on that product's Filters page: those for that product plus those set to any. It takes the event lists' view values (python or browser); an unknown value is a 400, and a product your account does not have is a 403.
Create a filter
POST /api/filters/create/ adds an event filter and answers 201 with it.
POST /api/filters/create/
JSON body:
| Field | Meaning |
|---|---|
pattern |
Required. A regex, at most 512 characters (or an impact class, see target). |
mode |
Required. blacklist (hide matches) or whitelist (show only matches). |
target |
What the pattern is matched against: where (the default, the sink label), origin (where the data came in), or tag, which takes an impact class such as xss as its pattern instead of a regex. |
engine |
any (the default, every product) or one product's view value. |
label |
Your description, at most 128 characters. |
enabled |
Defaults to true. |
An empty or too-long pattern, or an unknown mode, target, engine or impact class, is a 400. An engine your account does not have is a 403.
curl -s https://eyalsec.com/api/filters/create/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"pattern":"^healthcheck$","mode":"blacklist","label":"noise"}'
Update a filter
PATCH /api/filters/{id}/update/ changes a filter. Send only the fields you want to change; the answer is 200 with the filter (without engine).
PATCH /api/filters/{id}/update/
The pattern cannot be emptied, mode must stay blacklist or whitelist, and a tag target needs a known impact class as its pattern. A filter that is not yours is a 404.
curl -s -X PATCH https://eyalsec.com/api/filters/7/update/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"enabled":false}'
Delete a filter
DELETE /api/filters/{id}/delete/ removes a filter and answers 204. A filter that is not yours is a 404.
DELETE /api/filters/{id}/delete/
Machine rules
A rule matches events by pattern, source and sanitizer verdict, and then hides them, shows only them, raises on them, or stops them being sent. These endpoints manage the rules described in Rules. Rules live in a scope: your global rules, or one machine's.
In every call below, machine is a machine's public_id, or an empty string "" (or nothing) for the global scope.
List rules
GET /api/machine_rules/ lists the rules in one scope.
GET /api/machine_rules/?machine=3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41
{
"rules": [
{ "ID": 12, "Source": "any", "EventPattern": ".*eval.*",
"Mode": 3, "Action": "raise", "Polarity": "whitelist",
"Label": "block eval", "Enabled": true, "sanitize_scope": "any",
"match_on": [] }
]
}
Rule fields are capitalized, all but sanitize_scope and match_on, which lists the fields a rule made with from_event also matches (empty for every other rule). Mode decides what the rule does: 1 Hide, 2 Show, 3 Raise, 4 Don't send (see modes). Action is always raise and Polarity follows the mode (blacklist for mode 4, whitelist otherwise); both are kept for older scripts. The first read of your global scope creates the default rules. A machine that is not yours is a 404.
Create a rule
POST /api/machine_rules/create/ adds a rule to a scope and answers 201 with it, in the same shape as the list.
POST /api/machine_rules/create/
JSON body:
| Field | Meaning |
|---|---|
machine |
A public_id, or "" for global. |
event_pattern |
A regex matched against the sink label. Empty or omitted means all events. See pattern. |
mode |
1 Hide, 2 Show (the default), 3 Raise, 4 Don't send. |
source |
any (the default), a source name such as socket or weak-random, or a number for one of your own sources. See source and the note on spelling. |
sanitize_scope |
any (the default), unsanitized, sanitized, conditional, or sanitized:<class>, to match by what the sanitizer decided. See sanitize. |
label |
Your description. |
enabled |
Defaults to true. |
polarity |
Accepted for older scripts and checked (whitelist or blacklist), but the stored value always follows the mode. |
from_event |
An event id. Makes the rule from that event: an empty event_pattern becomes its sink, anchored. |
match_on |
With from_event: any of source (taint chain), trace, detail, origin. The rule then also requires those fields to equal the event's. Not allowed with mode 3. |
event_machine |
With from_event: true scopes the rule to the machine that sent the event, in place of machine. |
An invalid regex, mode, source or sanitize_scope is a 400, as is a match_on name outside the list or a Raise rule with match_on. An unknown from_event is a 404.
curl -s https://eyalsec.com/api/machine_rules/create/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"machine":"","event_pattern":"noise","mode":1,"label":"hide noise"}'
Every account can add Raise rules (mode 3). A machine one is in effect on is billed at a higher rate; see Machines with a Raise policy.
Raise and Don't send only take effect on es-python. es-chromium does not act on either, so for it only Hide and Show rules have an effect, on what the dashboard shows. See Who can use it.
Update a rule
PATCH /api/machine_rules/{id}/update/ changes a rule and answers 200 with it. Send any of event_pattern, mode, source, sanitize_scope, label, enabled and polarity; the rest stay as they are.
PATCH /api/machine_rules/{id}/update/
The same checks as create apply. A rule that is not yours is a 404.
curl -s -X PATCH https://eyalsec.com/api/machine_rules/12/update/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"enabled":false}'
Delete a rule
DELETE /api/machine_rules/{id}/delete/ removes a rule and answers 204. A rule that is not yours is a 404.
DELETE /api/machine_rules/{id}/delete/
Taint sources
Taint settings decide which kinds of incoming data a machine treats as untrusted and follows. Each setting is on, off or unset, and an unset setting inherits from the level above it (see unset and Taint sources).
Read taint settings
GET /api/machine_taint/ returns every taint setting for one scope. machine is a public_id, or empty for global.
GET /api/machine_taint/?machine=3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41
The answer always carries every key, for every product, including ones the machine's product does not use. It is shortened here:
{ "taint": { "socket": "on", "file": "unset", "stdin": "unset",
"foreign": "off", "env": "unset", "make_vuln": "unset",
"argv": "unset", "weak_random": "unset", "hardcoded": "unset",
"db_rows": "unset", "report_cmdline": "unset", "...": "unset" } }
Set a taint source
PUT /api/machine_taint/ sets one setting in one scope and answers 204.
PUT /api/machine_taint/
JSON body: machine (a public_id, or "" for global), source (a key the read returns) and state (on, off or unset). An unknown key or state is a 400.
curl -s -X PUT https://eyalsec.com/api/machine_taint/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"machine":"3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41","source":"socket","state":"on"}'
When a change reaches a running program depends on the product: es-python applies taint changes when the program next starts. See when it applies. es-chromium does not fetch this configuration at all, so nothing set here reaches it.
Which keys a product uses
The API accepts every key for every scope, but each product reads only its own, and ignores the rest rather than treating them as something else. Each product's Filters page shows the keys that product offers.
For es-python the keys are socket, file, stdin, foreign, env, make_vuln, argv, weak_random, hardcoded, identity, db_rows and handoff, plus three that decide what is sent with each event rather than what is tracked: report_cmdline (the command line), report_env (environment variables) and report_code (source code). See Taint sources for what each one watches.
Two keys are spelled differently in a rule. The value you send here is a setting key, with underscores; a rule's source field takes a source name. They differ in two places: the setting weak_random is the rule source weak-random, and the setting db_rows is the rule source db. A rule written with the setting spelling is refused. See spelling.
Web protection
es-python's web protection settings and your account's blocked clients. Settings work like taint sources: stored for your account or for one machine, with a machine's own value winning. A running program picks a change up within about 30 seconds, except the first time web protection is turned on for a program started with everything off, which needs one restart.
Read web protection settings
GET /api/web_protection/ returns the settings stored in one scope and the values that apply where nothing is stored. machine is a public_id, or empty for your account.
GET /api/web_protection/?machine=3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41
{ "settings": { "rate": "on", "rate.limit": "", "client_header": "X-Real-IP", "...": "" },
"inherited": { "rate": "off", "rate.limit": "100", "client_header": "X-Forwarded-For", "...": "" },
"can_block": true,
"secrets_set": { "challenge.secret_key": false },
"inherited_secrets_set": { "challenge.secret_key": true } }
An empty value in settings means nothing is stored in this scope. can_block is always true: every account can block. A machine with a blocking setting is billed at the Raise rate. For a machine, inherited_secrets_set says whether your account stores a value the machine uses when it stores none itself; the account view leaves it out.
Set a web protection setting
PUT /api/web_protection/ stores one setting in one scope and answers 204. JSON body: machine (a public_id, or "" for your account), key and value. An empty value clears the setting. An unknown key or a value out of range is a 400 with the reason. autoblock and autoblock.hours exist only for the account.
curl -s -X PUT https://eyalsec.com/api/web_protection/ \
-H "X-API-Key: $EYALSEC_KEY" -H 'Content-Type: application/json' \
-d '{"machine":"","key":"rate","value":"on"}'
| Key | Values |
|---|---|
client |
header or ip |
client_header |
a header name, such as X-Forwarded-For |
client_proxies |
1 to 16 |
client_trusted |
your proxies' addresses and ranges, comma separated, such as 192.0.2.0/24: up to 64, each at most a /8 (IPv4) or a /16 (IPv6) |
request_context |
on or off |
rate, block |
on or off |
rate.limit |
1 to 1000000 requests |
rate.window |
1 to 86400 seconds |
rate.action |
block or report |
check.smuggling, check.reflect, check.redirect, check.host, check.cards, check.headers |
on or off |
headers.add |
on or off: add the missing security headers to your app's responses |
hosts |
your host names, comma separated, such as shop.example,*.shop.example (up to 20) |
routes |
on or off: keep the route inventory |
autoblock |
off, attacks or severe (account only) |
autoblock.hours |
1 to 720 (account only) |
challenge.kind |
js, interactive or managed (managed) |
challenge.hours |
1 to 720: how long a passed challenge lasts (24) |
challenge.difficulty |
12 to 24: the work a js challenge asks of the browser (18) |
challenge.provider |
none, turnstile, recaptcha or hcaptcha |
challenge.site_key, challenge.secret_key |
the keys your challenge provider gave you |
challenge.title, challenge.message |
the challenge page's heading (up to 120 characters) and text (up to 500), on one line |
challenge.logo_url |
an https:// address of your logo, up to 512 characters, with no spaces, quotes, backticks or angle brackets |
challenge.color |
the page's accent color, as #rrggbb |
challenge.lang |
en or he |
challenge.page_html |
your own page, up to 32768 bytes, containing {{challenge}} exactly once and no <script> |
tarpit.max_concurrent |
1 to 256: requests held by tarpit at once, per process (8) |
The challenge.* and tarpit.* keys are used by bot and firewall rules. challenge.secret_key is write-only: GET always returns "" for it, and secrets_set says whether the scope stores one.
List blocked clients
GET /api/web_protection/blocklist/ lists your blocked clients, newest first. Expired entries are left out.
{ "entries": [ { "id": 4, "address": "203.0.113.0/24", "source": "manual",
"reason": "scanner", "created_at": "2026-10-14T09:12:03Z",
"expires_at": null } ],
"limit": 5000 }
source is auto for an entry auto-block added.
Block a client
POST /api/web_protection/blocklist/ adds an address or range and answers 201 with the entry. JSON body: address, and optionally reason and hours until it expires (0 or absent for never). A range wider than /8 (IPv4) or /32 (IPv6) is a 400, and a full list is a 409.
curl -s https://eyalsec.com/api/web_protection/blocklist/ \
-H "X-API-Key: $EYALSEC_KEY" -H 'Content-Type: application/json' \
-d '{"address":"203.0.113.7","reason":"scanner","hours":24}'
Unblock a client
DELETE /api/web_protection/blocklist/{id}/ removes one entry and answers 204. An entry that is not yours is a 404.
List routes
GET /api/web_protection/routes/ lists the routes your applications served while routes is on, with request counts by status class and how many events happened on each. Routes with events come first.
{ "routes": [ { "machine": "shop-1", "method": "GET", "route": "/search",
"hits": 5120, "s2xx": 5100, "s3xx": 0, "s4xx": 18, "s5xx": 2,
"events": 3, "last_seen": "2026-10-15T08:10:00Z" } ] }
Bot and firewall rules
Rules that decide what es-python does with a request before your application sees it: block it, ask the visitor to pass a challenge, slow it down, answer it yourself, redirect it, report it, or add a header your code can read. A rule is a name, a state, an expression saying which requests it matches, an action, and optionally a rate trigger so it acts only past a number of requests per client. Like web protection settings, rules are stored for your account or for one es-python machine; a machine runs your account's rules first, then its own, each list in order. A machine that is not yours, or not an es-python machine, is a 404. Rules are part of es-python: an account without it gets a 403 on every route below, the expression check and the field list included.
state is on (the rule acts), log (it reports what it would have done and lets the request through) or off. Every account can set a rule whose action stops a request (block, challenge, tarpit, respond, redirect) to on.
List bot rules
GET /api/guard/rules/ returns one scope's rules in the order they run. machine is a public_id, or empty for your account. For a machine, inherited lists your account's rules too.
GET /api/guard/rules/?machine=3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41
{ "rules": [ { "id": 12, "machine": "3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41", "position": 0,
"name": "Admin scanners", "state": "on",
"expression": "http.path starts_with \"/wp-admin\"", "action": "block",
"action_params": { "status": 403, "body": "", "content_type": "text/plain; charset=utf-8" },
"rate_limit": 10, "rate_window": 60,
"created_at": "2026-10-26T09:00:00Z", "updated_at": "2026-10-26T09:00:00Z" } ],
"inherited": [],
"limit": 50,
"can_block": true }
limit is the most rules the scope can hold: 200 for your account, 50 for a machine. can_block is always true.
Add a rule
POST /api/guard/rules/ adds a rule at the end of its scope and answers 201 with the stored rule, its expression in canonical form and every action parameter filled in.
curl -s -X POST https://eyalsec.com/api/guard/rules/ \
-H "X-API-Key: $EYALSEC_KEY" -H 'Content-Type: application/json' \
-d '{"machine":"","name":"Admin scanners","state":"log",
"expression":"http.path starts_with \"/wp-admin\"","action":"block",
"action_params":{},"rate_limit":null,"rate_window":null}'
| Field | Values |
|---|---|
machine |
a public_id, or "" for your account |
name |
1 to 100 characters, on one line |
state |
on, log or off |
expression |
which requests match, such as http.method eq "POST" and http.path eq "/login" |
action |
block, challenge, tarpit, respond, redirect, log, skip or set_header |
action_params |
the action's parameters; any you leave out take their defaults |
rate_limit, rate_window |
both or neither: 1 to 1000000 requests in 1 to 86400 seconds |
| Action | Parameters |
|---|---|
block |
status 400 to 499 (403), body up to 8 KB, content_type |
challenge |
kind: js, interactive, managed, or "" for your challenge.kind setting |
tarpit |
delay 1 to 30 seconds (10) |
respond |
status 200 to 599 (200), content_type, body up to 64 KB |
redirect |
url (required): an http:// or https:// address or a path on your site; status 301, 302, 303, 307 or 308 (302) |
log |
none |
skip |
what: rules, managed or guard (rules) |
set_header |
name (required), and either value or field (a field whose value becomes the header) |
Refusals: a 400 with field naming what is wrong. For the expression it also carries kind (syntax, type, regex, limit, unknown_field or unavailable) and, when the error points at one place, offset, a byte offset into the expression. For http.path eq "/" and http.method eq 5:
{ "error": "This compares text, so the value must be text too, for example \"text\".",
"field": "expression", "kind": "type", "offset": 36 }
A field the API does not know, such as a misspelled nmae, is a 400 too, without field: nothing is saved.
A scope that already holds its limit of rules is a 409, and so is a rule whose response body would bring your rules' bodies past 1 MB in total.
Change a rule
PUT /api/guard/rules/{id}/ changes one rule and answers 200 with it. Send only the fields you change; rate_limit and rate_window set to null remove the rate trigger. machine is ignored: a rule keeps its scope. A new action without action_params takes that action's defaults. The 400 and 409 refusals of a create apply. A rule that is not yours is a 404.
curl -s -X PUT https://eyalsec.com/api/guard/rules/12/ \
-H "X-API-Key: $EYALSEC_KEY" -H 'Content-Type: application/json' \
-d '{"state":"on"}'
Delete a bot rule
DELETE /api/guard/rules/{id}/ deletes one rule and answers 204. A rule that is not yours is a 404.
curl -s -X DELETE https://eyalsec.com/api/guard/rules/12/ \
-H "X-API-Key: $EYALSEC_KEY"
Reorder rules
POST /api/guard/rules/reorder/ sets the order of one scope's rules and answers 204. ids must list every rule of the scope exactly once, first to run first ([] for a scope with none); any other list is a 400 and changes nothing.
curl -s -X POST https://eyalsec.com/api/guard/rules/reorder/ \
-H "X-API-Key: $EYALSEC_KEY" -H 'Content-Type: application/json' \
-d '{"machine":"","ids":[14,12,13]}'
Check an expression
POST /api/guard/expression/check/ checks an expression without saving anything and always answers 200. Send expression (the text) or tree (the builder form a previous check returned). It changes nothing, so a read-only API key may call it.
curl -s -X POST https://eyalsec.com/api/guard/expression/check/ \
-H "X-API-Key: $EYALSEC_KEY" -H 'Content-Type: application/json' \
-d '{"expression":"HTTP.PATH starts_with \"/admin\""}'
{ "ok": true, "canonical": "http.path starts_with \"/admin\"",
"tree": { "op": "and", "items": [ { "field": "http.path", "op": "starts_with", "values": ["/admin"] } ] } }
tree is null when the expression is more than the builder can show. A refused expression gives ok: false with error, kind and, when it points at one place, offset.
List fields and actions
GET /api/guard/fields/ returns what a rule can be built from: the fields you can use today (with indexed true for a field read by name, such as http.header["x-api-key"]), the actions with their parameters, the operators each field type takes, and the functions (lower, upper, len, url_decode).
curl -s https://eyalsec.com/api/guard/fields/ \
-H "X-API-Key: $EYALSEC_KEY"
{ "fields": [ { "name": "http.path", "type": "str", "help": "The path, without the query.", "indexed": false } ],
"actions": [ { "name": "tarpit", "terminating": true, "needs_raise": true,
"help": "Hold the request for some seconds, then refuse it.",
"params": [ { "name": "delay", "kind": "int", "lo": 1, "hi": 30,
"choices": [], "default": 10, "required": false } ] } ],
"operators": { "str": ["eq", "ne", "contains", "starts_with", "ends_with", "matches", "in", "not in"] },
"functions": ["lower", "upper", "len", "url_decode"] }
Unique events
The unique-event definition decides which differences make two detections separate events. Detections that match on every field of the definition land on one event row whose count goes up. See Unique event.
The definition always includes a fixed baseline you cannot switch off: your account, the product, and the sink. On top of it you choose any of these fields:
| Field | Splits events by |
|---|---|
source |
The taint chain: the same sink reached by a different path. |
detail |
The detail line, such as the page URL or origin token. |
trace |
The stack trace: one sink reached from different call paths. |
machine |
The reporting machine, instead of merging your machines into one row. |
origin |
The taint source's origin block. |
The built-in default is source and detail.
Read the definition
GET /api/event_uniqueness/ returns the definition in force for one product and scope. agent_kind is required; machine is a public_id, or empty for your account default. event, an event id, picks that event's machine instead.
GET /api/event_uniqueness/?agent_kind=python
{ "agent_kind": "python", "machine": "", "axes": ["source", "detail"],
"inherited": true,
"available": ["source", "detail", "trace", "machine", "origin"],
"baseline": ["account", "agent", "sink"] }
axes is what applies after resolving: the machine's own setting, else your account default for that product, else the built-in default. inherited is true when this exact scope has no setting of its own.
Set the definition
PUT /api/event_uniqueness/ sets the definition for one product and scope and answers 204.
PUT /api/event_uniqueness/
JSON body: agent_kind (required, such as python), machine (a public_id, or "" for your account default) and axes (any of source, detail, trace, machine, origin). An empty list [] keeps only the baseline. Leave axes out entirely to remove this scope's own setting so it inherits again; that is how you reset a machine to your account default.
curl -s -X PUT https://eyalsec.com/api/event_uniqueness/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"agent_kind":"python","axes":["source","detail","trace"]}'
The change applies to detections from now on; it does not regroup what is already stored. A field that was not part of the definition was not kept for each detection: when detections merged, only the latest one's trace and origin were kept. So turning a field on later cannot split events that already merged.
Outbound connections
These two endpoints read and write the es-python outbound connections policy: which addresses and URLs your programs may connect to. There is one policy for your account and, optionally, one per es-python machine. A machine checks its own rules first, then your account's.
Read the policy
GET /api/egress/ returns the policy for your account, or for one machine when you pass machine (a public_id).
GET /api/egress/?machine=7c1e4f0a-0000-4000-8000-000000000000
{ "machine": "7c1e4f0a-0000-4000-8000-000000000000",
"scope": { "mode": "all", "default": null, "on_violation": null,
"rules": [ { "action": "allow", "target": "*.stripe.com:443", "note": "payments" } ] },
"account": { "mode": null, "default": "deny", "on_violation": null,
"rules": [ { "action": "deny", "target": "@metadata", "note": "" } ] },
"effective": { "mode": "all", "default": "deny", "on_violation": "block",
"rules": [ { "action": "allow", "target": "*.stripe.com:443", "note": "payments" },
{ "action": "deny", "target": "@metadata", "note": "" } ] },
"defaults": { "mode": "untrusted", "default": "allow", "on_violation": "block" },
"max_rules": 128, "keywords": ["@internal", "@metadata"] }
scope is what this scope stores; null means it inherits. effective is what the machine runs under, with the rules in the order they are checked.
Set the policy
PUT /api/egress/ replaces one scope's settings and its whole rule list, and answers 200 with the same body as GET.
PUT /api/egress/
JSON body: machine (a public_id, or "" for your account), mode (untrusted or all), default (allow or deny), on_violation (block or report) and rules, an ordered list of {action, target, note}. Send null for a setting to inherit it. The target grammar is the same as on the dashboard. A bad row answers 400 with its row number; the stored policy is left as it was.
curl -s -X PUT https://eyalsec.com/api/egress/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"rules":[{"action":"deny","target":"@internal"},{"action":"deny","target":"@metadata"}]}'
Machines pick the change up on their next config check, within about 30 seconds.