Reporting subchapters created from audit trail content (statistics of search keywords, and screenshots). You have to provide a list of keywords, and create the appropriate filters to narrow down the scope of the search. Safeguard for Privileged Sessions searches the indexed content of all audit trails that fit the filter criteria, and provide the resulting statistics and screenshots in the report.
Configure and enable indexing for all connections that you want to include in the reports.
GET https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/content_subchapters
Header name | Description | Required | Values |
---|---|---|---|
session_id | Contains the authentication token of the user | Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the Safeguard for Privileged Sessions REST API. Note that this session ID refers to the connection between the REST client and the Safeguard for Privileged Sessions REST API. It is not related to the sessions that Safeguard for Privileged Sessions records (and which also have a session ID, but in a different format). |
The following command lists the available content subchapters.
curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/content_subchapters
The following command retrieves the properties of a specific subchapter.
curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/content_subchapters/<subchapter-key>
The following is a sample response received when listing content subchapters. For details of the meta object, see Introduction.
{ "meta": { "first": "/api/configuration/reporting/content_subchapters", "href": "/api/configuration/reporting/content_subchapters", "last": "/api/configuration/reporting/statistics_subchapters", "next": "/api/configuration/reporting/custom_subchapters", "parent": "/api/configuration/reporting", "previous": null, "transaction": "/api/transaction" }, "items": [ { "key": "13869311625707e0a3e0892", "meta": { "href": "/api/configuration/reporting/content_subchapters/13869311625707e0a3e0892" } } ] }
When retrieving the endpoint of a specific content subchapter, the response is the following.
{ "body": { "access": [ "search" ], "filter": { "channel_policy": { "key": "-10200", "meta": { "href": "/api/configuration/ssh/channel_policies/-10200" } }, "connection_policy": "8348340645707e2575e3c6", "protocol": "ssh", "server_address": "192.168.56.102", "server_port": 22, "source_address": "192.168.56.101", "source_port": 22, "username": "admin" }, "name": "API_test_subchapter", "search_words": [ "logout" ] }, "key": "13869311625707e0a3e0892", "meta": { "first": "/api/configuration/reporting/content_subchapters/13869311625707e0a3e0892", "href": "/api/configuration/reporting/content_subchapters/13869311625707e0a3e0892", "last": "/api/configuration/reporting/content_subchapters/13869311625707e0a3e0892", "next": null, "parent": "/api/configuration/reporting/content_subchapters", "previous": null, "transaction": "/api/transaction" } }
Element | Type | Description | ||
---|---|---|---|---|
key | string | Top level element, contains the ID of the subchapter. | ||
body | Top level element (string) | The elements of the subchapter. | ||
access | list |
Required. List of access control groups whose members can access the subchapter. To deny access to the subchapter, use "admin" as the only value for the element. | ||
filter | Top level element. | Filter options for narrowing the scope of the keyword search. See the corresponding table for more details. | ||
channel_policy | string |
References the key of the channel policy. You can configure channel policies at the "/api/configuration/<protocol>/channel_policies/<policy-ID>" endpoint. Note that the path is different for each protocol. To modify or add a channel policy, use the value of the returned key as the value of the channel_policy element, and remove any child elements (including the key). | ||
connection_policy | string |
The key of the connection policy specified for the search. To use a connection policy, you must also set the protocol using the protocol element. | ||
protocol | string |
The protocol of the connection or channel policy specified for the search. | ||
server_address | string |
The target server's address. Use an IPv4 address. | ||
server_port | int | The port of the target server's address. | ||
source_address | string | The address from where the connection is initiated. | ||
source_port | int | The port of the address from where the connection is initiated. | ||
username | string | The username used to connect to the target server. | ||
name | string | The name of the subchapter. | ||
search_words | list | The list of search keywords to generate statistics and screenshots for in the subchapter. |
Create a content subchapter for the occurences of the "logout" keyword in SSH connections. Make the subchapter accessible to the search and report usergroups.
Search connections where the "shell-only" channel policy is used.
{ "access": [ "search", "report" ], "filter": { "channel_policy": "-10000", "connection_policy": null, "protocol": "ssh", "server_address": null, "server_port": null, "source_address": null, "source_port": null, "username": null }, "name": "Shell_access", "search_words": [ "logout" ] }
Search connections of a specific connection policy. Provide the protocol of the connection. The key of the connection policy is available at the /api/configuration/<protocol>/connections/ endpoint.
{ "access": [ "search", "report" ], "filter": { "channel_policy": null, "connection_policy": "<key-of-connection-policy>", "protocol": "ssh", "server_address": null, "server_port": null, "source_address": null, "source_port": null, "username": null }, "name": "Controlled_access", "search_words": [ "logout" ] }
Search connections where the "admin" username was used.
{ "access": [ "search", "report" ], "filter": { "channel_policy": null, "connection_policy": null, "protocol": "ssh", "server_address": null, "server_port": null, "source_address": null, "source_port": null, "username": "admin" }, "name": "Login_as_admin", "search_words": [ "logout" ] }
Search connections made to a specific server address and port.
{ "access": [ "search", "report" ], "filter": { "channel_policy": null, "connection_policy": null, "protocol": "ssh", "server_address": "<server-ip>", "server_port": <port>, "source_address": null, "source_port": null, "username": null }, "name": "Server_access", "search_words": [ "logout" ] }
The following table lists the typical status and error codes for this request. For a complete list of error codes, see Using the Safeguard for Privileged Sessions REST API.
Code | Description | Notes |
---|---|---|
201 | Created | The new resource was successfully created. |
400 | InvalidQuery | The requested filter or its value is invalid. |
400 |
Path: <endpoint>/filter/channel_policy Type: SyntacticError |
You have included the key and meta elements of a channel_policy in a PUT or POST request. |
401 | Unauthenticated | The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
401 | AuthenticationFailure | Authenticating the user with the given credentials has failed. |
404 | NotFound | The requested object does not exist. |
To add a content subchapter, you have to:
For details, see Open a transaction.
POST the JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/content_subchapters/ endpoint. You can find a detailed description of the available parameters listed in Content subchapters.
To use a channel policy for filtering, use the key of the policy. You must also set the protocol element to the corresponding protocol.
For example, to use the shell-only channel policy, which is a default SSH policy provided by Safeguard for Privileged Sessions, you have to configure both the channel_policy element…
"channel_policy": "-10000"
…and the protocol element:
"protocol": "ssh"
If the POST request is successful, the response includes the key of the new subchapter. For example:
{ "key": "416bb324-b44e-4ed3-a49d-02e99e53e941", "meta": { "href": "/api/configuration/reporting/content_subchapters/416bb324-b44e-4ed3-a49d-02e99e53e941", "parent": "/api/configuration/reporting/content_subchapters", "transaction": "/api/transaction" } }
For details, see Commit a transaction.
To modify a content subchapter, you have to:
For details, see Open a transaction.
You can find a detailed description of the available parameters listed in Content subchapters
To use a channel policy for filtering, do not include the returned key and meta elements of the channel policy in your PUT request. Instead, set the value of the channel_policy to the value of its key.
For example, if a GET request for the subchapter returns the following channel_policy filter:
"channel_policy": { "key": "-10200", "meta": { "href": "/api/configuration/ssh/channel_policies/-10200" } }
You have to change it in your PUT request to:
"channel_policy": "-10200"
You must also configure the protocol element to the protocol of the channel policy.
PUT the modified JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/content_subchapters/<subchapter-key> endpoint.
For details, see Commit a transaction.
List of the reporting subchapters created from custom queries to the Safeguard for Privileged Sessions connection database. The list of tables and fields you can query are described in "Database tables available for custom queries" in the Administration Guide.
GET https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/custom_subchapters
Header name | Description | Required | Values |
---|---|---|---|
session_id | Contains the authentication token of the user | Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the Safeguard for Privileged Sessions REST API. Note that this session ID refers to the connection between the REST client and the Safeguard for Privileged Sessions REST API. It is not related to the sessions that Safeguard for Privileged Sessions records (and which also have a session ID, but in a different format). |
The following command lists the available custom subchapters.
curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/custom_subchapters
The following command retrieves the properties of a specific subchapter.
curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/custom_subchapters/<object-id>
The following is a sample response received when listing custom subchapters. For details of the meta object, see Introduction.
{ "meta": { "first": "/api/configuration/reporting/content_subchapters", "href": "/api/configuration/reporting/custom_subchapters", "last": "/api/configuration/reporting/statistics_subchapters", "next": "/api/configuration/reporting/predefined_reports", "parent": "/api/configuration/reporting", "previous": "/api/configuration/reporting/content_subchapters", "transaction": "/api/transaction" }, "items": [ { "key": "5983143445707eb740fee3", "meta": { "href": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3" } } ] }
When retrieving the endpoint of a specific subchapter, the response is the following.
{ "body": { "access": [ "search" ], "chart": { "column_titles": [ "col1", "col2" ], "type": "list" }, "name": "API_test_adv_stats", "query": "select\n to_timestamp(audit_trail_downloads.download_time),\n audit_trail_downloads.username,\n channels.channel_type,\n channels.connection,\n audit_trail_downloads.ip\nfrom audit_trail_downloads,\n channels\nwhere channels._connection_channel_id = audit_trail_downloads.id\nand audit_trail_downloads.download_time <= :range_start\nand audit_trail_downloads.download_time > :range_end\nand audit_trail_downloads.username != 'admin'\norder by audit_trail_downloads.download_time;" }, "key": "5983143445707eb740fee3", "meta": { "first": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3", "href": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3", "last": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3", "next": null, "parent": "/api/configuration/reporting/custom_subchapters", "previous": null, "transaction": "/api/transaction" } }
Element | Type | Description | ||||
---|---|---|---|---|---|---|
key | string | Top level element, contains the ID of the custom subchapter. | ||||
body | Top level element (string) | The elements of the custom subchapter. | ||||
access | list |
Required. List of access control groups whose members can access the subchapter. To deny access to the subchapter, use "admin" as the only value for the element. | ||||
chart | Top level element | Defines the properties of the chart generated from the database query. | ||||
type | string |
Defines the chart type.
| ||||
y_axis_title | string |
Required if the type element is set to bar. The name of the y axis for the generated bar chart. | ||||
column_titles | list |
Required if the type element is set to list. The column titles for the generated list. | ||||
name | string | The name of the subchapter. | ||||
query | string |
The SQL database query for creating the subchapter.
|
Create a bar chart with a custom title for the y-axis:
"chart": { "type": "bar", "y_axis_title": "Y_axis" }
Create a pie chart:
"chart": { "type": "pie" }
Create a list with custom column names:
"chart": { "column_titles": [ "col1", "col2" ], "type": "list" }
The following table lists the typical status and error codes for this request. For a complete list of error codes, see Using the Safeguard for Privileged Sessions REST API.
Code | Description | Notes |
---|---|---|
201 | Created | The new resource was successfully created. |
400 | InvalidQuery | The requested filter or its value is invalid. |
401 | Unauthenticated | The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
401 | AuthenticationFailure | Authenticating the user with the given credentials has failed. |
404 | NotFound | The requested object does not exist. |
To add a custom subchapter, you have to:
For details, see Open a transaction.
POST the JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/custom_subchapters endpoint. You can find a detailed description of the available parameters listed in Custom subchapters.
If the POST request is successful, the response includes the key of the new subchapter. For example:
{ "key": "9a8f7f19-edbf-4327-9d3a-9f527e7331ee", "meta": { "href": "/api/configuration/reporting/custom_subchapters/9a8f7f19-edbf-4327-9d3a-9f527e7331ee", "parent": "/api/configuration/reporting/custom_subchapters", "transaction": "/api/transaction" } }
For details, see Commit a transaction.
To modify a subchapter, you have to:
For details, see Open a transaction.
PUT the modified JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/custom_subchapters/<key-of-the-object> endpoint. You can find a detailed description of the available parameters listed in Custom subchapters.
For details, see Commit a transaction.
List of the reporting subchapters created from connection statistics.
GET https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/statistics_subchapters
Header name | Description | Required | Values |
---|---|---|---|
session_id | Contains the authentication token of the user | Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the Safeguard for Privileged Sessions REST API. Note that this session ID refers to the connection between the REST client and the Safeguard for Privileged Sessions REST API. It is not related to the sessions that Safeguard for Privileged Sessions records (and which also have a session ID, but in a different format). |
The following command lists the available subchapters.
curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/statistics_subchapters
The following command retrieves the properties of a specific subchapter.
curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/statistics_subchapters/<subchapter-id>
The following is a sample response received when listing connection statistics subchapters. For details of the meta object, see Introduction.
{ "meta": { "first": "/api/configuration/reporting/content_subchapters", "href": "/api/configuration/reporting/statistics_subchapters", "last": "/api/configuration/reporting/statistics_subchapters", "next": null, "parent": "/api/configuration/reporting", "previous": "/api/configuration/reporting/reports", "transaction": "/api/transaction" }, "items": [ { "key": "21111736175707f1df8bea1", "meta": { "href": "/api/configuration/reporting/statistics_subchapters/21111736175707f1df8bea1" } } ] }
When retrieving the endpoint of a specific subchapter, the response is the following.
{ "body": { "access": [ "search", "reporting" ], "chart": { "type": "list" }, "name": "stats_simple", "query": { "column": "username", "filter": [ { "column": "protocol", "is_exact": false, "is_inverted": false, "value": "ssh" }, { "column": "username", "is_exact": false, "is_inverted": false, "value": "admin" } ], "limit": 15, "order": "top" } }, "key": "496444806570e9c7e32c30", "meta": { "first": "/api/configuration/reporting/statistics_subchapters/21111736175707f1df8bea1", "href": "/api/configuration/reporting/statistics_subchapters/496444806570e9c7e32c30", "last": "/api/configuration/reporting/statistics_subchapters/496444806570e9c7e32c30", "next": null, "parent": "/api/configuration/reporting/statistics_subchapters", "previous": "/api/configuration/reporting/statistics_subchapters/1539306268570e9442cab6c", "transaction": "/api/transaction" } }
Element | Type | Description | ||
---|---|---|---|---|
key | string | Top level element, contains the ID of the subchapter. | ||
body | Top level element (string) | The elements of the subchapter. | ||
access | list |
Required. List of access control groups whose members can access the subchapter. To deny access to the subchapter, use "admin" as the only value for the element. | ||
chart | Top level element | Defines the properties of the chart generated from the database query. | ||
type | string |
Defines the chart type.
| ||
name | string | The name of the subchapter. | ||
query | string | The search query that defines the connections to use for creating statistics. For details on using the search, see Searching in the session database. |
Create statistics about the 15 most common usernames used in SSH connections.
Create a bar chart.
{ "access": [ "reporting", "search" ], "chart": { "type": "bar" }, "name": "stats_bar", "query": { "column": "username", "filter": [ { "column": "protocol", "is_exact": false, "is_inverted": false, "value": "ssh" } ], "limit": 15, "order": "top" } }
Create a pie chart.
{ "access": [ "reporting", "search" ], "chart": { "type": "pie" }, "name": "stats_pie", "query": { "column": "username", "filter": [ { "column": "protocol", "is_exact": false, "is_inverted": false, "value": "ssh" } ], "limit": 15, "order": "top" } }
Create a list.
{ "access": [ "reporting", "search" ], "chart": { "type": "list" }, "name": "stats_list", "query": { "column": "username", "filter": [ { "column": "protocol", "is_exact": false, "is_inverted": false, "value": "ssh" } ], "limit": 15, "order": "top" } }
The following table lists the typical status and error codes for this request. For a complete list of error codes, see Using the Safeguard for Privileged Sessions REST API.
Code | Description | Notes |
---|---|---|
201 | Created | The new resource was successfully created. |
400 | InvalidQuery | The requested filter or its value is invalid. |
401 | Unauthenticated | The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
401 | AuthenticationFailure | Authenticating the user with the given credentials has failed. |
404 | NotFound | The requested object does not exist. |
To add a connection statistics subchapter, you have to:
For details, see Open a transaction.
POST the JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/statistics_subchapters/ endpoint. You can find a detailed description of the available parameters listed in Connection statistics subchapters.
If the POST request is successful, the response includes the key of the new subchapter. For example:
{ "key": "769e627d-515d-4d26-a03e-cb2ed0bbee04", "meta": { "href": "/api/configuration/reporting/statistics_subchapters/769e627d-515d-4d26-a03e-cb2ed0bbee04", "parent": "/api/configuration/reporting/statistics_subchapters", "transaction": "/api/transaction" } }
For details, see Commit a transaction.
To modify a subchapter, you have to:
For details, see Open a transaction.
PUT the modified JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/reporting/statistics_subchapters//<key-of-the-subchapter> endpoint. You can find a detailed description of the available parameters listed in Connection statistics subchapters.
For details, see Commit a transaction.
© 2023 One Identity LLC. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy