Document:Cylance APIGuide. This guide is a succinct
resource for analysts, administrators, and customers
who are reviewing or evaluating the product.
Document Release Date:v2.0 rev34, December 2020
About BlackBerry Cylance®: BlackBerry Cylance
develops artificial intelligence to deliver prevention-first,
predictive security products and smart, simple, secure
solutions that change how organizations approach
endpoint security. BlackBerry Cylance provides fullspectrum predictive threat prevention and visibility
across the enterprise to combat the most notorious and
advanced cybersecurity attacks, fortifying endpoints to
promote security hygiene in the security operations
center, throughout global networks, and even on
employees’ home networks. With AI-based malware
prevention, threat hunting, automated detection and
response, and expert security services, BlackBerry
Cylance protects the endpoint without increasing staff
workload or costs.
Cylance User APIGuide, v2.0 rev34, December 2020 | 4
Get Devices43
Get Devices Extended46
Get Device Count49
Get Device51
Get Device by MAC Address53
Get Device by Hostname56
Update Device59
Get Device Threat60
Update Device Threat62
Get Zone Devices64
Get Agent Installer Link65
Delete Devices68
Global List API
Get Global List72
Add to Global List74
Delete From Global List76
Policy API
Get Policies79
Get Policy81
Create Policy98
Update Policy121
Delete Policy140
Delete Policies141
Zone API
Create Zone143
Get Zones144
Get Zone146
Get Device Zones148
Update Zone149
71
78
142
Delete Zone151
Threat API
Get Threats153
Get Threat156
Get Threat Devices158
Cylance User APIGuide, v2.0 rev34, December 2020 | 5
152
Get Threat Download URL161
Memory Protection API
Get Memory Protection Events164
Get Memory Protection Event166
Memory Violation Types168
Detection API
Get Detections172
Get Detection175
Get Recent Detections182
Get Detections CSV183
Get Detections By Severity186
Update Detection188
Delete Detection190
Delete Detections191
Package Deployment API
Create Package193
Get Packages195
Get Package199
163
171
192
Delete Package201
Create Package Execution202
Get Package Executions206
Get Package Execution210
Delete Package Execution212
Detection Rule API
Get Detection Rule List216
Get Detection Rule CSV List219
Get Detection Rule220
Validate Detection Rule224
Create Detection Rule227
Update Detection Rule232
Deactivate or Delete Detection Rule237
Get Detection Rule Natural Language Representation238
Get Detection Rule Counts239
Detection Rule Sets
215
241
Cylance User APIGuide, v2.0 rev34, December 2020 | 6
Get Detection Rule Set List242
Get Detection Rule Set CSV List245
Get Detection Rule Set246
Create Detection Rule Set250
Retrieve Default Detection Rule Set255
Update Detection Rule Set258
Delete Detection Rule Set262
Delete Multiple Detection Rule Sets263
Detection Exceptions
Get Detection Exceptions List266
Get Detection Exception CSV List268
Get Detection Exception Content269
Create Detection Exception271
Update Detection Exception275
Deactivate / Delete Detection Exception278
Device Commands
Device Commands281
Lockdown Device Command281
Get Device Lockdown History283
Get Retrieved File Results284
Request File Retrieval From Device287
Check File Retrieval Status From Device289
Focus View
Focus View293
Get Focus View List293
265
280
292
Search for Focus View Results296
Request a Focus View298
Get a Focus View Summary301
Get Focus View Results304
InstaQuery
InstaQuery307
Get InstaQueries307
Create InstaQuery310
Get InstaQuery314
Cylance User APIGuide, v2.0 rev34, December 2020 | 7
306
Get InstaQuery Results318
Archive InstaQuery321
CylanceOPTICS Policy
CylanceOPTICS Policy324
Get Detection Rule Sets to Policy Mapping324
Get Detection Rule Set for a Policy326
Update a Detection Rule Set in a Policy327
API Tools
REST Clients331
JSON Validators331
Appendix
Find File Checksum333
Windows333
macOS333
Linux333
Threat Classifications333
File Unavailable334
Trusted - Local334
PUP334
323
330
332
Dual Use335
Malware336
Scope Values for Authentication Token337
Legal Notice
Legal Notice341
340
Cylance User APIGuide, v2.0 rev34, December 2020 | 8
Application Management
- 9 -
Application Management
Cylance Console administrators can manage multiple API applications, including the access
privileges to your Cylance Console data, CylancePROTECT and CylanceOPTICS.
To Add an Application
IMPORTANT: A tenant can have up to 10 Custom Applications.
1.
Log in to the Cylance Console as an administrator. Only administrators can create an
application integration.
2. Select Settings >Integrations.
3. Click Add Application.
4.
Type an Application Name. This must be unique within your organization.
5.
Select the access privileges for a Console data type. Not selecting any checkboxes for a
data type means the application does not have access to that data type.
Cylance User APIGuide, v2.0 rev34, December 2020 | 10
Figure 1: Configure Custom Application Settings
6. Click Save. The credentials to use for the application displays.
7.
Copy and paste the Application ID and Application Secret to your API application. Or you
can click OK to close the dialog box. You can view the Application ID and Application
Secret from the Integrations page.
Note: There are some API operations listed in the Add Application matrix that can be enabled
(Global List - Read and Modify; Policy - Write, Modify, and Delete) but are not available with
the initial release. These API operations are currently under development and will be available
in a future release.
Cylance User APIGuide, v2.0 rev34, December 2020 | 11
Figure 2: View or Hide Cust om Application Settings
Data TypeDescription
CylanceOPTICS
Commands
CylanceOPTICS
Detections
CylanceOPTICS
Exceptions
CylanceOPTICSFocus
Views
CylanceOPTICS
InstaQueries
CylanceOPTICS
Policies
CylanceOPTICS
RuleSets
The CylanceOPTICS Device Commands. Includes Device Lockdown (locking
a device, retrieving history) and File Retrieval (requesting, checking, and
getting results).
The CylanceOPTICS Detection Events triggered by the Context Analysis
Engine (CAE). Enables further automation of analyzing, triaging, and
responding to malicious or suspicious activity prevented or detected by
CylanceOPTICS.
The CylanceOPTICS DetectionExceptions that adds exceptions to Detection
Rules.
The CylanceOPTICS Focus Views retrieves an information trail starting with
the first event related to an artifact from an InstaQuery result or
CylancePROTECT event.
The CylanceOPTICS InstaQuery allows searching for system artifacts stored
locally by CylanceOPTICS - files, registry key persistence points, processes,
etc.
The CylanceOPTICS settings in a Policy. This requires the Policy settings to
also be enabled.
The CylanceOPTICS set of rules that is then applied to a Policy.
CylanceOPTICS Rules The CylanceOPTICSDetection Rules that help monitor an organization for
security threats or anomalous behavior.
DevicesDevices are systems with a Cylance Agent installed. You can get information
about devices in your organization. You can also update (Modify) or remove
(Delete) devices from your organization.
GlobalListGlobal Lists include the Safe List and the Global Quarantine List. Each Global
List operation has its own set of required and optional request fields.
Cylance User APIGuide, v2.0 rev34, December 2020 | 12
Data TypeDescription
Packages
Configuration
Packages Deployment The CylanceOPTICS packages to execute on devices.
PoliciesPolicies contain the protection settings applied to devices. Policies allow
ThreatsThreat Details provide information about a file as well as reference
UsersUsers have access to the data in the Console, based on the role assigned to
ZonesEach device belongs to at least one Zone.Zones are similar to tags and
The CylanceOPTICS packages to be sent and stored on devices.
Note: CylanceOPTICS packages are not sent to devices by default.
Devices must receive a command to download a package.
adding and removing devices instead of needing to manually update each
device when you want to change the protection settings.
information about why a file is considered Safe or a Threat. Use the Threats
request to get this information.
the User. For example, an Administrator can see everything in the Console,
while a User is limited to the zones to which the User is assigned.
assist in organizing your devices.
PrivilegeDescription
DeleteAbility to delete the data.
ModifyAbility to modify existing data. Also known as update.
ReadAbility to read data but cannot create, modify, or delete the data. Also known as list.
WriteAbility to add data to the Console. Also known as create.
To Edit an Application
1.
Log in to the Cylance Console as an administrator. Only administrators can edit an
application integration.
2. Select Settings >Integrations.
3.
Click the Edit icon for the application you want to change.
Cylance User APIGuide, v2.0 rev34, December 2020 | 13
Figure 3: Edit Custom Applicat ion
4. Edit the privileges, then click Save Changes.
Figure 4: Save Cust om Application
To Delete an Application
1.
Log in to the Cylance Console as an administrator. Only administrators can delete an
application integration.
2. Select Settings >Integrations.
3.
Click the Remove icon for the application you want to remove.
Figure 5: Remove Custom Application
4. Click Remove Application to confirm the deletion.
Cylance User APIGuide, v2.0 rev34, December 2020 | 14
The Tenant ID is required for authorization. You can copy your Tenant ID from the Integrations
page.
Figure 8: Copy Tenant ID
API in Audit Logs
The API calls listed below are included in the Console Audit Log (My Account >Audit Log) when
something is created or updated. In the Audit Log, the "Who" field displays the Application
Name, not the username.
n
Policy:Create, Update, or Delete
n
Global List:Add or Delete
n
Zone:Create, Update, or Delete
Cylance User APIGuide, v2.0 rev34, December 2020 | 16
n
Tenant User:Create, Update, or Delete
n
Device:Update Device, Update Device Threat, or Delete Device
Cylance User APIGuide, v2.0 rev34, December 2020 | 17
RESTful API
- 18 -
Cylance provides RESTful APIs for registered organizations to manage their resources. To
access the CylanceAPI resources, the client will need to follow the authentication and
authorization flow as defined below. This requires the client to send a request to the Auth
endpoint, which will return an access token that the client will use for calling all other endpoints.
Note: Cylance supports CylanceAPIresources, including helping users troubleshoot Cylance
APIrequests. Cylance does not write or train users on how to create scripts or code (like using
Python).
Authentication and Authorization
Application
An Application acts as an integration point between the client system and the Cylance API.
Through the Application, the client system is granted temporary access to act upon resources.
Actions will be limited by the scopes associated to the Application itself, as defined in the
"Application Management" on page10 section.
Service Endpoint
The service endpoint address can contain a region code to identify the set of servers to which
your organization belongs.
Example for Europe - Central:http://protectapi-euc1.cylance.com/devices/v2
Note: North America and USGovernment have a different format. See Service Endpoint column
below for examples.
RegionCodeService Endpoint with Region Code
Asia-Pacific - Northapne1
Asia-Pacific - Southeastau
Europe - Centraleuc1
North America
South Americasae1
USGovernmentus
https://protectapi-apne1.cylance.com/
https://protectapi-au.cylance.com/
https://protectapi-euc1.cylance.com/
https://protectapi.cylance.com/
https://protectapi-sae1.cylance.com/
https://protectapi.us.cylance.com/
Cylance User APIGuide, v2.0 rev34, December 2020 | 19
Authentication
During the step which a client system requests access prior to using Cylance Resources, there
is an independent Web API that will handle the Authentication process and grant access to the
client system. A token based authentication approach is being taken as a means of data
transportation between the parties. Cylance has adopted JWT(RFC 7519) as the token format
for its simplicity as well as its capabilities for digital signature.
The following actors exist in the Authentication workflow:
n
Authentication Token:Created and signed by the client system to perform an
Authentication request, it is in this request where the Application is indicated.
n
Authentication Endpoint: Part of the Cylance Auth Web API which will handle the
authentication requests coming from client systems, there will be a particular endpoint to
handle JWT tokens.
n
Access Token:If authentication is successful and the client system is granted access to
the requested application, a token representing this identity and some key attributes will
be returned as a JWT token.
Authentication Token
The Authentication Token contains the ID of the Application to which a client system is
requesting access. The Application contains two attributes: Application ID and Application
Secret, the latter is cryptographic nonce used to sign the token, thus ensuring the authenticity
of the caller and therefore, it must be shared between client and server. The Authentication
endpoint has a mechanism to verify the signature and eventually proceed to grant access to the
Application, if the client request is indeed allowed.
The client will create the Authentication token by indicating the Application ID as a claim and
sign it using the Application Secret.
The Authentication Token must have the following claims. All are registered and conform to the
JWTstandard.
ClaimTypeDescription
Registered Claims
expNumericDate
Date and time when the Token expires and is no longer valid for
processing. This is Unix epoch time in seconds.
Note: The longest time-span honored by the service is 30 minutes from
the value specified in the iat claim. Specifying a longer time-span will
result in an HTTP 400 (Bad Request) response from the server.
Cylance User APIGuide, v2.0 rev34, December 2020 | 20
ClaimTypeDescription
iatNumericDate
issStringOrUri
jtiString
subStringOrUri
Time when the token was issued. This is Unix epoch time in seconds.
Represents the principal issuing the token, which is
Unique ID for the token, which can be used to prevent reply attacks.
Principal subject to the claim. In our case, this would hold our Application
ID.
http://cylance.com
Custom Claims
scpString
tidString
Comma delimited scopes requested. This claim is optional.
Tenant ID (available on the Integrations page in the Console).
The Authentication Token can be generated using Python. You can use the Python example
below, adding the required token claims that you need.
Note: Cylance Support does not provide assistance with installing non-Cylance programs (like
Python) or security (lke PyJWT). Cylance does have a knowledge base article with an example
for installing Python and PyJWT on Windows; this example is provided AS-IS and there is no
guarantee the example will work in your environment.
Software Requirements:
n Python 3.7 (latest version recommended)
n PyJWT package (pip install PyJWT)
Cylance User APIGuide, v2.0 rev34, December 2020 | 21
n Requests package (pip install requests)
Notes:
n Copying the Python Example from the PDF requires proper formatting in Python due to
the extra line breaks that can cause an error. Use the Python and PyJWT on Windows
knowledge base article to copy the example.
n Example using C# are available upon request.
PythonExample
# WARNING:Copying this example from the PDF requires proper
# formatting in Python due to the extra lines breaks that
# can cause an error.
# RECOMMENDED:Use the Python and PyJWT on Windows knowledge base
# article to copy the example.
import jwt # PyJWT version 1.7.1 as of the time of authoring.
import uuid
import requests # requests version 2.22.0 as of the time of authoring
import json
from datetime import datetime, timedelta
# 30 minutes from now
timeout = 1800
now = datetime.utcnow()
timeout_datetime = now + timedelta(seconds=timeout)
epoch_time = int((now - datetime(1970, 1, 1)).total_seconds())
epoch_timeout = int((timeout_datetime - datetime(1970, 1, 1)).total_
seconds())
jti_val = str(uuid.uuid4())
tid_val = "" # The tenant's unique identifier.
app_id = "" # The application's unique identifier.
app_secret = "" # The application's secret to sign the auth token
with.
"exp": epoch_timeout,
"iat": epoch_time,
"iss": "http://cylance.com",
"sub": app_id,
"tid": tid_val,
"jti": jti_val
# The following is optional and is being noted here as an example
on how one can restrict
# the list of scopes being requested
# "scp":
Cylance User APIGuide, v2.0 rev34, December 2020 | 22
Cylance User APIGuide, v2.0 rev34, December 2020 | 23
},
"request": ["auth_token"]
}
Authorization
In response to the Authentication request, the client will receive a response that contains at
least the Access Token. The access token will contain the Scopes that will dictate what can or
cannot be done. This token is signed by the server and the client will merely echo it on every
request as it tries to access Resources.
The access token represents the identity of the requester as well as some attributes like
Scopes. This token will have an expiration and should be sent on every request in the
Authorization Request Header. Failing to do so will result in an HTTP/1.1 401 Unauthorized
response. Should the token be provided and prove to be legitimate but the server finds the
action the caller is trying to attempt is not allowed (found in the scopes granted), an HTTP/1.1
403 Forbidden will be returned.
Access Token
The Access token represents a grant to access Cylance Resources. It contains information about
the identity of the caller (Application) as well as control information form the Token itself, for
instance, date it was issued and expiration. This token is also responsible for holding all Scopes
that would be used by our system to validate actions attempted to be taken against Cylance
Resources.
There is an expiration associated to this Token. The expiration time will be set during token
creation on the server side. After the token expires, the server will respond with HTTP/1.1 401
Unauthorized indicating to the caller to authenticate again with a new access token.
Response Status Codes
Each APIrequest will receive a response with a JSON payload and a standard HTTPstatus
code.
Note: Some API request sections include additional response status descriptions (specific to that
request) to help you troubleshoot issues.
Status
Code
Description
200 - OKA successful call and operation. The response payload will be JSON, structured
according to the nature of the request.
Cylance User APIGuide, v2.0 rev34, December 2020 | 24
Status
Code
Description
400 - Bad
Request
401 Unauthorized
403 Forbidden
404 - Not
Found
409 - Conflict A request was made to create or update an aspect of the resource that conflicts with
500 - Internal
Server Error
501 - Not
Implemented
OtherContact Cylance Support if you encounter any status codes that are not on this list.
There was a problem with the structure of the request or the payload. If determinable,
the response payload will identify the failure in the request. A common case of this type
of error is malformed JSON in the request body. A JSON validator can be used to
troubleshoot these issues.
Invalid credentials were passed or some other failure in authentication.
Request has been successfully authenticated, but authorization to access the
requested resource was not granted.
A request was made for a resource that doesn't exist. Common causes are either an
improperly formed URL or an invalid APIkey.
another. The most common reason for this code is a Tenant name or User email that is
already in use.
A catch-all code response for any unhandled error that has occurred on the server.
Contact Cylance Support for help with this issue.
A request was made against a resource with an operation that has yet to be
implemented. Such operations should be identified accordinly in documentation.
API Rate Limit
The rate limiting for APIendpoints is 100,000 requests per day, or about 70 requests per
minute. If a tenant exceeds these limits, they will receive a 429 error - Too Many Requests. If
you encounter a 429 error, wait 60 seconds before retrying the API request.
The purpose of a rate limit is to maintain a good user experience for all APIusers. Without a
rate limit, APIendpoints can flood the server with requests that overwhelm the system and
negatively impact all users.
About Device ID
When attempting to query a CylanceOPTICS APIcall that utilizes a device ID value, be aware
of the following:
The format for the CylanceOPTICS APIdevice ID value should be:
CylanceOPTICS Example:
n 45E07F34E76B4A9EB167D6D0C510D6BA (upper case without dashes)
Cylance User APIGuide, v2.0 rev34, December 2020 | 25
Passing the device ID value as the CylancePROTECT format will return an HTTP200 status, as
if the call was successful, but you will receive an incorrect response.
CylancePROTECT Example:
n 45e07f34-e76b-4a9e-b167-d6d0c510d6ba (lower case with dashes)
To obtain the device ID, you must query the CylancePROTECT API, then format the device ID
to match the CylanceOPTICS format (see example above).
This query can be found in the Device API section of this document. Use the Get Devices and
Get Device requests from the guide. The device ID value is the field titled "id".
About Zone ID
When attempting to query a CylanceOPTICS APIcall that utilizes a zone ID value, be aware of
the following:
The format for the CylanceOPTICS APIzone ID value should be:
CylanceOPTICS Example:
n D27FF5C45C0D4F56A00DA1FB297E440E (upper case without dashes)
Passing the zone ID value as the CylancePROTECT format will return an HTTP200 status, as if
the call was successful, but you will receive an incorrect response.
CylancePROTECT Example:
n d27ff5c4-5c0d-4f56-a00d-a1fb297e440e (lower case with dashes)
To obtain the zone ID, you must query the CylancePROTECT API, then format the zone ID to
match the CylanceOPTICS format (see example above).
This query can be found in the Zone API section of this document. Use the Get Zones and Get
Zone requests from the guide.
Cylance User APIGuide, v2.0 rev34, December 2020 | 26
User API
- 27 -
Create User
Create (add) a new Console user. This requires a unique email address for the user being
created.
Service Endpoint:
n /users/v2
Example:https://protectapi.cylance.com/users/v2
Method:
n HTTP/1.1 POST
Request Header:
n Accept:application/json
n Content-Type:application/json
n Authorization:Bearer <JWTToken returned by AuthAPI> with the user:create scope