Chatta subito con l'assistenza
Chat con il supporto

Safeguard for Privileged Sessions On Demand Hosted - 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

Delete a plugin

Starting with version 6.4, you can also delete plugins using the REST API.

  1. Open a transaction.

    For more information, see Open a transaction.

  2. DELETE the https://<IP-address-of-SPS>/api/configuration/plugins/aa/<ID-of-the-plugin-to-delete> 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/plugins/aa/b080b1ba546232548bb1a9",
            "parent": "/api/configuration/plugins/aa"
        }
    }
  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
200 The plugin has been successfully deleted
400 SemanticError The plugin cannot be deleted, because there is reference to it in the configuration (For example, AA plugin delete fails because there is an AA Plugin Configuration for it).
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.
404 There is no plugin with the given key.

Check the integrity of a plugin

The authentication and authorization (AA) plugins used on SPS. To upload or update a plugin, see Upload a plugin.

URL
GET https://<IP-address-of-SPS>/api/plugin/integrity?key=<key-value-from-the-response-of-the-last-creation>&plugin_type=<type-of-the-plugin>&ops=zip_checksum&ops=zip_content&ops=unregistered
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: 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 retrieves the results of the integrity check.

curl --cookie cookies https://<IP-address-of-SPS>/api/plugin/integrity?key=<key-value-from-the-response-of-the-last-creation>&plugin_type=aa&ops=zip_checksum&ops=zip_content&ops=unregistered
  • To retrieve the <key-value-from-the-response-of-the-last-creation> of the plugin that you have uploaded earlier, enter the following command:

    curl https://<IP-address-of-SPS>/api/configuration/plugins/<plugin_type>

    This will display all plugins that you have uploaded earlier, that belong to the specified plugin type. The value will be the value of the key parameter of the response.

  • The following plugin_type values are available:

    • Authentication and authorization: aa

    • Configuration synchronization: configuration_sync

    • Credential Store: credentialstore

    • Signing CA: signingca

Response

The following is a sample response received when querying the results of the integrity check.

For details of the meta object, see Message format.

{ 
  "body": {
    "zip_checksum": {
      "verdict": "passed",
      "reason": "Plugin .zip checksums match"
    },
    "zip_content": {
      "verdict": "passed",
      "reason": "The plugin runtime files are the same since you have uploaded the plugin .zip"
	},
    "unregistered":	{
      "verdict": "unavailable",
      "reason": "Cannot find checker. Make sure that you use an existing checker: unregistered"
    }
  }
}
Element Type Description
body Top level element (string) Contains the results of the response.
zip_checksum string The checksum of the uploaded .zip file.
verdict string The verdict of the integrity check.
reason string The reason of the integrity check verdict.
zip_content string The content of the .zip file.
verdict string The verdict of the integrity check.
reason string The reason of the integrity check verdict.
unregistered string Whether SPS was joined to Starling for online checksum.
verdict string The verdict of the integrity check.
reason string The reason of the integrity check verdict.
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 MissingMandatoryParameter One of the following keys is missing: key, plugin_type, ops.
400 InvalidFormat The key is not valid plugin key.
404 MissingPlugin The plugin is not found in the configuration.

Authentication and authorization plugins

The authentication and authorization (AA) plugins used on SPS. To upload or update a plugin, see Upload a plugin.

URL
GET https://<IP-address-of-SPS>/api/configuration/plugins/aa
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: 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 queries the list of AA plugins used on SPS.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/plugins/aa

The following command retrieves the properties of a specific plugin.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/plugins/aa/<plugin-id>
Response

The following is a sample response received when querying the list of AAA plugins used on SPS.

For details of the meta object, see Message format.

{
  "items": [
    {
      "key": "2080160955734bb2a1ddf9",
      "meta": {
        "href": "/api/configuration/plugins/aa/2080160955734bb2a1ddf9"
      }
    }
  ],
  "meta": {
    "first": "/api/configuration/plugins/aa",
    "href": "/api/configuration/plugins/aa",
    "last": "/api/configuration/plugins/ticketing",
    "next": "/api/configuration/plugins/credentialstore",
    "parent": "/api/configuration/plugins",
    "previous": null,
    "transaction": "/api/transaction"
  }
}

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

