DelineaSS
Delinea Secret Server and Platform is the fully featured Privileged Account Management (PAM) solution available both on premise and in the cloud. It empowers security and IT ops teams to secure and manage all types of privileged accounts and offers the fastest time to value of any PAM solution.
Authentication & Identity Management · Delinea Secret Server
Details
| ID | DelineaSS |
|---|---|
| Provider | Delinea |
| Category | Authentication & Identity Management |
| From Version | 6.5.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Supported Modules | Agentix XSIAM |
README
Secret Server and Platform is the fully featured Privileged Account Management (PAM) solution available both on premise and in the cloud. It empowers security and IT ops teams to secure and manage all types of privileged accounts and offers the fastest time to value of any PAM solution.
This integration was integrated and tested with version 5.0 of Delinea
Configure Delinea in Cortex
| Parameter | Description | Required |
|---|---|---|
| url | Server URL (e.g. https://example.net) | True |
| credentials | Username | True |
| insecure | Trust any certificate (not secure) | False |
| proxy | Use system proxy settings | False |
| isFetchCredentials | Fetches credentials | False |
| credentialobjects | List secret name for fetch credentials (separated by commas) | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
delinea-secret-password-get
Retrieved password from secret
Base Command
delinea-secret-password-get
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | ID secret | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Password | String | Retrieved password from secret |
Command Example
!delinea-secret-password-get secret_id=2
Context Example
{
"Delinea": {
"Secret": {
"Password": "1234567890"
}
}
}
delinea-secret-username-get
Retrieved username from secret
Base Command
delinea-secret-username-get
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | ID secret | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Username | String | Retrieved username from secret. |
Command Example
!delinea-secret-username-get secret_id=2
Context Example
{
"Delinea": {
"Secret": {
"Username": "w2\\w2"
}
}
}
delinea-secret-search-name
Search ID secret by field name
Base Command
delinea-secret-search-name
Input
| Argument Name | Description | Required |
|---|---|---|
| search_name | Search name secret. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Id | String | Retrieved list ID for find secret by field secret name |
Command Example
!delinea-secret-search-name search_name=xsoarSecret
Context Example
{
"Delinea": {
"Secret": {
"Id": [
5
]
}
}
}
delinea-secret-password-update
Update password for secret
Base Command
delinea-secret-password-update
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | ID secret for update password | Required |
| newpassword | Value new password for secret | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Newpassword | String | New password changed for secret |
Command Example
!delinea-secret-password-update secret_id=2 newpassword=12345
Context Example
{
"Delinea": {
"Secret": {
"Newpassword": "12345"
}
}
}
delinea-secret-checkout
Check Out a secret
Base Command
delinea-secret-checkout
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | ID secret for check out command | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Checkout | String | Return call command Check Out |
Command Example
!delinea-secret-checkout secret_id=2
Context Example
{
"Delinea": {
"Secret": {
"Checkout": {
"responseCodes":null
}
}
}
}
delinea-secret-checkin
Check In a secret
Base Command
delinea-secret-checkin
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | Secret ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Checkin | String | Secret object |
Command Example
!delinea-secret-checkin secret_id=13
Context Example
{
"Delinea": {
"Secret": {
"Checkin": {
"active": true,
"autoChangeEnabled": false,
"checkOutEnabled": true,
"checkedOut": false,
"createDate": "2020-12-15T09:13:49.487",
"daysUntilExpiration": null,
"doubleLockEnabled": false,
"extendedFields": null,
"folderId": 3,
"hidePassword": false,
"id": 13,
"inheritsPermissions": true,
"isOutOfSync": false,
"isRestricted": true,
"lastAccessed": null,
"lastHeartBeatStatus": "Pending",
"lastPasswordChangeAttempt": "0001-01-01T00:00:00",
"name": "secretT",
"outOfSyncReason": "",
"requiresApproval": false,
"requiresComment": false,
"responseCodes": null,
"secretTemplateId": 6003,
"secretTemplateName": "Windows Account",
"siteId": 1
}
}
}
}
delinea-folder-create
Create a new secret folder
Base Command
delinea-folder-create
Input
| Argument Name | Description | Required |
|---|---|---|
| foldername | Folder name | Required |
| foldertypeid | Folder type ID(1=< ID =< 3 | Required |
| parentfolderid | Parent folder ID | Required |
| inheritPermissions | Whether the folder should inherit permissions from its parent (default: true) | Optional |
| inheritSecretPolicy | Whether the folder should inherit the secret policy. Defaults to true unless creating a root folder. | Optional |
| secretPolicyId | Secret policy ID | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Folder.Create | Unknown | New object folder |
Command Example
!delinea-folder-create foldername="xsoarFolderTest" foldertypeid="1" parentfolderid="3"
Context Example
{
"Delinea": {
"Folder": {
"Create": {
"childFolders": null,
"folderName": "xsoarFolderTest",
"folderPath": "\\Personal Folders\\XSOAR integration\\xsoarFolderTest",
"folderTypeId": 1,
"id": 5,
"inheritPermissions": false,
"inheritSecretPolicy": false,
"parentFolderId": 3,
"secretPolicyId": -1,
"secretTemplates": null
}
}
}
}
delinea-folder-search
Search folder by name folder
Base Command
delinea-folder-search
Input
| Argument Name | Description | Required |
|---|---|---|
| foldername | Search name folder | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Folder.Id | String | Retrieved folder ID from search query |
Command Example
!delinea-folder-search foldername="xsoarFolderTest"
Context Example
{
"Delinea": {
"Folder": {
"Id": [
5
]
}
}
}
Command Example
!delinea-folder-delete folder_id="18"
Context Example
{
"Delinea": {
"Folder": {
"Delete": {
"id": 18,
"objectType": "Folder",
"responseCodes": []
}
}
}
}
delinea-secret-get
Get secret object by ID secret
Base Command
delinea-secret-get
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | ID for secret | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret | String | Secret object |
Command Example
!delinea-secret-get secret_id=2
Context Example
{
"Delinea": {
"Secret": {
"accessRequestWorkflowMapId": -1,
"active": true,
"allowOwnersUnrestrictedSshCommands": false,
"autoChangeEnabled": false,
"autoChangeNextPassword": "2$C$7vl8*SN@",
"checkOutChangePasswordEnabled": false,
"checkOutEnabled": true,
"checkOutIntervalMinutes": -1,
"checkOutMinutesRemaining": 30,
"checkOutUserDisplayName": "XSOAR integration",
"checkOutUserId": 3,
"checkedOut": true,
"doubleLockId": -1,
"enableInheritPermissions": true,
"enableInheritSecretPolicy": true,
"failedPasswordChangeAttempts": 0,
"folderId": 3,
"id": 2,
"isDoubleLock": false,
"isOutOfSync": false,
"isRestricted": true,
"items": [
{
"fieldDescription": "The Server or Location of the Windows Machine.",
"fieldId": 83,
"fieldName": "Machine",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": false,
"isPassword": false,
"itemId": 5,
"itemValue": "192.168.100.1",
"slug": "machine"
},
{
"fieldDescription": "The Username of the Windows User.",
"fieldId": 86,
"fieldName": "Username",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": false,
"isPassword": false,
"itemId": 6,
"itemValue": "w2\\w2",
"slug": "username"
},
{
"fieldDescription": "The password of the Windows User.",
"fieldId": 85,
"fieldName": "Password",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": false,
"isPassword": true,
"itemId": 7,
"itemValue": "1234567890",
"slug": "password"
},
{
"fieldDescription": "Any additional notes.",
"fieldId": 84,
"fieldName": "Notes",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": true,
"isPassword": false,
"itemId": 8,
"itemValue": "",
"slug": "notes"
}
],
"lastHeartBeatCheck": "0001-01-01T00:00:00",
"lastHeartBeatStatus": "Pending",
"lastPasswordChangeAttempt": "0001-01-01T00:00:00",
"launcherConnectAsSecretId": -1,
"name": "test-w2",
"outOfSyncReason": "",
"passwordTypeWebScriptId": -1,
"proxyEnabled": false,
"requiresApprovalForAccess": false,
"requiresComment": false,
"responseCodes": [],
"restrictSshCommands": false,
"secretPolicyId": -1,
"secretTemplateId": 6003,
"secretTemplateName": "Windows Account",
"sessionRecordingEnabled": false,
"siteId": 1
}
}
}
delinea-secret-search
Search secret ID by multiply params
Base Command
delinea-secret-search
Input
| Argument Name | Description | Required |
|---|---|---|
| filter.allowDoubleLocks | Whether to allow DoubleLocks as part of the search. True by default | Optional |
| filter.doNotCalculateTotal | Whether to return the total number of secrets matching the filters. False by default | Optional |
| filter.doubleLockId | Only include Secrets with this DoubleLock ID assigned in the search results | Optional |
| filter.extendedFields | Names of Secret Template fields to return. Only exposed fields can be returned. | Optional |
| filter.extendedTypeId | Return only secrets matching a certain extended type | Optional |
| filter.folderId | Return only secrets within a certain folder | Optional |
| filter.heartbeatStatus | Return only secrets with a certain heartbeat status | Optional |
| filter.includeActive | Whether to include active secrets in results (when excluded equals true) | Optional |
| filter.includeInactive | Whether to include inactive secrets in results | Optional |
| filter.includeRestricted | Whether to include restricted secrets in results | Optional |
| filter.isExactMatch | Whether to do an exact match of the search text or a partial match | Optional |
| filter.onlyRPCEnabled | Whether to only include secrets whose template has Remote Password Changing enabled | Optional |
| filter.onlySharedWithMe | When true only Secrets where you are not the owner and the Secret was shared explicitly with your user id will be returned. | Optional |
| filter.passwordTypeIds | Return only secrets matching certain password types | Optional |
| filter.permissionRequired | Specify whether to filter by List, View, Edit, or Owner permission. Default is List. (List = 1, View = 2, Edit = 3, Owner = 4 | Optional |
| filter.scope | Specify whether to search AllSecrets, Recent, or Favorites (All = 1, Recent = 2,Favorites = 3 | Optional |
| filter.searchField | Field to search | Optional |
| filter.searchFieldSlug | Field-slug to search. This will override SearchField. | Optional |
| filter.searchText | Search text | Optional |
| filter.secretTemplateId | Return only secrets matching a certain template | Optional |
| filter.siteId | Return only secrets within a certain site | Optional |
| skip | Number of records to skip before taking results | Optional |
| sortBy[0].direction | Sort direction | Optional |
| sortBy[0].name | Sort field name | Optional |
| sortBy[0].priority | Priority index. Sorts with lower values are executed earlier | Optional |
| take | Maximum number of records to include in results | Optional |
| filter.includeSubFolders | Whether to include secrets in subfolders of the specified folder | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Secret | String | Search secret object |
Command Example
!delinea-secret-search filter_searchfields="username" filter_searchtext="xsoar"
Context Example
{
"Delinea": {
"Secret": {
"Secret": [
5
]
}
}
}
delinea-folder-update
Update a single secret folder by ID
Base Command
delinea-folder-update
Input
| Argument Name | Description | Required |
|---|---|---|
| folderName | Folder name | Optional |
| folderTypeId | Folder type ID | Optional |
| id | Folder ID. Must match ID in path | Required |
| inheritPermissions | Whether the folder inherits permissions from its parent | Optional |
| inheritSecretPolicy | Whether the folder inherits the secret policy | Optional |
| parentFolderId | ID parent folder | Optional |
| secretPolicyId | Secret Policy ID | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Folder.Update | String | Retrieved return operation update folder |
Command Example
!delinea-folder-update id=4 foldername="SafexsoarTest"
Context Example
{
"Delinea": {
"Folder": {
"Update": {
"childFolders": null,
"folderName": "SafexsoarTest",
"folderPath": "\\Personal Folders\\XSOAR integration\\SafexsoarTest",
"folderTypeId": 1,
"id": 4,
"inheritPermissions": false,
"inheritSecretPolicy": false,
"parentFolderId": 3,
"secretPolicyId": -1,
"secretTemplates": null
}
}
}
}
delinea-secret-create
Create new object Secret
Base Command
delinea-secret-create
Input
| Argument Name | Description | Required |
|---|---|---|
| autoChangeEnabled | AutoChangeEnabled options | Optional |
| checkOutChangePasswordEnabled | CheckOutChangePasswordEnabled options | Optional |
| checkOutEnabled | Whether secret checkout is enabled | Optional |
| checkOutIntervalMinutes | Checkout interval, in minutes (integer) | Optional |
| enableInheritPermissions | Whether the secret inherits permissions from the containing folder | Optional |
| enableInheritSecretPolicy | Whether the secret policy is inherited from the containing folder | Optional |
| folderId | Secret folder ID. May be null unless secrets are required to be in folders.(integer) | Optional |
| launcherConnectAsSecretId | LauncherConnectAsSecretId(integer) | Optional |
| name | Secret name | Required |
| passwordTypeWebScriptId | passwordTypeWebScriptId options(integer) | Optional |
| proxyEnabled | proxyEnabled options | Optional |
| requiresCommen | requiresCommen options | Optional |
| secretPolicyId | secretPolicyId options(integer) | Optional |
| secretTemplateId | Secret Template ID (integer) | Required |
| sessionRecordingEnabled | sessionRecordingEnabled options | Optional |
| siteId | siteId options (integer) | Required |
| sshKeyArgs | sshKeyArgs options(list args) | Optional |
| domain_item | Item Domain for secret. If need to select template. | Optional |
| machine_item | Item Machine for secret. If need to select template. | Optional |
| username_item | Item Username for secret.If need to select template. | Optional |
| password_item | Item Password for secret.If need to select template. | Optional |
| notes_item | Item Notes for secret.IF need to select template. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Create | String | Secret Model |
Command Example
!delinea-secret-create name="xsoarSecret" secrettemplateid="6003" siteid="1" checkoutenabled=true folderid=3 machine_item="my-machine" username_item="my-username" password_item="XXXXXX@@@@@####"
Context Example
{
"Delinea": {
"Secret": {
"Create": {
"accessRequestWorkflowMapId": -1,
"active": true,
"allowOwnersUnrestrictedSshCommands": false,
"autoChangeEnabled": false,
"autoChangeNextPassword": null,
"checkOutChangePasswordEnabled": false,
"checkOutEnabled": true,
"checkOutIntervalMinutes": -1,
"checkOutMinutesRemaining": 0,
"checkOutUserDisplayName": "",
"checkOutUserId": 0,
"checkedOut": false,
"doubleLockId": 0,
"enableInheritPermissions": true,
"enableInheritSecretPolicy": false,
"failedPasswordChangeAttempts": 0,
"folderId": 3,
"id": 5,
"isDoubleLock": false,
"isOutOfSync": false,
"isRestricted": true,
"items": [
{
"fieldDescription": "The Server or Location of the Windows Machine.",
"fieldId": 83,
"fieldName": "Machine",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": false,
"isPassword": false,
"itemId": 19,
"itemValue": "my-machine",
"slug": "machine"
},
{
"fieldDescription": "The Username of the Windows User.",
"fieldId": 86,
"fieldName": "Username",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": false,
"isPassword": false,
"itemId": 20,
"itemValue": "my-username",
"slug": "username"
},
{
"fieldDescription": "The password of the Windows User.",
"fieldId": 85,
"fieldName": "Password",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": false,
"isPassword": true,
"itemId": 21,
"itemValue": "XXXXXX@@@@@####",
"slug": "password"
},
{
"fieldDescription": "Any additional notes.",
"fieldId": 84,
"fieldName": "Notes",
"fileAttachmentId": null,
"filename": null,
"isFile": false,
"isNotes": true,
"isPassword": false,
"itemId": 22,
"itemValue": "",
"slug": "notes"
}
],
"lastHeartBeatCheck": "0001-01-01T00:00:00",
"lastHeartBeatStatus": "Pending",
"lastPasswordChangeAttempt": "0001-01-01T00:00:00",
"launcherConnectAsSecretId": -1,
"name": "xsoarSecret",
"outOfSyncReason": "",
"passwordTypeWebScriptId": -1,
"proxyEnabled": false,
"requiresApprovalForAccess": false,
"requiresComment": false,
"responseCodes": [],
"restrictSshCommands": false,
"secretPolicyId": -1,
"secretTemplateId": 6003,
"secretTemplateName": "Windows Account",
"sessionRecordingEnabled": false,
"siteId": 1
}
}
}
}
delinea-secret-delete
Delete secret
Base Command
delinea-secret-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| id | ID secret for delete | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Delete | String | Information about an object that was deleted |
Command Example
!delinea-secret-delete id=2
Context Example
{
"Delinea": {
"Secret": {
"Deleted": {
"id": 2,
"objectType": "Secret",
"responseCodes": []
}
}
}
}
delinea-secret-server-user-create
Create a new Secret Server user
Base Command
delinea-secret-server-user-create
Input
| Argument Name | Description | Required |
|---|---|---|
| displayName | User display name | Required |
| password | Password for new user | Required |
| userName | Username | Required |
| adGuid | Active Directory unique identifier | Optional |
| domainId | Active Directory domain ID | Optional |
| duoTwoFactor | Whether Duo two-factor authentication is enabled | Optional |
| emailAddress | User email address | Optional |
| enabled | Whether the user account is enabled | Optional |
| fido2TwoFactor | Whether Duo two-factor authentication is enabled | Optional |
| isApplicationAccount | IsApplicationAccount | Optional |
| oathTwoFactor | Whether OATH two-factor authentication is enabled | Optional |
| radiusTwoFactor | Whether RADIUS two-factor authentication is enabled | Optional |
| radiusUserName | RADIUS username | Optional |
| twoFactor | Whether two-factor authentication is enabled | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Server.User.Create | String | User Model |
Command Example
!delinea-secret-server-user-create displayname="UserOne" password="12345" username="UserOne"
Context Example
{
"Delinea": {
"User": {
"Create": {
"adAccountExpires":"0001-01-01T00:00:00",
"adGuid":null,
"created":"2022-06-01T08:31:15.275Z",
"dateOptionId":-1,
"displayName":"UserOne",
"domainId":-1,
"duoTwoFactor":false,
"emailAddress":null,
"enabled":true,
"externalUserSource":"None",
"fido2TwoFactor":false,
"id":29,
"ipAddressRestrictions":null,
"isApplicationAccount":false,
"isEmailCopiedFromAD":false,
"isEmailVerified":false,
"isLockedOut":false,
"lastLogin":0001-01-01T00:00:00,
"lastSessionActivity":null,
"lockOutReason":null,
"lockOutReasonDescription":null,
"loginFailures":0,
"mustVerifyEmail":false,
"oathTwoFactor":false,
"oathVerified":false,
"passwordLastChanged":"0001-01-01T00:00:00",
"personalGroupId":0,
"radiusTwoFactor":false,
"radiusUserName":null,
"resetSessionStarted":"0001-01-01T00:00:00",
"slackId":null,
"timeOptionId":-1,
"twoFactor":false,
"unixAuthenticationMethod":Password,
"userLcid":0,
"userName":"UserOne",
"verifyEmailSentDate":"0001-01-01T00:00:00"
}
}
}
}
delinea-secret-server-user-search
Search, filter, sort, and page Secret Server users
Base Command
delinea-secret-server-user-search
Input
| Argument Name | Description | Required |
|---|---|---|
| filter.domainId | Filter users by Active Directory domain (integer) | Optional |
| filter.includeInactive | Whether to include inactive users in the results | Optional |
| filter.searchFields | Fields to search | Optional |
| filter.searchText | Search text | Optional |
| skip | Number of records to skip before taking results | Optional |
| sortBy[0].direction | Sort direction | Optional |
| sortBy[0].name | Sort field name | Optional |
| sortBy[0].priority | Priority index. Sorts with lower values are executed earlier (integer) | Optional |
| take | Maximum number of records to include in results(integer) | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Server.User.Search | String | Specify paging and sorting options for querying records and returning results |
Command Example
!delinea-secret-server-user-search filter_searchfields="userName" filter_searchtext="xsoarUser"
Context Example
{
"Delinea": {
"User": {
"Search": null
}
}
}
delinea-secret-server-user-update
Update a single Secret Server user by ID
Base Command
delinea-secret-server-user-update
Input
| Argument Name | Description | Required |
|---|---|---|
| id | User ID | Required |
| dateOptionId | DateOptionId(integer) | Optional |
| displayName | Display name | Optional |
| duoTwoFactor | Whether Duo two-factor authentication is enabled | Optional |
| emailAddress | Optional | |
| enabled | Whether the user account is enabled | Optional |
| fido2TwoFactor | Whether FIDO2 two-factor authentication is enabled | Optional |
| groupOwners | GroupOwners(integer) | Optional |
| isApplicationAccount | IsApplicationAccount | Optional |
| isGroupOwnerUpdate | isGroupOwnerUpdate | Optional |
| isLockedOut | Whether the user is locked out | Optional |
| loginFailures | Number of login failures | Optional |
| oathTwoFactor | Whether OATH two-factor authentication is enabled | Optional |
| password | Password | Optional |
| radiusTwoFactor | Whether RADIUS two-factor authentication is enabled | Optional |
| radiusUserName | RADIUS username | Optional |
| timeOptionId | timeOptionId (integer) | Optional |
| twoFactor | Whether two-factor authentication is enabled | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Server.User.Update | String | User Model |
Command Example
!delinea-secret-server-user-update id=28 displayname="myTestUser"
Context Example
{
"Delinea": {
"User": {
"Update": {
"unixAuthenticationMethod":"Password",
"enabled":true,
"passwordLastChanged":"0001-01-01T00:00:00",
"isEmailCopiedFromAD":false,
"isApplicationAccount":false,
"lockOutReason":null,
"created":"2022-06-01T08:09:39",
"radiusUserName":"UserOne",
"radiusTwoFactor":false,
"verifyEmailSentDate":"0001-01-01T00:00:00",
"adAccountExpires":"0001-01-01T00:00:00",
"slackId":null,
"adGuid":null,
"displayName":"myTestUser",
"oathVerified":false,
"lastSessionActivity":null,
"externalUserSource":"None",
"loginFailures":0,
"lastLogin":"0001-01-01T00:00:00",
"ipAddressRestrictions":null,
"oathTwoFactor":false,
"lockOutReasonDescription":null,
"userName":"UserOne",
"fido2TwoFactor":false,
"emailAddress":null,
"resetSessionStarted":"0001-01-01T00:00:00",
"mustVerifyEmail":false,
"isEmailVerified":false,
"personalGroupId":0,
"isLockedOut":false,
"id":28,
"twoFactor":false,
"duoTwoFactor":false,
"timeOptionId":-1,
"userLcid":0,
"dateOptionId":-1,
"domainId":-1
}
}
}
}
delinea-secret-server-user-delete
Delete a Secret Server user by ID
Base Command
delinea-secret-server-user-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| id | User ID | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Server.User.Delete | String | Information about an object that was deleted |
Command Example
!delinea-secret-server-user-delete id=5
Context Example
{
"Delinea": {
"User": {
"Delete": {
"id": 5,
"objectType": "User",
"responseCodes": null
}
}
}
}
delinea-secret-server-user-get
Get Secret Server users list
Base Command
delinea-secret-server-user-get
Input
This command has no input arguments.
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.Server.User | String | User object |
Command Example
#### Context Example
```json
{
"Delinea": {
"Secret": {
"Server": {
"User": [
{
"id": 1,
"userName": "admin",
"displayName": "Administrator",
"enabled": true
}
]
}
}
}
}
delinea-secret-rpc-changepassword
Change a secret’s password
Base Command
delinea-secret-rpc-changepassword
Input
| Argument Name | Description | Required |
|---|---|---|
| secret_id | Secret ID | Required |
| newPassword | New secret password | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Secret.ChangePassword | String | Secret summary object |
Command Example
!delinea-secret-rpc-changepassword secret_id=4 newPassword="Test000"
Context Example
{
"Delinea": {
"Secret": {
"ChangePassword": {
"active": true,
"autoChangeEnabled": false,
"checkOutEnabled": false,
"checkedOut": false,
"createDate": "2020-11-02T18:06:07.357",
"daysUntilExpiration": null,
"doubleLockEnabled": false,
"extendedFields": null,
"folderId": -1,
"hidePassword": false,
"id": 4,
"inheritsPermissions": false,
"isOutOfSync": false,
"isRestricted": false,
"lastAccessed": null,
"lastHeartBeatStatus": "Success",
"lastPasswordChangeAttempt": "0001-01-01T00:00:00",
"name": "g1-machine",
"outOfSyncReason": "",
"requiresApproval": false,
"requiresComment": false,
"responseCodes": null,
"secretTemplateId": 6007,
"secretTemplateName": "Unix Account (SSH)",
"siteId": 1
}
}
}
}
delinea-fetch-users
Fetch credentials from secret
Base Command
delinea-fetch-users
Input
NO input argumets
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.User.Credentials | String | Secret credential objects |
Command Example
#### Context Example
```json
[
{
"name": "4219",
"password": "test3",
"user": "test3"
},
{
"name": "4217",
"password": "dhPQhf1d@!E",
"user": "secret2"
}
]
delinea-platform-user-create
Create a new user in Platform
Base Command
delinea-platform-user-create
Input
| Argument Name | Description | Required |
|---|---|---|
| MobileNumber | The user mobile number. | Optional |
| ID | The UUID of the cloud user to change. | Optional |
| InEverybodyRole | The user is in the Everybody role? | Optional |
| CmaRedirectedUserUuid | The MFA redirected user UUID. | Optional |
| OfficeNumber | The user office number. | Optional |
| ReportsTo | The user reports to this user UUID. | Optional |
| PreferredCulture | The user preferred culture. | Optional |
| DisplayName | The user display. | Optional |
| Password | Password for new user. The password used to log in. | Required |
| Name | The user name. | Required |
| AccountExp | Account expires date/time. | Optional |
| PasswordNeverExpire | Does user’s password expire? | Optional |
| The User email. | Optional | |
| ServiceUser | Whether this is a service account. Service accounts are used for automation, cannot log in using the UI, and do not consume a user license. | Optional |
| Description | The User description. | Optional |
| HomeNumber | The user home number. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Platform.User.Create | String | Result |
Command Example
!delinea-platform-user-create Password="Test@123" Name="uniquexsoar1" ServiceUser="true"
Context Example
{
"Delinea": {
"Platform" : {
"User": {
"Create": {
"Result": "a09eb441-f0a0-4894-a129-af4e0b3559d6",
"success": true,
"Message": null,
"MessageID": null,
"Exception": null,
"ErrorID": null,
"ErrorCode": null,
"IsSoftError": false,
"InnerExceptions": null
}
}
}
}
}
delinea-platform-user-get
Get single Platform user by uuid
Base Command
delinea-platform-user-get
Input
| Argument Name | Description | Required |
|---|---|---|
| userUuidOrUpn | Fetches a Platform user by uuid or upn | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Platform.User.Get | String | User Model |
Command Example
!delinea-platform-user-get userUuidOrUpn="09b9a9b0-6ce8-465f-ab03-65766d33b05e"
Context Example
{
"Delinea": {
"Platform": {
"User": {
"Get": {
"directoryServiceUuid": "09b9a9b0-6ce8-465f-ab03-65766d33b05e",
"directoryServiceName": "Delinea",
"directoryInstanceName": "Delinea",
"uuid": "c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"name": "admin@loud",
"displayName": "admin",
"state": "Active",
"lastLogin": "2025-09-29T13:37:19.4639582Z",
"lastInvite": "2025-04-16T17:38:47.0519372Z",
"platformMembershipType": "Employee",
"_drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428440b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/c2c7bcc6-9560-44e0-8dff-5be221cd37we",
"_links": {
"self": {
"href": "/api/users/c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428440b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/c2c7bcc6-9560-44e0-8dff-5be221cd37we",
"title": "PlatformUser(Platform): admin"
},
"directory-users": [
{
"href": "/api/directory-services/09B9A9B0-6CE8-465F-AB03-65766D33B05R/users/c2c7bcc6-9560-44e0-8dff-5be221cd37e",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:user/delinea/09b9a9b0-6ce8-465f-ab03-65766d33b05e/c2c7bcc6-9560-44e0-8dff-5be221cd37we",
"title": "User(Delinea): admin"
}
]
}
}
}
}
}
}
delinea-platform-user-update
Update a single Platform user by ID
Base Command
delinea-platform-user-update
Input
| Argument Name | Description | Required |
|---|---|---|
| MobileNumber | The user mobile number. | Optional |
| ID | The UUID of the cloud user to change. | Required |
| InEverybodyRole | The user is in the Everybody role? | Optional |
| CmaRedirectedUserUuid | The MFA redirected user uuid. | Optional |
| OfficeNumber | The user office number. | Optional |
| ReportsTo | The user reports to this user UUID. | Optional |
| PreferredCulture | The user preferred culture. | Optional |
| DisplayName | The user display. | Optional |
| Password | Password for new user. The password used to log in. | Optional |
| Name | The user name. | Optional |
| AccountExp | Account expires date/time. | Optional |
| PasswordNeverExpire | Does user’s password expire? | Optional |
| The User email. | Optional | |
| ServiceUser | Whether this is a service account. Service accounts are used for automation, cannot log in using the UI, and do not consume a user license. | Optional |
| Description | The User description. | Optional |
| HomeNumber | The user home number. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Platform.User.Update | String | User is successfully updated then returning success: true in result |
Command Example
!delinea-platform-user-update ID="b02319fc-b26a-4352-8e4e-d8ea1188f160" Name="xsoarUserTest1"
Context Example
{
"Delinea": {
"Platform": {
"User": {
"Update": {
"success": true,
"Result": null,
"Message": null,
"MessageID": null,
"Exception": null,
"ErrorID": null,
"ErrorCode": null,
"IsSoftError": false,
"InnerExceptions": null
}
}
}
}
}
delinea-platform-user-delete
Delete a Platform user by UUID or Name
Base Command
delinea-platform-user-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| id | User UUID | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Platform.User.Delete | String | Information about an object that was deleted and returning success: true in result |
Command Example
!delinea-platform-user-delete id="a09eb441-f0a0-4894-a129-af4e0b3559d6"
Context Example
{
"Delinea": {
"Platform": {
"User": {
"Delete": {
"success": true,
"Result": null,
"Message": null,
"MessageID": null,
"Exception": null,
"ErrorID": null,
"ErrorCode": null,
"IsSoftError": false,
"InnerExceptions": null
}
}
}
}
}
delinea-platform-get-all-users
Get single Platform user by uuid
Base Command
delinea-platform-get-all-users
Input
| Argument Name | Description | Required |
|---|---|---|
| filter_displayName | Display name to filter users. | Optional |
| pageSize | Page size. Default 1000. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Platform.Users | String | Returning users based on pageSize and default page size is 1000 |
Command Example
!delinea-platform-get-all-users pageSize="1"
Context Example
{
"Delinea": {
"Platform": {
"Get" : {
"All" : {
"Users": {
"users": [
{
"directoryServiceUuid": "09b9a9b0-6ce8-465f-ab03-65766d33b05e",
"directoryServiceName": "Delinea",
"directoryInstanceName": "Delinea",
"uuid": "c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"name": "cloudadmin@cloud",
"displayName": "cloudadmin",
"state": "Active",
"lastLogin": "2025-09-29T13:37:19.4639582Z",
"lastInvite": "2025-04-16T17:38:47.0519372Z",
"platformMembershipType": "Employee",
"_drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"_links": {
"self": {
"href": "/api/users/c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"title": "PlatformUser(Platform): cloudadmin"
},
"directory-users": [
{
"href": "/api/directory-services/09B9A9B0-6CE8-465F-AB03-65766D33B05E/users/c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:user/delinea/09b9a9b0-6ce8-465f-ab03-65766d33b05e/c2c7bcc6-9560-44e0-8dff-5be221cd37ee",
"title": "User(Delinea): cloudadmin"
}
]
}
}
]
}
}
}
}
}
}
delinea-platform-get-user-search-by-text
Get Platform users search by Text
Base Command
delinea-platform-get-user-search-by-text
Input
| Argument Name | Description | Required |
|---|---|---|
| filter.searchText | Search Text is looked for in multiple fields | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Delinea.Platform.UserSearchResults | String | SearchText is looked for in multiple fields and returning results |
Command Example
!delinea-platform-get-user-search-by-text filter.searchText="sail"
Context Example
{
"Delinea": {
"Platform": {
"Get" : {
"User" : {
"Searchbytext": {
"users": [
{
"directoryServiceUuid": "09b9a9b0-6ce8-465f-ab03-65766d33b05e",
"directoryServiceName": "Delinea",
"directoryInstanceName": "Delinea",
"uuid": "3f4b80c0-c853-473f-9534-66e4a8331843",
"name": "ren@cloud",
"displayName": "sailpoint+user.service",
"state": "Created",
"platformMembershipType": "Employee",
"_drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/3f4b80c0-c853-473f-9534-66e4a8331843",
"_links": {
"self": {
"href": "/api/users/3f4b80c0-c853-473f-9534-66e4a8331843",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/3f4b80c0-c853-473f-9534-66e4a8331843",
"title": "PlatformUser(Platform): sailpoint+user.service"
},
"directory-users": [
{
"href": "/api/directory-services/09B9A9B0-6CE8-465F-AB03-65766D33B05E/users/3f4b80c0-c853-473f-9534-66e4a8331843",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:user/delinea/09b9a9b0-6ce8-465f-ab03-65766d33b05e/3f4b80c0-c853-473f-9534-66e4a8331843",
"title": "User(Delinea): sailpoint+user.service"
}
]
}
},
{
"directoryServiceUuid": "09b9a9b0-6ce8-465f-ab03-65766d33b05e",
"directoryServiceName": "Delinea",
"directoryInstanceName": "Delinea",
"uuid": "b977dd7d-b771-40b6-83f3-f04154a733c5",
"name": "roderick@cloud",
"displayName": "roderick",
"state": "Active",
"lastLogin": "2025-08-28T17:52:02.0344759Z",
"platformMembershipType": "Employee",
"_drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/b977dd7d-b771-40b6-83f3-f04154a733c5",
"_links": {
"self": {
"href": "/api/users/b977dd7d-b771-40b6-83f3-f04154a733c5",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:platformuser/platform/09b9a9b0-6ce8-465f-ab03-65766d33b05e/b977dd7d-b771-40b6-83f3-f04154a733c5",
"title": "PlatformUser(Platform): roderick"
},
"directory-users": [
{
"href": "/api/directory-services/09B9A9B0-6CE8-465F-AB03-65766D33B05E/users/b977dd7d-b771-40b6-83f3-f04154a733c5",
"method": "GET",
"drn": "drn:dws:76a86745-ca2c-4ff2-ac98-463428343b8a:identity:user/delinea/09b9a9b0-6ce8-465f-ab03-65766d33b05e/b977dd7d-b771-40b6-83f3-f04154a733c5",
"title": "User(Delinea): roderick"
}
]
}
}
]
}
}
}
}
}
}
Configuration parameters
url— Server URL (e.g. https://example.net) (required)credentials— Username (required)insecure— Trust any certificate (not secure)proxy— Use system proxy settingsisFetchCredentials— Fetches Credentialssecrets— Secret IDs (Provide multiple Id's by using ',' example- 1,2,3)
Commands (26)
-
delinea-folder-createCreate a new folder.
-
delinea-folder-deleteDelete a folder by folder ID.
-
delinea-folder-searchSearch a specific folder by name.
-
delinea-folder-updateUpdate a single secret folder by ID.
-
delinea-platform-get-all-usersFetch all users from the platform.
-
delinea-platform-get-user-search-by-textList of platform users matching search text.
-
delinea-platform-user-createCreate a new user in Platform.
-
delinea-platform-user-deleteDelete Platform user by ID.
-
delinea-platform-user-getFetch a Platform user by uuid or upn.
-
delinea-platform-user-updateUpdate a Platform user by ID.
-
delinea-secret-checkinCheck in a secret.
-
delinea-secret-checkoutCheck out a secret.
-
delinea-secret-createCreate a new secret.
-
delinea-secret-deleteDelete secret by id.
-
delinea-secret-getGet secret object by secret ID.
-
delinea-secret-password-getExtracting the password field from the required secret.
-
delinea-secret-password-updateUpdate password for a secret by ID.
-
delinea-secret-rpc-changepasswordRemote password changing.
-
delinea-secret-searchSearch secret by multiply parameters.
-
delinea-secret-search-nameSearch for a secret using secret name.
-
delinea-secret-server-user-createCreate a new user in Secret Server.
-
delinea-secret-server-user-deleteDelete Secret Server user by ID.
-
delinea-secret-server-user-getGet Secret Server users list.
-
delinea-secret-server-user-searchUser search, filter and sort in Secret Server.
-
delinea-secret-server-user-updateUpdate a single user by ID in Secret Server.
-
delinea-secret-username-getExtracting the username field from the required secret.
import pytest from CommonServerPython import * from DelineaSS import ( Client, AuthenticationModel, AuthenticationService, get_credentials, PlatformLogin, secret_password_get_command, secret_username_get_command, secret_get_command, secret_password_update_command, secret_checkout_command, secret_checkin_command, secret_delete_command, folder_create_command, folder_delete_command, folder_update_command, secret_server_user_delete_command, secret_create_command, secret_server_user_create_command, secret_server_user_update_command, secret_rpc_changepassword_command, fetch_credentials_command, secret_search_name_command, secret_search_command, folder_search_command, secret_server_user_search_command, platform_get_all_users_command, platform_user_delete_command, platform_user_create_command, platform_user_get_command, platform_user_update_command, platform_get_user_searchbytext_command, ) from test_data.context import ( GET_PASSWORD_BY_ID_CONTEXT, GET_USERNAME_BY_ID_CONTENT, SECRET_GET_CONTENT, SECRET_PASSWORD_UPDATE_CONTEXT, SECRET_CHECKOUT_CONTEXT, SECRET_CHECKIN_CONTEXT, SECRET_DELETE_CONTEXT, FOLDER_CREATE_CONTEXT, FOLDER_DELETE_CONTEXT, FOLDER_UPDATE_CONTEXT, SECRET_SERVER_USER_DELETE_CONTEXT, SECRET_CREATE_CONTEXT, SECRET_SERVER_USER_CREATE_CONTEXT, SECRET_SERVER_USER_UPDATE_CONTEXT, SECRET_RPC_CHANGE_PASSWORD_CONTEXT, SECRET_GET_CREDENTIALS_CONTEXT, SECRET_SEARCH_NAME_CONTEXT, SECRET_SEARCH_CONTEXT, FOLDER_SEARCH_CONTEXT, SECRET_SERVER_USER_SEARCH_CONTEXT, PLATFORM_USER_DELETE_CONTEXT, PLATFORM_USER_CREATE_CONTEXT, PLATFORM_USER_UPDATE_CONTEXT, PLATFORM_USER_GET_CONTEXT, PLATFORM_GET_ALL_USERS_CONTEXT, PLATFORM_USER_SEARCH_TEXT_CONTEXT, ) from test_data.http_responses import ( GET_PASSWORD_BY_ID_RAW_RESPONSE, GET_USERNAME_BY_ID_RAW_RESPONSE, SECRET_CHECKOUT_RAW_RESPONSE, SECRET_GET_RAW_RESPONSE, SECRET_PASSWORD_UPDATE_RAW_RESPONSE, SECRET_CHECKIN_RAW_RESPONSE, SECRET_DELETE_RAW_RESPONSE, FOLDER_CREATE_RAW_RESPONSE, FOLDER_DELETE_RAW_RESPONSE, FOLDER_UPDATE_RAW_RESPONSE, SECRET_SERVER_USER_DELETE_RAW_RESPONSE, SECRET_CREATE_RAW_RESPONSE, SECRET_RPC_CHANGE_PASSWORD_RAW_RESPONSE, SECRET_SERVER_USER_CREATE_RAW_RESPONSE, SECRET_SERVER_USER_UPDATE_RAW_RESPONSE, SECRET_GET_CREDENTIALS_RAW_RESPONSE, SECRET_SEARCH_NAME_RAW_RESPONSE, SECRET_SEARCH_RAW_RESPONSE, FOLDER_SEARCH_RAW_RESPONSE, SECRET_SERVER_USER_SEARCH_RAW_RESPONSE, PLATFORM_USER_DELETE_RAW_RESPONSE, PLATFORM_USER_CREATE_RAW_RESPONSE, PLATFORM_USER_UPDATE_RAW_RESPONSE, PLATFORM_USER_GET_RAW_RESPONSE, PLATFORM_GET_ALL_USERS_RAW_RESPONSE, PLATFORM_USER_SEARCH_TEXT_RAW_RESPONSE, ) GET_PASSWORD_BY_ID_ARGS = {"secret_id": "4", "autoComment": "TestGetPassword"} GET_USERNAME_BY_ID_ARGS = {"secret_id": "4"} SECRET_GET_ARGS = {"secret_id": "4", "autoComment": "TestGetSecret"} SECRET_PASSWORD_UPDATE_ARGS = {"secret_id": "4", "newpassword": "NEWPASSWORD1", "autoComment": "TestPasswordUpdate"} SECRET_CHECKOUT_ARGS = {"secret_id": "3"} SECRET_CHECKIN_ARGS = {"secret_id": "4"} SECRET_DELETE_ARGS = {"id": "9", "autoComment": "TestDeleteSecret"} FOLDER_CREATE_ARGS = {"folderName": "xsoarFolderTest3", "folderTypeId": "1", "parentFolderId": "3"} FOLDER_DELETE_ARGS = {"folder_id": "9"} FOLDER_UPDATE_ARGS = {"id": "12", "folderName": "xsoarTF3New"} SECRET_SERVER_USER_CREATE_ARGS = { "displayName": "dispalyName", "password": "password", "userName": "XSOAR", "emailAddress": "example@example.com", } SECRET_SERVER_USER_DELETE_ARGS = {"id": "10"} SECRET_CREATE_ARGS = { "name": "xsoarSecret", "secrettemplateid": "6003", "siteid": "1", "checkoutenabled": "true", "folderid": "3", "machine_item": "my-machine", "username_item": "my-username", "password_item": "password_item", } SECRET_SERVER_USER_UPDATE_ARGS = {"id": "28", "userName": "UserOne"} SECRET_RPC_CHANGE_PASSWORD_ARGS = {"secret_id": "4", "newpassword": "newPassword", "autoComment": "TestPasswordChange"} SECRET_GET_CREDENTIALS_ARGS = {"secretids": "4"} SECRET_SEARCH_NAME_ARGS = {"search_name": "Sayali"} SEARCH_SECRET_ARGS = {"filter_folderid": "145", "filter_searchfield": "Name", "filter_searchtext": "book"} SEARCH_FOLDER_ARGS = {"foldername": "admin"} SECRET_SERVER_SEARCH_USER_ARGS = {"filter_searchfield": "userName", "filter_searchtext": "Adil", "domainId": "-1"} PLATFORM_USER_DELETE_ARGS = {"id": "10"} PLATFORM_USER_CREATE_ARGS = {"Name": "Name", "Password": "password", "DisplayName": "XSOAR", "Mail": "example@example.com"} PLATFORM_USER_UPDATE_ARGS = {"ID": "28", "Name": "UserOne"} PLATFORM_USER_GET_ARGS = {"userUuidOrUpn": "10"} PLATFORM_GET_ALL_USERS_ARGS = {"pageSize": "2"} PLATFORM_USER_SEARCH_TEXT_ARGS = {"pageSize": "2"} @pytest.mark.parametrize( "command, args, http_response, context", [ (secret_password_get_command, GET_PASSWORD_BY_ID_ARGS, GET_PASSWORD_BY_ID_RAW_RESPONSE, GET_PASSWORD_BY_ID_CONTEXT), (secret_username_get_command, GET_USERNAME_BY_ID_ARGS, GET_USERNAME_BY_ID_RAW_RESPONSE, GET_USERNAME_BY_ID_CONTENT), (secret_get_command, SECRET_GET_ARGS, SECRET_GET_RAW_RESPONSE, SECRET_GET_CONTENT), ( secret_password_update_command, SECRET_PASSWORD_UPDATE_ARGS, SECRET_PASSWORD_UPDATE_RAW_RESPONSE, SECRET_PASSWORD_UPDATE_CONTEXT, ), (secret_checkout_command, SECRET_CHECKOUT_ARGS, SECRET_CHECKOUT_RAW_RESPONSE, SECRET_CHECKOUT_CONTEXT), (secret_checkin_command, SECRET_CHECKIN_ARGS, SECRET_CHECKIN_RAW_RESPONSE, SECRET_CHECKIN_CONTEXT), (secret_delete_command, SECRET_DELETE_ARGS, SECRET_DELETE_RAW_RESPONSE, SECRET_DELETE_CONTEXT), (folder_create_command, FOLDER_CREATE_ARGS, FOLDER_CREATE_RAW_RESPONSE, FOLDER_CREATE_CONTEXT), (folder_delete_command, FOLDER_DELETE_ARGS, FOLDER_DELETE_RAW_RESPONSE, FOLDER_DELETE_CONTEXT), (folder_update_command, FOLDER_UPDATE_ARGS, FOLDER_UPDATE_RAW_RESPONSE, FOLDER_UPDATE_CONTEXT), ( secret_server_user_delete_command, SECRET_SERVER_USER_DELETE_ARGS, SECRET_SERVER_USER_DELETE_RAW_RESPONSE, SECRET_SERVER_USER_DELETE_CONTEXT, ), (secret_create_command, SECRET_CREATE_ARGS, SECRET_CREATE_RAW_RESPONSE, SECRET_CREATE_CONTEXT), ( secret_server_user_create_command, SECRET_SERVER_USER_CREATE_ARGS, SECRET_SERVER_USER_CREATE_RAW_RESPONSE, SECRET_SERVER_USER_CREATE_CONTEXT, ), ( secret_server_user_update_command, SECRET_SERVER_USER_UPDATE_ARGS, SECRET_SERVER_USER_UPDATE_RAW_RESPONSE, SECRET_SERVER_USER_UPDATE_CONTEXT, ), ( secret_rpc_changepassword_command, SECRET_RPC_CHANGE_PASSWORD_ARGS, SECRET_RPC_CHANGE_PASSWORD_RAW_RESPONSE, SECRET_RPC_CHANGE_PASSWORD_CONTEXT, ), ( fetch_credentials_command, SECRET_GET_CREDENTIALS_ARGS, SECRET_GET_CREDENTIALS_RAW_RESPONSE, SECRET_GET_CREDENTIALS_CONTEXT, ), (secret_search_name_command, SECRET_SEARCH_NAME_ARGS, SECRET_SEARCH_NAME_RAW_RESPONSE, SECRET_SEARCH_NAME_CONTEXT), (secret_search_command, SEARCH_SECRET_ARGS, SECRET_SEARCH_RAW_RESPONSE, SECRET_SEARCH_CONTEXT), (folder_search_command, SEARCH_FOLDER_ARGS, FOLDER_SEARCH_RAW_RESPONSE, FOLDER_SEARCH_CONTEXT), ( secret_server_user_search_command, SECRET_SERVER_SEARCH_USER_ARGS, SECRET_SERVER_USER_SEARCH_RAW_RESPONSE, SECRET_SERVER_USER_SEARCH_CONTEXT, ), ( platform_user_delete_command, PLATFORM_USER_DELETE_ARGS, PLATFORM_USER_DELETE_RAW_RESPONSE, PLATFORM_USER_DELETE_CONTEXT, ), ( platform_user_create_command, PLATFORM_USER_CREATE_ARGS, PLATFORM_USER_CREATE_RAW_RESPONSE, PLATFORM_USER_CREATE_CONTEXT, ), ( platform_user_update_command, PLATFORM_USER_UPDATE_ARGS, PLATFORM_USER_UPDATE_RAW_RESPONSE, PLATFORM_USER_UPDATE_CONTEXT, ), (platform_user_get_command, PLATFORM_USER_GET_ARGS, PLATFORM_USER_GET_RAW_RESPONSE, PLATFORM_USER_GET_CONTEXT), ( platform_get_all_users_command, PLATFORM_GET_ALL_USERS_ARGS, PLATFORM_GET_ALL_USERS_RAW_RESPONSE, PLATFORM_GET_ALL_USERS_CONTEXT, ), ( platform_get_user_searchbytext_command, PLATFORM_USER_SEARCH_TEXT_ARGS, PLATFORM_USER_SEARCH_TEXT_RAW_RESPONSE, PLATFORM_USER_SEARCH_TEXT_CONTEXT, ), ], ) def test_commands(command, args, http_response, context, mocker): """Test commands based on login type (Platform or Secret Server)""" ss_model = AuthenticationModel("username", "password", "https://test.example.com") if command in [ platform_user_create_command, platform_user_update_command, platform_user_get_command, platform_user_delete_command, platform_get_all_users_command, platform_get_user_searchbytext_command, ]: ss_model.set_platform_login(True) else: ss_model.set_platform_login(False) mocker.patch("DelineaSS.is_platform_or_ss", return_value=ss_model) mocker.patch.object(Client, "_generate_token", return_value="Bearer TEST_TOKEN") mocker.patch.object(Client, "_http_request", return_value=http_response) client = Client( server_url="https://test.example.com", username="username", password="password", proxy=False, verify=False, ) outputs = command(client, **args) results = outputs.to_context() assert results.get("EntryContext") == context def test_authenticate_async_secret_server(mocker): mocker.patch("DelineaSS.requests.get", return_value=mocker.Mock(text='{"healthy": true}', json=lambda: {"healthy": True})) model = AuthenticationModel(server_url="https://ss.example.com") service = AuthenticationService() result = service.authenticate_async(model) assert result.platform_login is False def test_authenticate_async_platform(mocker): mocker.patch( "DelineaSS.requests.get", side_effect=[ mocker.Mock(text="", json=dict), # SS check fails mocker.Mock(text="Healthy"), # Platform check succeeds ], ) mocker.patch.object( PlatformLogin, "platform_authentication", return_value=AuthenticationModel(platform_login=True, token="token") ) model = AuthenticationModel(server_url="https://pf.example.com") result = AuthenticationService().authenticate_async(model) assert result.platform_login is True def test_platform_login_token_failure(mocker): mocker.patch("DelineaSS.requests.post", return_value=mocker.Mock(status_code=401, text="Unauthorized")) auth = AuthenticationModel(server_url="https://pf.example.com") result = PlatformLogin().platform_authentication(auth) assert result.error == "Unauthorized" def test_client_platform_authentication(mocker): model = AuthenticationModel(platform_login=True, token="TOKEN", vault_url="https://vault.example.com") mocker.patch("DelineaSS.is_platform_or_ss", return_value=model) client = Client(server_url="https://pf.example.com", username="u", password="p", proxy=False, verify=False) assert client._base_url == "https://vault.example.com" assert client._headers["Authorization"] == "Bearer TOKEN" def test_user_create_on_platform_raises(mocker): mock_auth = mocker.Mock(platform_login=True, token="t", vault_url="url", error=None) mocker.patch("DelineaSS.is_platform_or_ss", return_value=mock_auth) client = Client("url", "u", "p", False, False) with pytest.raises(DemistoException): client.userCreate(Name="test") def test_platform_user_create_on_secret_server_raises(mocker): mocker.patch("DelineaSS.is_platform_or_ss", return_value=mocker.Mock(platform_login=False)) mocker.patch.object(Client, "_generate_token", return_value="token") client = Client("url", "u", "p", False, False) with pytest.raises(DemistoException): client.platform_user_create(Name="test") def test_get_credentials(mocker): mock_client = mocker.Mock() mock_client.getSecret.return_value = { "id": 1, "items": [{"fieldName": "Username", "itemValue": "admin"}, {"fieldName": "Password", "itemValue": "pass"}], } creds = get_credentials(mock_client, "1") assert creds["user"] == "admin" assert creds["password"] == "pass" def test_fetch_credentials_empty(mocker): mocker.patch("DelineaSS.demisto.args", return_value={}) mocker.patch("DelineaSS.demisto.credentials") client = mocker.Mock() result = fetch_credentials_command(client, "") assert result.outputs == [] def test_client_authenticate_platform_error(mocker): auth_model = mocker.Mock(platform_login=True, error="Auth failed", token=None, vault_url="https://example.com") mocker.patch("DelineaSS.is_platform_or_ss", return_value=auth_model) with pytest.raises(Exception, match="Auth failed"): Client(server_url="https://example.com", username="u", password="p", proxy=False, verify=False) def test_authentication_model_setters(): model = AuthenticationModel("u", "p", "url") model.set_platform_login(True) assert model.platform_login is True model.set_platform_login(False) assert model.platform_login is False assert model.error is None model.error = "Some error" assert model.error == "Some error" def test_http_request_raises_exception(mocker): mocker.patch( "DelineaSS.is_platform_or_ss", return_value=mocker.Mock(platform_login=False, token="t", vault_url="https://example.com") ) mocker.patch.object(Client, "_generate_token", return_value="Bearer token") client = Client("https://example.com", "u", "p", False, False) # Now force exception in _http_request mocker.patch.object(client, "_http_request", side_effect=Exception("Request failed")) with pytest.raises(Exception, match="Request failed"): client._http_request("GET", "/test") def test_authentication_model_error_handling(): model = AuthenticationModel("u", "p", "url") assert model.error is None model.error = "Some error" assert model.error == "Some error" def test_client_authenticate_non_platform_success(mocker): auth_model = mocker.Mock(platform_login=False, token="SS_TOKEN", vault_url="https://example.com", error=None) mocker.patch("DelineaSS.is_platform_or_ss", return_value=auth_model) mocker.patch.object(Client, "_generate_token", return_value="Bearer SS_TOKEN") client = Client(server_url="https://example.com", username="u", password="p", proxy=False, verify=False) assert client._token == "Bearer SS_TOKEN" def test_client_authenticate_platform_success(mocker): auth_model = mocker.Mock(platform_login=True, token="PLATFORM_TOKEN", vault_url="https://platform.example.com", error=None) mocker.patch("DelineaSS.is_platform_or_ss", return_value=auth_model) client = Client(server_url="https://platform.example.com", username="u", password="p", proxy=False, verify=False) assert client._token == "PLATFORM_TOKEN" def test_authenticate_async_invalid_url(mocker): mocker.patch("DelineaSS.requests.get", return_value=mocker.Mock(text="", json=dict)) model = AuthenticationModel(server_url="https://invalid.example.com") result = AuthenticationService().authenticate_async(model) assert result.error == "Invalid Server URL https://invalid.example.com" def test_platform_login_no_active_vault(mocker): mocker.patch.object( PlatformLogin, "get_access_token", return_value=mocker.Mock(status_code=200, json=lambda: {"access_token": "t", "expires_in": 10}), ) mocker.patch.object(PlatformLogin, "get_vaults", return_value=mocker.Mock(status_code=200, json=lambda: {"vaults": []})) model = AuthenticationModel(server_url="https://pf.example.com") result = PlatformLogin().platform_authentication(model) assert result.error == "No active default vault found" def test_check_json_response_healthy_string(mocker): mocker.patch("DelineaSS.requests.get", return_value=mocker.Mock(text="Healthy", json=dict)) model = AuthenticationModel(server_url="https://example.com") service = AuthenticationService() assert service.check_json_response_async("url", model) is True def test_test_module_failure(mocker): from DelineaSS import test_module client = mocker.Mock() client._token = "" result = test_module(client) assert "Failed to get authorization token" in result def test_authenticate_async_exception(mocker): mocker.patch("DelineaSS.requests.get", side_effect=Exception("Boom")) model = AuthenticationModel(server_url="https://example.com") result = AuthenticationService().authenticate_async(model) assert result.error is not None assert "Invalid Server URL" in result.error or "Authentication failed" in result.error def test_authenticate_async_runtime_error(mocker): mocker.patch.object(AuthenticationService, "check_json_response_async", side_effect=Exception("Crash")) model = AuthenticationModel(server_url="https://example.com") with pytest.raises(RuntimeError, match="Authentication failed: Crash"): AuthenticationService().authenticate_async(model) def test_platform_handle_error_response(): model = PlatformLogin().handle_error_response("error") assert model.error == "error" assert model.platform_login is True def test_client_platform_authentication_error_message(mocker): auth_model = mocker.Mock(platform_login=True, error="Platform error", token=None, vault_url=None) mocker.patch("DelineaSS.is_platform_or_ss", return_value=auth_model) with pytest.raises(Exception, match="Platform error"): Client("https://example.com", "u", "p", False, False) def test_get_credentials_partial(mocker): mock_client = mocker.Mock() mock_client.getSecret.return_value = {"id": 1, "items": [{"fieldName": "Username", "itemValue": "admin"}]} creds = get_credentials(mock_client, "1") assert creds["user"] == "admin" assert creds.get("password") is None def test_check_json_response_invalid_json(mocker): mock_response = mocker.Mock() mock_response.json.side_effect = ValueError("Invalid JSON") mock_response.text = "Not JSON" mocker.patch("DelineaSS.requests.get", return_value=mock_response) service = AuthenticationService() model = AuthenticationModel("u", "p", "https://example.com") assert service.check_json_response_async("url", model) is False def test_client_generate_token_none(mocker): mock_auth = mocker.Mock(platform_login=False, token=None, vault_url="https://url") mocker.patch("DelineaSS.is_platform_or_ss", return_value=mock_auth) mocker.patch.object(Client, "_generate_token", return_value=None) client = Client("https://url", "u", "p", False, False) token = client._generate_token() assert token is None def test_client_user_update_on_platform_raises(mocker): mock_auth = mocker.Mock(platform_login=True, token="t", vault_url="url", error=None) mocker.patch("DelineaSS.is_platform_or_ss", return_value=mock_auth) client = Client("https://url", "u", "p", False, False) with pytest.raises(DemistoException): client.userUpdate(id="1", Name="TestUser")