Chat now with support
Chat with Support

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

Introduction Using the Safeguard for Privileged Sessions REST API Basic settings User management and access control Managing Safeguard for Privileged Sessions General connection settings HTTP connections Citrix ICA connections RDP connections SSH connections Telnet connections VNC connections Search, download, and index sessions Reporting Advanced authentication and authorization Completing the Welcome Wizard using REST Enable and configure analytics using REST About us Third-party contributions

Real-time content monitoring with Content Policies

You can monitor the traffic of certain connections in real time, and execute various actions if a certain pattern (for example, a particular command or text) appears in the command line or on the screen, or if a window with a particular title appears in a graphical protocol. Since content-monitoring is performed real-time, Safeguard for Privileged Sessions can prevent harmful commands from being executed on your servers. Safeguard for Privileged Sessions can also detect numbers that might be credit card numbers. The patterns to find can be defined as regular expressions. In case of ICA, RDP, and VNC connections, Safeguard for Privileged Sessions can detect window title content.

The following actions can be performed:

  • Log the event in the system logs.

  • Immediately terminate the connection.

  • Send an e-mail or SNMP alerts about the event.

  • Store the event in the connection database of Safeguard for Privileged Sessions.

Safeguard for Privileged Sessions currently supports content monitoring in SSH session-shell connections, Telnet connections, RDP and Citrix ICA Drawing channels, and in VNC connections.

NOTE:

Command, credit card and window detection algorithms use heuristics. In certain (rare) situations, they might not match the configured content. In such cases, contact our Support Team to help analyze the problem.

Real-time content monitoring in graphical protocols is not supported for Arabic and CJK languages.

To list the available Content policies, use the following command.

curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/content_policies

The following sections detail the properties of Content policy objects.

URL
GET https:<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/content_policies/<object-id>
Headers
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).

Sample request

The following command lists the properties of a specific Content policy object.

curl --cookie cookies -https:<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/content_policies/<object-id>
Response

The following is a sample response received, showing the properties of Content policy objects. For details of the meta object, see Introduction.

{
  "body": {
    "name": "example-content-policy-window-title",
    "rules": [
      {
        "actions": {
          "log": true,
          "notify": true,
          "store_in_connection_database": true,
          "terminate": false
        },
        "event": {
          "ignore": [],
          "match": [
            "mmc.exe"
          ],
          "selection": "window_title"
        },
        "gateway_groups": [],
        "remote_groups": []
      }
    ]
  }
}
Element Type Description
name string Top level element, the name of the object. This name is also displayed on the Safeguard for Privileged Sessions web interface. It cannot contain whitespace.
rules JSON object Top level element, contains the configuration properties of the object.
actions JSON object The list of actions to perform when the Content policy matches the analyzed traffic. All actions are boolean values (true or false)
event JSON object Specifies the event that triggers an action.
gateway_groups list

To apply the Content policy only for users belonging to specific groups, list those groups in the gateway_groups or remote_groups fields. If the gateway_groups or remote_groups field is set, the content policy is applied only to connections of these usergroups.

For example:

"gateway_groups": ["group1", "group2"],
remote_groups list

To apply the Content policy only for users belonging to specific groups, list those groups in the gateway_groups or remote_groups fields. If the gateway_groups or remote_groups field is set, the content policy is applied only to connections of these usergroups.

For example:

"remote_groups": ["group1", "group3"],
Element Type Description
actions JSON object The list of actions to perform when the Content policy matches the analyzed traffic. All actions are boolean values (true or false)
log boolean

Log the event in the system logs. Possible values: true or false

terminate boolean

Immediately terminate the connection. Possible values: true or false

notify boolean

Send an e-mail or SNMP alerts about the event. Possible values: true or false

store_in_connection_database boolean

Store the event in the connection database of Safeguard for Privileged Sessions. Possible values: true or false

Element Type Description
event JSON object Specifies the event that triggers an action.
ignore list

A list of strings or regular expressions. Safeguard for Privileged Sessions will perform an action if the match expression is found in the connection, unless it is listed in the ignore list. For example:

