Agent endpoints

These are the endpoints the EyalSec agents on your machines call by themselves: to report events, to fetch their configuration, and to install. You never need to call them, and they do not accept your API key; they are listed so you know what traffic to expect from a monitored machine.

How agents authenticate

An agent signs its requests with its machine's own credential, which the installer puts on the machine, not with your API key or your session. It is sent in a Secret header; the es-chromium browser sends it as a secret form field instead.

A request with a missing or unknown credential is refused with 403. A machine that is deleted, or whose product is taken off your account, stops being accepted within a few minutes. For firewalls: every call below goes to your EyalSec address (for the hosted service, https://eyalsec.com) over HTTPS.

Report an event

POST /api/create_event/ is how an agent reports an event. POST /events is the same endpoint under a shorter name.

POST /api/create_event/
POST /events

The agent sends the event's fields (the sink label, the value, the stack trace, where the data came in, and so on) as a form with each text field base64-encoded. The server answers 202 Accepted at once and stores the event in the background, which is why identical events are merged and counted rather than shown once per occurrence (see count).

A machine that sends faster than its allowance gets 429, and 503 means the service as a whole is shedding load for a moment; agents retry later. Events for a product your account does not have are refused.

Fetch machine configuration

GET /api/machine_config is how an agent picks up the settings you make in the dashboard: its taint sources, rules and what to send with each event. The answer is encrypted for that machine.

GET /api/machine_config

The answer carries an X-Config-Version header. The agent sends the last version it saw in the same header, and gets 304 Not Modified with no body when nothing has changed. es-python fetches it when a program starts and then about every 30 seconds; see when changes apply. es-chromium does not fetch it at all. A machine that is unprotected, including every machine of a paused account and one that nothing pays for yet, gets a configuration with every source off and no rules, and its events are refused until it is protected again.

Fetch the rules bundle

GET /api/machine_guard_bundle is how es-python picks up your bot and firewall rules and challenge settings. The machine configuration names the current bundle with a waf.bundle line, and es-python fetches the bundle only when that line changes. The answer is encrypted for that machine, like the machine configuration, and is sent as raw bytes.

GET /api/machine_guard_bundle

The answer carries an ETag header. es-python sends the one it holds in If-None-Match, and gets 304 Not Modified with no body when nothing has changed. A machine with no rules in state on or log and every bundle setting at its default (the challenge settings are bundle settings) gets 404, and so does a machine that is not es-python. A 503 with a Retry-After header means the bundle could not be prepared in time, and es-python tries again later. Until a bundle arrives, es-python runs without rules.

Fetch templates for one run

GET /api/machine_templates?name=<template> is how es-python --template picks up a rule template for a single run, without applying it in the dashboard. Repeat name for several templates, up to 16. The answer is encrypted for that machine, like the machine configuration.

GET /api/machine_templates?name=privesc&name=network-rce

Each template comes back as found or not found, in the order you asked. A name no template can have (empty, longer than 128 bytes, not valid UTF-8, or holding a control character) comes back as not found, and the other names are still answered. The whole request is a 400 when no name is given, when more than 16 are, when a name contains a line break or a NUL byte, or when the query string cannot be read. es-python will not start a run when any template it was given is not found, so a run never has less protection than you asked for. See running es-python.

Look up the machine's name

GET /api/machine_name returns, as plain text with one labelled line each, the owner's username, the machine's display name, its environment (its zone on the Machines map), the agent, the OS and the install status. An agent uses it to show which account and machine it reports to.

GET /api/machine_name

Update es-python

POST /api/es-python/update is what es-python --update calls. Send the machine's credential in the Secret header, plus the form fields arch and, optionally, glibc, so the build can be one the host can load.

POST /api/es-python/update

A 204 with an X-EyalSec-Build header means the machine already runs the newest build. A 200 carries the installer script as plain text. The registration, settings and events stay. Errors are one line of plain text: 400 (credential not sent as a header), 403 (es-python is not enabled on the account, the credential is unknown, or billing stops the machine for now; the body then says what to do on the Billing page), 409 (not an installed es-python machine), 429 (an update for this machine was prepared less than a minute ago; retry after the Retry-After seconds), 503 (busy, retry after the Retry-After seconds), 500 (no build published, or an internal error).

Self-test confirmation

GET /api/selftest/{nonce} is what eyalsec selftest polls to find out whether its test event reached your dashboard. It needs no key, because the helper on the machine has no dashboard credential, and it is limited per IP address.

GET /api/selftest/5fdc376114ee72259c9249b36f64ceee
{ "received": true, "dashboard_url": "https://eyalsec.com/scanner/events?view=python" }

nonce is the 32 lowercase hexadecimal characters the helper picked for that run; anything else is a 400. received is true once an event from that run has been stored in the last 30 minutes. The answer says nothing about which account or machine sent it.

Install and uninstall

The install command you copy from the Machines page downloads its installer from these endpoints. They need no API key: the one-time secret in the command is what authorizes them. See Install.

POST /install.sh
POST /install/payload
POST /uninstall.sh

/install.sh checks the one-time secret and returns an installer for that machine; the installer then fetches /install/payload. The payload supports HTTP range requests, so an interrupted download can resume (for example with curl -C -). /uninstall.sh returns the removal script for the uninstall command. es-chromium has its own installer address, and the command the Machines page gives you already names it (see Install es-chromium).

The public lists GET /api/supported_os_types/ and GET /api/supported_python_versions/ are also used during setup to offer the available targets.

The installer also reports whether it succeeded. A failed install moves the machine to failed on the Machines page; see install troubleshooting.

Install mode change

POST /api/install_mode is used by the eyalsec install-as command on the host to tell the dashboard the install's new mode, so the Machines page shows where es-python now is. See Change the install mode.

POST /api/install_mode

Form fields: manage_token, which the installer leaves on the machine and which can do nothing but this call, and install_mode (local, local-python, global or global-python). The answer is 204 when the change is recorded, 400 for any other mode, 403 for a missing or unknown token, 429 when the host sends too often, and 500 when something failed on our side (the host can send it again).

Something unclear or missing on this page? Email support@eyalsec.com.

EyalSec Pricing Docs Security Research Vulnerabilities Play Security glossary About Contact עברית Login Get started Protect my Python app