Converse agora com nosso suporte
Chat com o suporte

One Identity Safeguard for Privileged Sessions 6.0.1 - REST API Reference Guide

Introduction Using the SPS REST API Basic settings User management and access control Managing SPS General connection settings HTTP connections Citrix ICA connections RDP connections SSH connections Telnet connections VNC connections Search, download, and index sessions Reporting Health and maintenance Advanced authentication and authorization Completing the Welcome Wizard using REST Enable and configure analytics using REST

Audit data access rules

This endpoint enables you to restrict the search and access privileges of usergroups to audit data.

URL
GET https://<IP-address-of-SPS>/api/acl/audit_data
Cookies
Cookie 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 SPS REST API.

Note that this session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format).

Sample request

The following command lists the available audit data access rules.

curl --cookie cookies https://<IP-address-of-SPS>/api/acl/audit_data
Response

The following is a sample response received when querying the endpoint.

For details of the meta object, see Message format.

{
    "items": [
        {
            "key": "autogenerated-10211162955b9621d4eb244",
            "meta": {
                "href": "/api/acl/audit_data/autogenerated-10211162955b9621d4eb244"
            }
        }
    ],
    "meta": {
        "href": "/api/acl/audit_data",
        "parent": "/api/acl",
        "remaining_seconds": 600,
        "transaction": "/api/transaction"
    }
}
Element Type Description
items Top-level element (list of JSON objects) List of endpoints (objects) available from the current endpoint.
key string The ID of the endpoint.
meta Top-level item (JSON object) Contains the path to the endpoint.
href string (relative path) The path of the resource that returned the response.
Query a specific audit data access rule

To find out the contents of a particular audit data access rule, complete the following steps:

NOTE:

If you have an SPS user who has Search > Search in all connections privileges in AAA > Access Control, the autogenerated-all-data-access-id rule is automatically generated. Therefore, you can almost always query this audit data access rule.

  1. Query the https://<IP-address-of-SPS>/api/acl/audit_data/<key-of-rule-to-be-queried> endpoint.
    curl --cookie cookies https://<IP-address-of-SPS>/api/acl/audit_data/<key-of-rule-to-be-queried>

    The following is a sample response received.

    For details of the meta object, see Message format.

    {
        "body": {
    	"name": "my_ssh_rule",
    	"query": "psm.connection_policy:my_ssh_connection_policy",
    	"groups": [
    	    "ssh-view",
    	    "ssh-write"		
    	]								
        },
        "key": "autogenerated-10211162955b9621d4eb244",
        "meta": {
            "href": "/api/acl/audit_data/autogenerated-10211162955b9621d4eb244",
            "parent": "/api/acl/audit_data",
            "remaining_seconds": 600,
            "transaction": "/api/transaction"
        }
    }
    Elements Type Description
    body Top-level element (JSON object) Contains the JSON object of the rule.

     

    name

    string

    The human-readable name of the audit data access rule that you specified when you created the rule.

     

    query

    string

    The query that members of the usergroup(s) are allowed to perform.

    groups list The usergroup(s) whose access to audit data you want to restrict.
Status and error codes

The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.

Code Description Notes
201 Created The new resource was successfully created.

400

SemanticError

The configuration contains semantic errors, inconsistencies or other problems that would put the system into an unreliable state if the configuration had been applied. The details section contains the errors that were found in the configuration.

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.

Active sessions

The api/active-sessions endpoint has only one parameter and it only serves the DELETE request.

URL
GET https://<IP-address-of-SPS>/api/active-sessions
Cookies
Cookie 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 SPS REST API.

Note that this session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format).

Sample request

The following command lists the ACLs:

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/aaa/acls

The user (in this example, user1) has to be a member of a group that has read and write/perform privileges for Active Sessions (/special/active_sessions). After authentication, user1 can delete the active session determined by the session ID.

curl -k --user user1 --cookie-jar /tmp/cookie https://192.168.122.194/api/authentication
curl -k --cookie /tmp/cookie https://192.168.122.194/api/active-sessions?id=svc/rpokH8fD9kx6CaxNLznKx2/test:12 -X DELETE
Status and error codes

The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.

Code Description Notes
400 SessionIdMissing No session id is given in the id query parameter.
500 SessionTerminationFailed The session could not be terminated due to internal errors.

Manage users and usergroups locally on SPS

Contains the endpoints for managing users and usergroups locally on SPS.

URL
GET https://<IP-address-of-SPS>/api/configuration/aaa/local_database
Cookies
Cookie 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 SPS REST API.

Note that this session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format).

Sample request

The following command lists the endpoints of the local database.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/aaa/local_database
Response

The following is a sample response received when listing the endpoint.