"ignore": [
"mmc.exe",
"cmd.exe"
                            
  • Use Perl Compatible Regular Expressions (PCRE).

  • The following characters must be escaped using a backslash character: '(single-quote). For example, instead of .*' use .*\'

  • Safeguard for Privileged Sessions uses substring search to find the expression in the content. That is, Safeguard for Privileged Sessions finds the expression even if there is more content before or after the matching part. For example, the conf pattern will match the following texts: conf, configure, reconfigure, arcconf, and so on.

  • Using complicated regular expressions or using many regular expressions will affect the performance of Safeguard for Privileged Sessions.

  • If the multiple expressions are set, Safeguard for Privileged Sessions processes them one after the other, and stops processing the content if the first match is found, even if other expressions would also match the content. Therefore, when using multiple expressions, start with the most specific one, and add general expressions afterward.

match list

A list of strings or regular expressions. Safeguard for Privileged Sessions will perform an action if the match expression is found in the connection, unless it is listed in the ignore list. For example:

"match": [
"mmc.exe",
"cmd.exe"
                            
  • Use Perl Compatible Regular Expressions (PCRE).

  • The following characters must be escaped using a backslash character: '(single-quote). For example, instead of .*' use .*\'

  • Safeguard for Privileged Sessions uses substring search to find the expression in the content. That is, Safeguard for Privileged Sessions finds the expression even if there is more content before or after the matching part. For example, the conf pattern will match the following texts: conf, configure, reconfigure, arcconf, and so on.

  • Using complicated regular expressions or using many regular expressions will affect the performance of Safeguard for Privileged Sessions.

  • If the multiple expressions are set, Safeguard for Privileged Sessions processes them one after the other, and stops processing the content if the first match is found, even if other expressions would also match the content. Therefore, when using multiple expressions, start with the most specific one, and add general expressions afterward.

selection string

The type of event that you want to monitor.

  • command: The commands executed in the session-shell channel of SSH connections, or in Telnet connections.

    Caution:

    During indexing, if a separate certificate is used to encrypt the upstream traffic, command detection works only if the upstream key is accessible on the machine running the indexer.

  • screen_content: Every text that appears on the screen. For example, every text that is displayed in the terminal of SSH or Telnet connections. This includes the executed commands as well, unless echoing is turned off for the terminal.

  • creditcard: Process every text that appears on the screen and attempt to detect credit card numbers in SSH or Telnet connections. Safeguard for Privileged Sessions performs an action if the number of detected credit card numbers exceeds the value set as Permitted number of credit card numbers.

    Credit card number detection is based on the Luhn algorithm and lists of known credit card number prefixes.

  • window_title: Text appearing as window titles in case of RDP, Citrix ICA, and VNC connections. Only Windows Classic Themes are supported. Themes with rounded corners, or Windows Aero themes are not supported.

For example:

"selection": "window_title"
Add a content policy

To add a content policy, you have to:

  1. Open a transaction.

    For details, see Open a transaction.

  2. Create the JSON object for the new content policy.

    POST the JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/content_policies endpoint. You can find a detailed description of the available parameters listed in Real-time content monitoring with Content Policies.

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

    {
      "key": "1e089e2a-76b4-4079-94e3-c83ebc74dc2e",
      "meta": {
        "href": "/api/configuration/policies/content_policies/1e089e2a-76b4-4079-94e3-c83ebc74dc2e",
        "parent": "/api/configuration/policies/content_policies",
        "transaction": "/api/transaction"
      }
    }
  3. Commit your changes.

    For details, see Commit a transaction.

Modify a content policy

To modify a content policy, you have to:

  1. Open a transaction.

    For details, see Open a transaction.

  2. Modify the JSON object of the content policy.

    PUT the modified JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/content_policies/<policy-key> endpoint. You can find a detailed description of the available parameters listed in Real-time content monitoring with Content Policies.

  3. Commit your changes.

    For details, 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 Using the Safeguard for Privileged Sessions REST API.

Code Description Notes
201 Created The new resource was successfully created.
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.

LDAP servers

Safeguard for Privileged Sessions can authenticate the users of the controlled SSH or RDP connections to LDAP databases.

URL
GET https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/ldap_servers
Headers
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).

Sample request

The following command lists the available LDAP server configurations.

curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/ldap_servers

The following command retrieves the properties of a specific LDAP server.

curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/ldap_servers/<object-id>
Response

The following is a sample response received when listing LDAP servers. For details of the meta object, see Introduction.

{
  "items": [
    {
      "key": "3548834825727acc530407",
      "meta": {
        "href": "/api/configuration/policies/ldap_servers/3548834825727acc530407"
      }
    }
  ],
  "meta": {
    "first": "/api/configuration/policies/audit_policies",
    "href": "/api/configuration/policies/ldap_servers",
    "last": "/api/configuration/policies/usermapping_policies",
    "next": "/api/configuration/policies/signing_cas",
    "parent": "/api/configuration/policies",
    "previous": "/api/configuration/policies/indexing",
    "transaction": "/api/transaction"
  }
}

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

{
  "body": {
    "user_base_dn": "<basedn>",
    "group_base_dn": "<basedn>",
    "bind_dn": "binddn",
    "bind_password": {
      "key": "f09f94f5-a2c9-4cc5-96ab-2ef1855d12d1",
      "meta": {
        "href": "/api/configuration/passwords/f09f94f5-a2c9-4cc5-96ab-2ef1855d12d1"
      }
    },
    "encryption": {
      "selection": "disabled"
    },
    "generated_publickey_attribute": null,
    "generated_x509_attribute": null,
    "name": "API_LDAP",
    "nested_groups": true,
    "publickey_attribute": "sshPublicKey",
    "schema": {
      "selection": "ad"
    },
    "servers": [
      {
        "host": {
          "selection": "ip",
          "value": "10.20.30.40"
        },
        "port": 389
      }
    ],
    "x509_attribute": "userCertificate"
  },
  "key": "3548834825727acc530407",
  "meta": {
    "first": "/api/configuration/policies/ldap_servers/3548834825727acc530407",
    "href": "/api/configuration/policies/ldap_servers/3548834825727acc530407",
    "last": "/api/configuration/policies/ldap_servers/17610964665734c0598c669",
    "next": "/api/configuration/policies/ldap_servers/17610964665734c0598c669",
    "parent": "/api/configuration/policies/ldap_servers",
    "previous": null,
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the LDAP server configuration.
body Top level element (string) Contains the properties of the LDAP server.
user_base_dn string

Name of the DN to be used as the base of queries regarding users.

NOTE:

You must fill in this field. It is OK to use the same value for user_base_dn and group_base_dn.

However, note that specifying a sufficiently narrow base for the LDAP subtrees where users and groups are stored can speed up LDAP operations.

group_base_dn string

Name of the DN to be used as the base of queries regarding groups.

NOTE:

You must fill in this field. It is OK to use the same value for user_base_dn and group_base_dn.

However, note that specifying a sufficiently narrow base for the LDAP subtrees where users and groups are stored can speed up LDAP operations.

bind_dn string The Distinguished Name that Safeguard for Privileged Sessions should use to bind to the LDAP directory.
bind_password string

References the password Safeguard for Privileged Sessions uses to authenticate on the server. 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).

encryption Top level item Configuration settings for encrypting the communication between Safeguard for Privileged Sessions and the LDAP server.
generated_publickey_attribute string

Set this element to null if you use passwords to authenticate.

Configure this element if you want Safeguard for Privileged Sessions to generate server-side encryption keys on-the-fly, and store them in a separate attribute on the LDAP server.

generated_x509_attribute string

Set this element to null if you use passwords to authenticate.

Configure this element if you want Safeguard for Privileged Sessions to generate server-side certificates on-the-fly, and store them in a separate attribute on the LDAP server.

name string Top level element, the name of the object. This name is also displayed on the Safeguard for Privileged Sessions web interface. It cannot contain whitespace.
nested_groups boolean

Set to true to use nested groups when querying the LDAP server.

Nested groups are mostly useful when authenticating the users to Microsoft Active Directory, but can slow down the query and cause the connection to timeout if the LDAP tree is very large.

publickey_attribute string

Set this element to null if you use passwords to authenticate.

The name of the LDAP attribute that stores the public keys of the users.

schema Top level item Contains the configuration settings for the AD schema.
member_uid_attribute string

Must be used if the selection element is set to posix.

Attribute name of the POSIX group membership.

selection string

Configures which LDAP schema to use: AD or POSIX. Possible values are:

  • ad

    Microsoft Active Directory server.

  • posix

    Server uses the POSIX LDAP scheme.

    Must be used with the member_uid_attribute, unique_member_attribute and username_attribute elements.

unique_member_attribute string

Must be used if the selection element is set to posix.

Attribute name of the GroupOfUniqueMemberships membership.

username_attribute string

Must be used if the selection element is set to posix.

Attribute name of the username (user ID).

servers Top level list Contains the addresses and ports of the LDAP servers.
x509_attribute string

Set this element to null if you use passwords to authenticate.

The name of the LDAP attribute that stores the certificates of the users.

Elements of encryption Type Description
client_authentication Top level item

Must be used with the selection child element.

Configures the X.509 certificate Safeguard for Privileged Sessions uses to authenticate on the LDAP server.

enabled boolean

Must be used with the client-authentication parent element.

Set to true if the LDAP server requires mutual authentication.

x509_identity string

Must be used if the enabled element is set to true.

References the identifier of the X.509 certificate stored on Safeguard for Privileged Sessions. You can configure X.509 certificates at the /api/configuration/x509/ endpoint.

To modify or add an X.509 host certificate, use the value of the returned key as the value of the x509_identity element, and remove any child elements (including the key).

selection string

Defines the type of encryption Safeguard for Privileged Sessions uses to communicate with the LDAP server. Possible values are:

  • disabled

    The communication is not encrypted.

  • ssl

    TLS/SSL encryption. To use a TLS-encrypted with certificate verification to connect to the LDAP server, use the full domain name (for example ldap.example.com) as the server address, otherwise the certificate verification might fail. The name of the LDAP server must appear in the Common Name of the certificate.

    TLS-encrypted connection to Microsoft Active Directory is supported only on Windows 2003 Server and newer platforms. Windows 2000 Server is not supported.

  • starttls

    Opportunistic TLS.

server_certificate_check Top level item

Must be used with the selection child element.

Configuration settings for verifying the LDAP server's certificate.

enabled boolean

Must be used with the server_certificate_check parent element.

Set to true to verify the LDAP server's certificate using the certificate of a Certificate Authority (CA).

server_certificate_ca string

Must be used if the enabled element is set to true.

The certificate of the CA.

Elements of servers Type Description
host Top level item Contains the address of the LDAP server.
selection string

Defines the address type (IP or domain name). Possible values are:

  • fqdn

    The LDAP server address is provided as a fully qualified domain name.

  • ip

    The LDAP server address is provided as an IP address.

value string The address of the LDAP server.
port int The port of the LDAP server.
Examples:

Configure a POSIX server without communication encryption.

{
  "user_base_dn": "<basedn>",
  "group_base_dn": "<basedn>",
  "bind_dn": "<binddn>",
  "bind_password": "<bind-password>",
  "encryption": {
    "client_authentication": {
      "enabled": false
    },
    "selection": "ssl",
    "server_certificate_check": {
      "enabled": false
    }
  },
  "generated_publickey_attribute": null,
  "generated_x509_attribute": null,
  "name": "<name-of-ldap-policy>",
  "nested_groups": true,
  "publickey_attribute": "<sshPublicKey>",
  "schema": {
    "member_uid_attribute": "<memberUid>",
    "selection": "posix",
    "unique_member_attribute": "<uniqueMember>",
    "username_attribute": "<uid>"
  },
  "servers": [
    {
      "host": {
        "selection": "fqdn",
        "value": "<server-name>"
      },
      "port": <server-port>
    }
  ],
  "x509_attribute": "<userCertificate>"
}

Configure a Microsoft Active Directory server with mutual authentication, and the verification of the server's X.509 certificate.

{
  "user_base_dn": "<basedn>",
  "group_base_dn": "<basedn>",
  "bind_dn": "<binddn>",
  "bind_password": "<key-of-password>",
  "encryption": {
    "client_authentication": {
      "enabled": true,
      "x509_identity": "<key-of-cert>"
    },
    "selection": "starttls",
    "server_certificate_check": {
      "enabled": true,
      "server_certificate_ca": "<ca-cert>"
    }
  },
  "generated_publickey_attribute": null,
  "generated_x509_attribute": null,
  "name": "<name-of-ldap-policy>",
  "nested_groups": true,
  "publickey_attribute": "<sshPublicKey>",
  "schema": {
    "selection": "ad"
  },
  "servers": [
    {
      "host": {
        "selection": "ip",
        "value": "<server-ip>"
      },
      "port": <server-port>
    }
  ],
  "x509_attribute": "<userCertificate>"
}
CA certificates

CA certificates must not contain any metadata. Safeguard for Privileged Sessions uses only the key part of the certificate.

To use a certificate with the Safeguard for Privileged Sessions API, remove all metadata, and substitute line breaks with \n.

The following is an example certificate, as used on the Safeguard for Privileged Sessions web interface:

-----BEGIN CERTIFICATE-----
MIIDnDCCAoQCCQDc536Ob5tPQTANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMC
Q0ExEDAOBgNVBAgTB09udGFyaW8xEDAOBgNVBAcTB1Rvcm9udG8xEDAOBgNVBAoT
B0JhbGFiaXQxFjAUBgNVBAsTDURvY3VtZW50YXRpb24xEDAOBgNVBAMTB2JhbGFi
aXQxIDAeBgkqhkiG9w0BCQEWEWNhdGFpbEBiYWxhYml0Lmh1MB4XDTE2MDQyMjE2
MDAyNloXDTE3MDQyMjE2MDAyNlowgY8xCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP
bnRhcmlvMRAwDgYDVQQHEwdUb3JvbnRvMRAwDgYDVQQKEwdCYWxhYml0MRYwFAYD
VQQLEw1Eb2N1bWVudGF0aW9uMRAwDgYDVQQDEwdiYWxhYml0MSAwHgYJKoZIhvcN
AQkBFhFjYXRhaWxAYmFsYWJpdC5odTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAOGa9I2jmVlVdVWEI/Wy7ahTeyaIjK52FQUXqxG8okOSD+nV74ZFUuiS
59X+2Ow1aDqVGrDMgPNhSVpYXUvDUAUOILJW4rAIoxDY6vDU9/4v9dDiQfEPlauw
0qNRjPS1MLzjSOQDSKqPkdivkS6HKZeX3+TFq3OxO+vIrF9zFfp9T+eDG2oSobPc
3mV2zkvtD61CXzbezAVdArDl6WnysRyzxyH8WEhFwZepWxFD9Y5N1dzKody7Hncs
X5kVIv0+Z6bBHfg/7wHWysJdwNuLr0ByTOvPM6WdA83k3Fy2gYNk7Rc0BbRFbQTX
hJVfUzSUWHVhFQtAb4diKU5voqepfNMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
R5DIwOHsEKoGkiI3cHC2VMnxP2rRhpTneh6El+DFnQPdjrXa+tnqV4TdnNaD+FvP
AB1kqbmC4hJAsjMLU2b1ne6m+SLmzhRuMxcA6x+fnYvcQT57IbRdq2E/4oJGeyuy
0jQE+nmoVD3lDytIOxCfQvZhl1tcbBE5hp5USme4PmNhY6QfUlgjsFjPfoVG7XDB
uNaUoWS6RvZPmL5IuvF9tqe96ES6DTjC8rBfQYvSoVNjjPnUMx0C8xstRSEG7oJc
N5+4ImYnFNxSG20hZpFy0OFDf2g7Fx+W50/NtXamUF1Sf8WlPZc03oVl1/Fzo7mt
qYyyD1ld89OUEYZ+aJQd/A==
-----END CERTIFICATE-----

The same certificate, as accepted by the Safeguard for Privileged Sessions API:

"certificate": "-----BEGIN CERTIFICATE-----\nMIIDnDCCAoQCCQDc536Ob5tPQTANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMC\nQ0ExEDAOBgNVBAgTB09udGFyaW8xEDAOBgNVBAcTB1Rvcm9udG8xEDAOBgNVBAoT\nB0JhbGFiaXQxFjAUBgNVBAsTDURvY3VtZW50YXRpb24xEDAOBgNVBAMTB2JhbGFi\naXQxIDAeBgkqhkiG9w0BCQEWEWNhdGFpbEBiYWxhYml0Lmh1MB4XDTE2MDQyMjE2\nMDAyNloXDTE3MDQyMjE2MDAyNlowgY8xCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdP\nbnRhcmlvMRAwDgYDVQQHEwdUb3JvbnRvMRAwDgYDVQQKEwdCYWxhYml0MRYwFAYD\nVQQLEw1Eb2N1bWVudGF0aW9uMRAwDgYDVQQDEwdiYWxhYml0MSAwHgYJKoZIhvcN\nAQkBFhFjYXRhaWxAYmFsYWJpdC5odTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\nAQoCggEBAOGa9I2jmVlVdVWEI/Wy7ahTeyaIjK52FQUXqxG8okOSD+nV74ZFUuiS\n59X+2Ow1aDqVGrDMgPNhSVpYXUvDUAUOILJW4rAIoxDY6vDU9/4v9dDiQfEPlauw\n0qNRjPS1MLzjSOQDSKqPkdivkS6HKZeX3+TFq3OxO+vIrF9zFfp9T+eDG2oSobPc\n3mV2zkvtD61CXzbezAVdArDl6WnysRyzxyH8WEhFwZepWxFD9Y5N1dzKody7Hncs\nX5kVIv0+Z6bBHfg/7wHWysJdwNuLr0ByTOvPM6WdA83k3Fy2gYNk7Rc0BbRFbQTX\nhJVfUzSUWHVhFQtAb4diKU5voqepfNMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\nR5DIwOHsEKoGkiI3cHC2VMnxP2rRhpTneh6El+DFnQPdjrXa+tnqV4TdnNaD+FvP\nAB1kqbmC4hJAsjMLU2b1ne6m+SLmzhRuMxcA6x+fnYvcQT57IbRdq2E/4oJGeyuy\n0jQE+nmoVD3lDytIOxCfQvZhl1tcbBE5hp5USme4PmNhY6QfUlgjsFjPfoVG7XDB\nuNaUoWS6RvZPmL5IuvF9tqe96ES6DTjC8rBfQYvSoVNjjPnUMx0C8xstRSEG7oJc\nN5+4ImYnFNxSG20hZpFy0OFDf2g7Fx+W50/NtXamUF1Sf8WlPZc03oVl1/Fzo7mt\nqYyyD1ld89OUEYZ+aJQd/A==\n-----END CERTIFICATE-----\n"
Add an LDAP server

To add an LDAP server, you have to:

  1. Open a transaction.

    For details, see Open a transaction.

  2. Create the JSON object for the new LDAP server.

    POST the JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/ldap_servers endpoint. You can find a detailed description of the available parameters listed in LDAP servers.

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

    {
      "key": "f9f9783c-1e28-4ce8-a650-fc4c7311ac52",
      "meta": {
        "href": "/api/configuration/policies/ldap_servers/f9f9783c-1e28-4ce8-a650-fc4c7311ac52",
        "parent": "/api/configuration/policies/ldap_servers",
        "transaction": "/api/transaction"
      }
    }
  3. Commit your changes.

    For details, see Commit a transaction.

Modify an LDAP server

To modify the configuration of an LDAP server, you have to:

  1. Open a transaction.

    For details, see Open a transaction.

  2. Modify the JSON object of the LDAP server.

    PUT the modified JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/ldap_servers/<key-of-the-object> endpoint. You can find a detailed description of the available parameters listed in LDAP servers.

  3. Commit your changes.

    For details, 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 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.

Signing CA policies

Safeguard for Privileged Sessions can generate the server-side certificates on the fly. This technique is used for example in SSL-encrypted RDP sessions, RDP sessions that use Network Level Authentication (CredSSP), or SSH connections that use X.509-based authentication.

URL
GET https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/signing_cas
Headers
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).

Sample request

The following command lists the configured signing Certificate Authorities (CAs).

curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/signing_cas

The following command retrieves the properties of a specific policy.

curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/signing_cas/<object-id>
Response

The following is a sample response received when listing signing CAs. For details of the meta object, see Introduction.

{
  "items": [
    {
      "key": "991699365727ac4eb4606",
      "meta": {
        "href": "/api/configuration/policies/signing_cas/991699365727ac4eb4606"
      }
    }
  ],
  "meta": {
    "first": "/api/configuration/policies/audit_policies",
    "href": "/api/configuration/policies/signing_cas",
    "last": "/api/configuration/policies/usermapping_policies",
    "next": "/api/configuration/policies/ticketing_policies",
    "parent": "/api/configuration/policies",
    "previous": "/api/configuration/policies/ldap_servers",
    "transaction": "/api/transaction"
  }
}

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

{
  "body": {
    "ca": {
      "key": "55b2419c-f94f-4836-9c0b-bc3796b6f556",
      "meta": {
        "href": "/api/configuration/x509/55b2419c-f94f-4836-9c0b-bc3796b6f556"
      }
    },
    "name": "API_CA"
  },
  "key": "991699365727ac4eb4606",
  "meta": {
    "first": "/api/configuration/policies/signing_cas/991699365727ac4eb4606",
    "href": "/api/configuration/policies/signing_cas/991699365727ac4eb4606",
    "last": "/api/configuration/policies/signing_cas/991699365727ac4eb4606",
    "next": null,
    "parent": "/api/configuration/policies/signing_cas",
    "previous": null,
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the signing CA.
body Top level element (string) Contains the properties of the signing CA.
ca string

References the identifier of the signing CA's X.509 certificate. You can configure certificates at the /api/configuration/x509/ endpoint.

To modify or add an X.509 certificate, use the value of the returned key as the value of the x509_identity element, and remove any child elements (including the key).

name string The name of the signing CA. This name is also displayed on the Safeguard for Privileged Sessions web interface. It cannot contain whitespace.
Add a signing CA

To add a signing CA, you have to:

  1. Open a transaction.

    For details, see Open a transaction.

  2. Create a signing CA

    Have the value of the key element of a valid X.509 CA certificate stored on Safeguard for Privileged Sessions.

  3. Create the JSON object for the new signing CA.

    Use the X.509 certificate's key as the value of the ca element for the signing CA. You can find a detailed description of the available parameters listed in Signing CA policies.

    POST the JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/signing_cas endpoint. If the POST request is successful, the response includes the key of the new signing CA. For example:

    {
      "key": "325768b5-5b85-467d-8e30-e2b57d0869c8",
      "meta": {
        "href": "/api/configuration/policies/signing_cas/325768b5-5b85-467d-8e30-e2b57d0869c8",
        "parent": "/api/configuration/policies/signing_cas",
        "transaction": "/api/transaction"
      }
    }
  4. Commit your changes.

    For details, see Commit a transaction.

Modify a signing CA

To modify a signing CA, you have to:

  1. Open a transaction.

    For details, see Open a transaction.

  2. Modify the JSON object of the signing CA.

    Use the X.509 certificate's key as the value of the ca element for the signing CA. You can find a detailed description of the available parameters listed in Signing CA policies.

    PUT the modified JSON object to the https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/signing_cas/<key-of-the-object> endpoint.

  3. Commit your changes.

    For details, 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 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

Bad Request

"message": "Signing certificate is not CA;

The referenced certificate is not a valid CA certificate.
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.

Time policy

The time policy determines the timeframe when the users are permitted to access a particular channel. To list the available Time policies, use the following command.

curl --cookie cookies https://<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/time_policies

The following sections detail the properties of Time policy objects.

URL
GET https:<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/time_policies/<object-id>
Headers
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).

Sample request

The following command lists the properties of a specific Time policy object.

curl --cookie cookies -https:<IP-address-of-Safeguard for Privileged Sessions>/api/configuration/policies/time_policies/<object-id>
Response

The following is a sample response received, showing the properties of Content policy objects. For details of the meta object, see Introduction.

{
  "body": {
    "Fri": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "Mon": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "Sat": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "Sun": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "Thu": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "Tue": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "Wed": [
      [
        "0:00",
        "23:59"
      ]
    ],
    "name": "7x24"
}
Element Type Description
name string Top level element, the name of the object. This name is also displayed on the Safeguard for Privileged Sessions web interface. It cannot contain whitespace.
Fri list

A list of intervals for the day when the users are allowed to access the connection. Use the hh:mm format.

If the users are not allowed to access the connection for this day, use an empty list. For example:

"Sat": [],

To allow access for the whole day, use 0:00 for the starting time, and 23:59for the end. For example:

"Wed": [
  [
    "0:00",
    "23:59"
  ]
                            

You can list multiple intervals for a day, for example:

"Wed": [
  [
	"8:00",
	"18:00"
  ],
  [
	"19:00",
	"22:00"
  ]
                        
Sat list
Sun list
Thu list
Tue list
Wed list
Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating