API v2: Sessions Management¶
Data Structures¶
Note
The following data structure contains read-only fields for retrieving session data.
Attribute |
Type |
Description |
|---|---|---|
|
string |
Object Identifier |
|
string |
Object Identifier |
|
string |
Account’s Identifier, which was used for connection. Requires |
|
string |
Listener’s Identifier, which was used for connection |
|
string |
Safe’s Identifier, which was used for connection. Requires |
|
string |
Server’s Identifier, which was used for connection. Requires |
|
string |
User’s Identifier, which was used for connection. Requires |
|
string |
Datetime of the session’s start |
|
string |
Datetime of the session’s end |
|
string |
Object Identifier |
|
string |
|
|
string |
Datetime of the session’s termination |
|
string {all, none, raw, noraw} |
Session recording options |
|
string {http, modbus, mysql, rdp, ssh, system, tcp, tds, telnet, tn3270, tn5250, vnc} |
Read-only. Protocol used for connection. |
|
string |
Source IP address |
|
number |
Port of the source IP address |
|
string |
Destination IP address |
|
number |
Port of the destination IP address |
|
string |
Expensive. Concatenated destination IP and port. |
|
boolean |
|
|
boolean |
|
|
number |
Session indexing status. Values: 0Â =Â Waiting, 1Â =Â Error, 2Â =Â Indexed. Session is indexed when value is 2. |
|
string |
Hidden. Base64 encoded timestamping signature. |
|
number |
|
|
string |
Reason of the session’s termination or rejection |
|
string {approved, disconnected, expired, rejected, terminated, waiting} |
|
|
number |
|
|
See the |
|
|
boolean |
|
|
boolean |
|
|
boolean |
|
|
datetime |
Datetime of the record creation |
|
datetime |
Datetime of the record modification |
|
boolean |
|
|
string |
Reason for user’s connection |
|
string |
Resolution options |
|
string |
Resolution options |
|
string |
Resolution options |
|
string |
Session’s type |
|
string |
Read-only. Expensive to use. For example, |
|
string |
Expensive. User name who created session. |
|
boolean |
Expensive. User is removed. |
|
string |
Expensive. User organization who created session. |
|
string |
Expensive. Account name. |
|
boolean |
Expensive. Account is removed. |
|
string |
Expensive. Server name. |
|
boolean |
Expensive. Server is removed. |
|
string |
Expensive. Safe name. |
|
boolean |
Expensive. Safe is removed. |
|
string |
Expensive. Listener name. |
|
boolean |
Expensive. Listener is removed. |
|
string {user_blocked, user_removed, user_lost_access, seen} |
Expensive. State of user who checked out the current account password. Value ‘seen’ means that user has seen password and have access to it. |
|
boolean |
Read-only. Expensive. Indicates whether OCR was enabled for the session. |
|
boolean |
Read-only. Expensive. Indicates whether the session is eligible for OCR processing. |
|
boolean |
Expensive. Indicates whether OCR has been completed for the session. |
|
number |
Read-only. Expensive. Current progress of OCR processing. |
|
string {archived, available, downloading, missing} |
Expensive. Session availability. |
|
string |
Expensive. The serial number of the node where the session was created. |
|
boolean |
Read-only. Expensive. Session is fully replicated on archive node. |
|
number |
Expensive. Session duration in seconds. |
|
number |
Expensive. Session active time in percents. |
|
number |
Expensive. Time in seconds remaining until the session is terminated. Value is available only when terminate_at defined. Value 0 means session is finished or terminated. |
|
boolean |
Read-only. Expensive to use. Indicates whether the session is not fully replicated on the archive node. |
|
string |
Read-only. Hidden. Used only for filters. Query text to search for. |
|
boolean |
Read-only. Hidden. Used only for filters. Indicates whether to search text in user input. |
|
boolean |
Read-only. Hidden. Used only for filters. Indicates whether to search text in output. |
|
boolean |
Read-only. Hidden. Used only for filters. Indicates whether to search text in comments. |
|
string |
Read-only. Expensive to use. A part of the URL to the websocket that serves the data of this session. |
|
string {none, pending, completed} |
Read-only. Expensive to use. Status of timestamping process. |
|
string {checkout, http, http_rendered, modbus, mysql, rdp, scp, sftp, ssh, ssh_command, tcp, tds, telnet, tn3270, tn5250, vnc, x11} |
Read-only. Expensive to use. Session subprotocol. |
|
boolean |
Read-only. Expensive to use. Indicates that the session is running or has a replica on the current cluster node. |
|
string-array |
Read-only. Expensive to use. List of nodes that the session was fully replicated on. |
|
boolean |
Read-only. Expensive to use. Indicates whether any comments have been added to the session. |
Attribute |
Type |
Description |
|---|---|---|
|
number |
Detected threat level |
|
number |
Min threat level value |
|
number |
Max threat level value |
|
string |
Datetime of the session’s processing |
|
string |
End datetime of the session’s processing |
Retrieve Available Attributes of the SessionsModel¶
Request
Method |
|
Path |
|
To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.
Refer to the Batch operations topic to create nested requests for operating on the Sessions objects.
Get Sessions List¶
Request
Method |
|
Path |
|
Example Request
GET /api/v2/session
{
"result": "success",
"session": {
"id": "3927138875067084301",
"leader_session_id": "3927138875067084301",
"listener_id": "3927138875067073099",
"user_id": "3927138875067072685",
"safe_id": "3927138875067072584",
"account_id": "3927138875067088645",
"server_id": "3927138875067072586",
"started_at": "2022-04-05 16:06:07.313862+02",
"finished_at": "2022-04-05 16:07:58.65701+02",
"dump_mode": "all",
"protocol": "vnc",
"source_ip": "10.2.0.0",
"source_port": 65331,
"destination_ip": "10.0.0.1",
"destination_port": 5900,
"paused": false,
"retention_locked": false,
"indexed": 2,
"size": 371712,
"status": "approved",
"active_time": 60,
"password_change": false,
"checkout_forced": false,
"created_at": "2022-04-05 16:06:07.316523+02",
"modified_at": "2022-04-08 08:16:02.009606+02",
"height": "768",
"width": "1024"
}}
Get a Session by ID¶
Request
Method |
|
Path |
|
Example Request
GET /api/v2/session/<id>
{
"result": "success",
"session": {
"id": "3927138875067084301",
"leader_session_id": "3927138875067084301",
"listener_id": "3927138875067073099",
"user_id": "3927138875067072685",
"safe_id": "3927138875067072584",
"account_id": "3927138875067088645",
"server_id": "3927138875067072586",
"started_at": "2022-04-05 16:06:07.313862+02",
"finished_at": "2022-04-05 16:07:58.65701+02",
"dump_mode": "all",
"protocol": "vnc",
"source_ip": "10.2.0.0",
"source_port": 65331,
"destination_ip": "10.0.0.1",
"destination_port": 5900,
"paused": false,
"retention_locked": false,
"indexed": 2,
"size": 371712,
"status": "approved",
"active_time": 60,
"password_change": false,
"checkout_forced": false,
"created_at": "2022-04-05 16:06:07.316523+02",
"modified_at": "2022-04-08 08:16:02.009606+02",
"height": "768",
"width": "1024"
}}
Modify a Session¶
Request
Method |
|
Path |
|
Delete Session¶
Request
Method |
|
Path |
|
Example Request
DELETE /api/v2/session/<id>
curl -s -k -X DELETE \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/session/9124292845052624897'
Response
{
"result": "success"
}