{
  "body": {
    "api": "1.0",
    "description": "test1",
    "name": "AAPluginExample",
    "version": "1.1",
    "path": "/opt/scb/var/plugins/customgwauthplugin",
    "scb_max_version": "",
    "scb_min_version": "",
    "default_configuration": "",
    "entry_point": null,
    "sha256sum": "c4bb901de6b2274dcb94f1eec429fd0f3565ac792a856b07b8895e56ca2d8f42"
  },
  "key": "2080160955734bb2a1ddf9",
  "meta": {
    "first": "/api/configuration/plugins/aa/2080160955734bb2a1ddf9",
    "href": "/api/configuration/plugins/aa/2080160955734bb2a1ddf9",
    "last": "/api/configuration/plugins/aa/2080160955734bb2a1ddf9",
    "next": null,
    "parent": "/api/configuration/plugins/aa",
    "previous": null,
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the plugin.
body Top level element (string) Contains the properties of the plugin.
api string The API version of the plugin.
description string The description of the plugin. This description is also displayed on the SPS web interface.
default_configuration string The default configuration of the plugin (an INI file as a string). For details, see the documentation of the particular plugin.
entry_point string The entry point of the plugin, for example, main.py
name string The name of the plugin. This name is also displayed on the SPS web interface. It cannot contain whitespace.
path string The path where the plugin is stored on SPS.
scb_max_version string The version number of the latest SPS release that is compatible with the plugin.
scb_min_version string The version number of the earliest SPS release that is compatible with the plugin.
sha256sum string The SHA-256 checksum of the plugin.
version string The version number of the plugin.

To configure a particular instance of a plugin, use the /api/coniguration/policies/aa_plugin_instances/<key-of-the-plugin-instance> 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.
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.

Configuring Authentication and Authorization plugin instances

You can configure instances of Authentication and Authorization (AA) plugins to use in your Connection Policies. To configure an instance of a plugin you must first upload the plugin to SPS. To upload or update a plugin, see Upload a plugin.

URL
GET https://<IP-address-of-SPS>/api/configuration/policies/aa_plugin_instances
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: 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 queries the list of AA plugin instances available on SPS.

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

The following command retrieves the properties of a specific instance.

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

The following is a sample response received when querying the list of AA plugins used on SPS.

For details of the meta object, see Message format.

{
  "items": [
    {
        "name": "new_plugin_instance",
        "configuration": "test configuration",
        "plugin": "8876228625d67aa91e2253"
    }
  ],
  "meta": {
    "first": "/api/configuration/policies/aa_plugin_instances",
    "href": "/api/configuration/policies/aa_plugin_instances",
    "last": "/api/configuration/policies/usermapping_policies",
    "next": "/api/configuration/policies/analytics",
    "parent": "/api/configuration/policies",
    "previous": null,
    "remaining_seconds": 600,
    "transaction": "/api/transaction"
  }
}

When retrieving the endpoint of a specific plugin instance, the response is the following.

{
    "body": {
        "configuration": "[starling]\n# ..... disable_echo=yes\n",
        "name": "Demo_starling_plugin",
        "plugin": {
            "key": "8876228625d67aa91e2253",
            "meta": {
                "href": "/api/configuration/plugins/aa/8876228625d67aa91e2253"
            }
        }
    },
    "key": "8114402005d67adbeb38b6",
    "meta": {
        "first": "/api/configuration/policies/aa_plugin_instances/8114402005d67adbeb38b6",
        "href": "/api/configuration/policies/aa_plugin_instances/8114402005d67adbeb38b6",
        "last": "/api/configuration/policies/aa_plugin_instances/8114402005d67adbeb38b6",
        "next": null,
        "parent": "/api/configuration/policies/aa_plugin_instances",
        "previous": null,
        "remaining_seconds": 600,
        "transaction": "/api/transaction"
    }
}
Element Type Description
key string Top level element, contains the ID of the plugin instance.
body Top level element (string) Contains the properties of the plugin instance.
configuration string The configuration of the plugin instance (an INI file as a string). For details, see the documentation of the particular plugin.
name string The name of the plugin instance. This field can contain only letters (a-z, A-Z), numbers (0-9) and the underscore (_) character, and must begin with a letter.
plugin JSON object

Contains the details of the plugin object that this instance refers to: the ID of the plugin and its endpoint, for example,

"plugin": {
    "key": "8876228625d67aa91e2253",
    "meta": {
        "href": "/api/configuration/plugins/aa/8876228625d67aa91e2253"
    }
}
Create a new plugin instance

To create a new instance of a plugin, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Create the JSON object of the plugin instance.

    POST the JSON object to the https://<IP-address-of-SPS>/api/configuration/policies/aa_plugin_instances endpoint. You can find a detailed description of the available parameters listed in Configuring Authentication and Authorization plugin instances.

  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
400 SemanticError The configuration of the instance is invalid. Check the error key in the response for details.
Modify a plugin instance

To modify an instance of a plugin, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Modify the JSON object of the policy.

    PUT the modified JSON object to the https://<IP-address-of-SPS>/api/configuration/policies/aa_plugin_instances/<key-of-the-instance> endpoint.

  3. Commit your changes.

    For more information, see Commit a transaction.

Delete a plugin instance

To delete an instance of a plugin, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Remove any references to the plugin instance from your Connection Policies. You cannot delete a plugin instance that other parts of the configuration actively use.

  3. Delete the endpoint of the plugin instance.

    DELETE the https://<IP-address-of-SPS>/api/configuration/policies/aa_plugin_instances/<key-of-the-instance> endpoint.

  4. Commit your changes.

    For more information, see Commit a transaction.

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione