API guide
Eyeglass provides a REST API, called the Zero Trust API, that runs on the Eyeglass appliance. External tools use it to read active security events and, with a license, to start critical-path snapshots and lock out or unlock users. Security information and event management (SIEM) tools, security orchestration (SOAR) tools, and scripts use it.
Licensing
Read-only event endpoints don't need a license. The critical-path snapshot and the lockout and unlock endpoints need a Zero Trust API license.
Create an API token
- In Eyeglass, go to Integrations > API Tokens.
- Click Create New Token.
- Name the token after the tool that uses it, for example
SIEM Integration. The name appears in the Eyeglass logs. - Copy the token. If you revoke it, the tool loses access immediately.
Send the token in an HTTP header named api_key on every request:
curl --header "api_key: <your-token>" \
--header "accept: application/json" \
https://<eyeglass-ip>/sera/v1/securityevents
To browse the routes and generate commands, open the API Explorer at https://<eyeglass-ip>/sera/docs/.
Endpoints
Events (read only)
| Method | Path | Parameters | Purpose |
|---|---|---|---|
| GET | /v1/ransomware/rswevents | None | Lists active Ransomware Defender events. |
| GET | /v1/securityevents | type: all, rsw, or ea | Lists active security events. rsw returns Ransomware Defender events and ea returns Active Auditor events. |
Critical-path snapshots (license required)
| Method | Path | Parameters | Purpose |
|---|---|---|---|
| GET | /v2/ransomware/criticalpaths | state: all, running, or finished | Lists recent snapshot jobs. |
| POST | /v2/ransomware/criticalpaths | None | Takes a snapshot of all configured critical paths. Returns a job id. |
| GET | /v2/ransomware/criticalpaths/{id} | id: the job ID | Returns the status of one job. |
Lockout and unlock (license required)
| Method | Path | Parameters | Purpose |
|---|---|---|---|
| POST | /v2/ransomware/lockout/{user} | user: the SID or user name | Creates a ransomware event and locks out the user. Returns a job id. |
| POST | /v2/ransomware/unlock/{user} | user: the user name | Unlocks a user who was locked out. Returns a job id. |
Note: An API-started lockout affects only the platform where the event originated.
Every error returns a payload with a code and a message.
Critical-path snapshot hold-off timer
By default, a request to POST /v2/ransomware/criticalpaths takes one snapshot per critical path per hour. Extra requests during that hour are ignored. This timer is separate from snapshot expiry and quota.
To change the window:
-
Log in to the Eyeglass appliance as
admin, and runsudo -s. -
Open
/opt/superna/sca/data/system.xml. -
In the
<rsware>tag, add or change this setting. Replace2with the number of hours:<api_request_dead_time_hours>2</api_request_dead_time_hours> -
Save the file.
Use cases
- Event polling. A SIEM or SOAR tool polls
/v1/securityeventson a schedule to feed dashboards or alerts. - Automated response. A playbook locks out a user, or takes critical-path snapshots, when another tool detects a threat.