Chatta subito con l'assistenza
Chat con il supporto

One Identity Safeguard for Privileged Sessions 6.9.5 - 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 MSSQL 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

Local user databases

Local User Databases are available for RDP, SSH and Telnet protocols, and can be used to authenticate the clients to credentials that are locally available on SPS. Such credentials include passwords and public keys. Local User Databases are most commonly used in inband gateway authentication scenarios.

URL
GET https://<IP-address-of-SPS>/api/configuration/policies/user_databases
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 local user databases.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/policies/user_databases

The following command retrieves the properties of a specific local user database.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/policies/user_databases/<object-id>
Response

The following is a sample response received when listing local user databases.

For details of the meta object, see Message format.

{
  "items": [
    {
      "key": "8235074425707e306abf39",
      "meta": {
        "href": "/api/configuration/policies/user_databases/8235074425707e306abf39"
      }
    }
  ],
  "meta": {
    "first": "/api/configuration/policies/audit_policies",
    "href": "/api/configuration/policies/user_databases",
    "last": "/api/configuration/policies/usermapping_policies",
    "next": "/api/configuration/policies/userlists",
    "parent": "/api/configuration/policies",
    "previous": "/api/configuration/policies/trusted_ca_lists",
    "transaction": "/api/transaction"
  }
}

When retrieving the endpoint of a specific local user database, the response is the following.