For details of the meta object, see Message format.

{
    "items": [
        {
            "key": "groups",
            "meta": {
                "href": "/api/configuration/aaa/local_database/groups"
            }
        },
        {
            "key": "users",
            "meta": {
                "href": "/api/configuration/aaa/local_database/users"
            }
        }
    ],
    "meta": {
        "first": "/api/configuration/aaa/acls",
        "href": "/api/configuration/aaa/local_database",
        "last": "/api/configuration/aaa/settings",
        "next": "/api/configuration/aaa/settings",
        "parent": "/api/configuration/aaa",
        "previous": "/api/configuration/aaa/acls",
        "transaction": "/api/transaction"
    }
}
Element Description
groups Endpoint that contains local usergroups.
users Endpoint that contains local usernames.
Status and error codes

The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.

Code Description Notes
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.

Manage usergroups locally on SPS

Contains the local usergroups of SPS. You can use local groups to control the privileges of SPS local and LDAP users — who can view and configure what. You can edit the group memberships here as well.

Note that currently you cannot edit the privileges (ACLs) of the groups using the REST API. If you change the privileges of a usergroup on the SPS web interface, the changes will apply to the users when they authenticate again on SPS, the privileges of active sessions are not affected.

URL
GET https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups
Cookies
Cookie 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 SPS REST API.

Note that this session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format).

Sample request

The following command lists the local usergroups.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups
Response

The following is a sample response received when querying a particular usergroup endpoint.

For details of the meta object, see Message format.

{
    "body": {
        "members": [],
        "name": "http-write"
    },
    "key": "ca2dc85730ca082ee6b5c8",
    "meta": {
        "first": "/api/configuration/aaa/local_database/groups/224696054489c27f6c5710",
        "href": "/api/configuration/aaa/local_database/groups/ca2dc85730ca082ee6b5c8",
        "last": "/api/configuration/aaa/local_database/groups/ca2dc85730ca082ee6b5f8",
        "next": "/api/configuration/aaa/local_database/groups/b080b1ba546232548bb1f9",
        "parent": "/api/configuration/aaa/local_database/groups",
        "previous": "/api/configuration/aaa/local_database/groups/b080b1ba546232548bb1a9",
        "transaction": "/api/transaction"
    }
}
Element Type Description
body Top level element (JSON object) Contains the properties of the usergroup.
members list Lists the names of the users belonging to the group.
name string The name of the group.
key string Top level element, contains the ID of the endpoint.
Status and error codes

The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.

Code Description Notes
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.
409 NoTransaction No open Transaction is available. You must open a transaction first (for details, see Open a transaction).
Add new local usergroup

To create a new local usergroup, you have to POST the name and members of the group as a JSON object to the https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups endpoint. For details, see Create a new object.

  1. Open a transaction.

    For details, see Open a transaction.

  2. Create a new usergroup.

    POST the name of the group and the list of member accounts as a JSON object to the https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups endpoint. The body of the POST request should be the following. Note that you must refer to existing user accounts, and use their reference IDs, not their usernames.

    {
        "name": "new-userggroup",
        "members": ["46785097158061f46c63d0", "1362061674580df4e00620d"]
    }

    For example:

    curl -X POST -H "Content-Type: application/json" --cookie cookies https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups --data '{"name": "new-usergroup", "members": ["46785097158061f46c63d0", "1362061674580df4e00620d"]}'

    If the POST request is successful, the response includes a reference ID for the usergroup object.

  3. Commit your changes.

    For details, see Commit a transaction.

Delete usergroup

To delete a usergroup, you have to:

  1. Open a transaction (for details, see Open a transaction).

  2. DELETE the https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups/<ID-of-the-group> endpoint. For details, see Delete an object. If the DELETE request is successful, the response includes only the meta object, for example:

    {
        "meta": {
            "href": "/api/configuration/aaa/local_database/groups/b080b1ba546232548bb1a9",
            "parent": "/api/configuration/aaa/local_database/groups"
        }
    }
  3. Commit your changes to actually delete the object from SPS (for details, see Commit a transaction).

Delete user from usergroup

To delete a user from a usergroup, you have to:

  1. Open a transaction (for details, see Open a transaction).

  2. Create an updated version of the usergroup object that does not include the user you want to delete.

  3. PUT the updated usergroup object to the https://<IP-address-of-SPS>/api/configuration/aaa/local_database/groups/<ID-of-the-group> endpoint. For details, see Delete an object.

  4. Commit your changes to actually delete the object from SPS (for details, see Commit a transaction).

Documentos relacionados

The document was helpful.

Selecione a classificação

I easily found the information I needed.

Selecione a classificação