{
  "body": {
    "name": "<name-of-the-user-database>",
    "users": [
      {
        "passwords": [
          {
            "key": "ad55822d-fa28-45aa-bca4-220074f770e1",
            "meta": {
              "href": "/api/configuration/passwords/ad55822d-fa28-45aa-bca4-220074f770e1"
            }
          }
        ],
        "public_keys": [
          {
            "selection": "rsa",
            "value": "<public-key>"
          }
        ],
        "username": "<username>"
      }
    ]
  },
  "key": "8235074425707e306abf39",
  "meta": {
    "first": "/api/configuration/policies/user_databases/8235074425707e306abf39",
    "href": "/api/configuration/policies/user_databases/8235074425707e306abf39",
    "last": "/api/configuration/policies/user_databases/8235074425707e306abf39",
    "next": null,
    "parent": "/api/configuration/policies/user_databases",
    "previous": null,
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the local user database.
body Top level element (string) Contains the properties of the local user database.
name string The name of the local user database. This name is also displayed on the SPS web interface. It cannot contain whitespace.
users Top level list Contains the credentials (password, key) of each configured user.
passwords Top level item

References the password of the user. You can configure passwords at the /api/configuration/passwords/ endpoint.

To modify or add a password, use the value of the returned key as the value of the password element, and remove any child elements (including the key).

public_keys Top level list Contains the pubic keys of the user.
username Top level list, string Name of the user.
Elements of public_keys Type Description
selection string

Possible values are:

  • rsa

    The value element contains an RSA key.

  • dss

    The value element contains a DSS key.

value string The public key.
Examples:

Configure password authentication only for test_user. (New passwords can only be provided using the web interface of SPS.)

{
  "name": "<name-of-the-user-database>",
  "users": [
    {
      "certificates": [],
      "passwords": [
        "ad55822d-fa28-45aa-bca4-220074f770e1"
      ],
      "public_keys": [],
      "username": "test_user"
    }
  ]
}

Configure two possible X.509 certificates for test_user, and no other authentication options.

{
  "name": "<name-of-the-user-database>",
  "users": [
    {
      "certificates": [
        "<cert1>",
        "<cert2>"
      ],
      "passwords": [],
      "public_keys": [],
      "username": "test_user"
    }
  ]
}
Add a local user database

To add a local user database, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Create the JSON object for the new local user database.

    POST the JSON object to the https://<IP-address-of-SPS>/api/configuration/policies/user_databases endpoint. You can find a detailed description of the available parameters listed in Element .

    If the POST request is successful, the response includes the key of the new local user database. For example:

    {
      "key": "c4e60325-971a-44bc-ac01-e353dc6320d6",
      "meta": {
        "href": "/api/configuration/policies/user_databases/c4e60325-971a-44bc-ac01-e353dc6320d6",
        "parent": "/api/configuration/policies/user_databases",
        "transaction": "/api/transaction"
      }
    }
  3. Commit your changes.

    For more information, see Commit a transaction.

Modify a local user database

To modify a local usre database, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Modify the JSON object of the local user database.

    PUT the modified JSON object to the https://<IP-address-of-SPS>/api/configuration/policies/user_databases/<key-of-the-object> endpoint. You can find a detailed description of the available parameters listed in Element .

  3. Commit your changes.

    For more information, see Commit a transaction.

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 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.
403 Unauthorized The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
404 NotFound The requested object does not exist.

User lists

User lists are local white- or blacklists of usernames that allow fine-control over who can access a connection or a channel.

NOTE: User lists on SPS cannot prevent a user from accessing the server from a local terminal.

You can use user lists when configuring gateway_groups or remote_groups in the allowed_for element of channel policies. For more information on configuring channel policies, see Channel policy.

To use this option, you must also configure web gateway authentication in the connection policy, or client-side gateway authentication back-end in the authentication policy.

URL
GET https://<IP-address-of-SPS>/api/configuration/policies/userlists
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 user lists created on SPS.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/policies/userlists

The following command retrieves the properties of a specific list.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/policies/userlists/<key-id>
Response

The following is a sample response received when retrieveing the user lists.

For details of the meta object, see Message format.

The keys with negative ID values are the default user lists of SPS.

{
  "meta": {
    "first": "/api/configuration/policies/audit_policies",
    "href": "/api/configuration/policies/userlists",
    "last": "/api/configuration/policies/usermapping_policies",
    "next": "/api/configuration/policies/usermapping_policies",
    "parent": "/api/configuration/policies",
    "previous": "/api/configuration/policies/user_databases",
    "transaction": "/api/transaction"
  },
  "items": [
    {
      "key": "-1",
      "meta": {
        "href": "/api/configuration/policies/userlists/-1"
      }
    },
    {
      "key": "-2",
      "meta": {
        "href": "/api/configuration/policies/userlists/-2"
      }
    },
    {
      "key": "-3",
      "meta": {
        "href": "/api/configuration/policies/userlists/-3"
      }
    },
    {
      "key": "-4",
      "meta": {
        "href": "/api/configuration/policies/userlists/-4"
      }
    },
    {
      "key": "20088200245706af301b1ba",
      "meta": {
        "href": "/api/configuration/policies/userlists/20088200245706af301b1ba"
      }
    }
  ]
}

When retrieving the endpoint of a specific user list, the response is the following.

{
  "body": {
        "allow": "no_user",
        "except": [
            "root"
        ],
        "name": "root_only"
    },
    "key": "-4",
    "meta": {
        "href": "/api/configuration/policies/userlists/-4"
    }
},
  "key": "-4",
  "meta": {
    "first": "/api/configuration/policies/userlists/-1",
    "href": "/api/configuration/policies/userlists/-4",
    "last": "/api/configuration/policies/userlists/20088200245706af301b1ba",
    "next": "/api/configuration/policies/userlists/20088200245706af301b1ba",
    "parent": "/api/configuration/policies/userlists",
    "previous": "/api/configuration/policies/userlists/-3",
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the user list
body Top level element (string) The elements of the user policy.
allow string

The default policy of the user list. Possible values are:

  • all_users creates a blacklist, where every user is permitted, except the ones listed in the except field.

  • no_user creates a whitelist, where only the users listed in the except field are allowed access.

name string

The name of the user list.

except list

The usernames added to the list.

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 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.
403 Unauthorized The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
404 NotFound The requested object does not exist.
Examples

The following defines a blacklist called no_root that permits every username except root.

{
    "allow": "all_users",
    "except": [
        "root"
    ],
    "name": "no_root"
}

The following defines a whitelist called my_list that permits only the permitted_user1 and permitted_user2 usernames.

{
    "allow": "no_user",
    "except": [
        "permitted_user1",
        "permitted_user2"
    ],
    "name": "no_root"
}
Add a user list

To add a user list, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Create the JSON object for the new user list.

    POST the JSON object to the https://<IP-address-of-SPS>/api/configuration/policies/userlists endpoint. You can find a detailed description of the available parameters listed in Element .

    If the POST request is successful, the response includes the key of the new user list. For example:

    {
      "key": "321314dc-eca0-4e97-b445-0612fedc0165",
      "meta": {
        "href": "/api/configuration/policies/userlists/321314dc-eca0-4e97-b445-0612fedc0165",
        "parent": "/api/configuration/policies/userlists",
        "transaction": "/api/transaction"
      }
    }
  3. Commit your changes.

    For more information, see Commit a transaction.

Modify a user list

To modify a user list, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Modify the JSON object of the user list.

    PUT the modified JSON object to the https://<IP-address-of-SPS>/api/configuration/policies/userlists/<key-of-the-object> endpoint. You can find a detailed description of the available parameters listed in Element .

  3. Commit your changes.

    For more information, see Commit a transaction.

HTTP connections

Topics:

HTTP connections

List of endpoints for configuring the policies, options and connection rules of HTTP connections.

URL
GET https://<IP-address-of-SPS>/api/configuration/http
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 settings for configuring for HTTP connections.

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

The following is a sample response received when listing the configuration settings.

For details of the meta object, see Message format.

{
  "items": [
    {
        "key": "authentication_policies",
        "meta": {
            "href": "/api/configuration/http/authentication_policies"
        }
    },
    {
        "key": "channel_policies",
        "meta": {
            "href": "/api/configuration/http/channel_policies"
        }
    },
    {
        "key": "connections",
        "meta": {
            "href": "/api/configuration/http/connections"
        }
    },
    {
        "key": "options",
        "meta": {
            "href": "/api/configuration/http/options"
        }
    },
    {
        "key": "settings_policies",
        "meta": {
            "href": "/api/configuration/http/settings_policies"
        }
    }
  ],
  "meta": {
    "first": "/api/configuration/aaa",
    "href": "/api/configuration/http",
    "last": "/api/configuration/x509",
    "next": "/api/configuration/ica",
    "parent": "/api/configuration",
    "previous": "/api/configuration/datetime",
    "transaction": "/api/transaction"
  }
}
Item Description
authentication_policies List of the default and custom authentication policies.
channel_policies List of the default and custom channel policies.
connections List of the HTTP connection policies.
options List of global HTTP options that affect all connections.
settings_policies List of protocol-level settings (idle and session timeout). You can create multiple variations, and choose the appropriate one for each connection policy.
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.
403 Unauthorized The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
404 NotFound The requested object does not exist.
Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione