API v2: Password Changersยถ
Password changers manage credentials for privileged accounts on monitored servers. They operate on various transport layers: SSH, LDAP, Telnet, or WinRM. You can use built-in options or create custom scripts.
Data Structuresยถ
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Read-only, unique password change identifier. |
|
|
string {change, verify} |
yes |
Password changer type. |
|
string |
yes |
Unique, case-insensitive password changer name. |
|
string {LDAP, SSH, Telnet, WinRM} |
If |
Transport layer for password changer. |
|
number {0 - 2147483647} |
If |
Scriptโs execution time limit expressed in seconds. Value-range: 0 to 2147483647. |
|
boolean |
Read-only; expensive to use; if |
|
|
boolean |
Read-only; expensive to use; if |
|
|
datetime |
Read-only. Timestamp of creation. |
|
|
datetime |
Read-only. Timestamp of modification. |
|
|
boolean |
Read-only. |
Retrieve Available Attributes of the PasswordChangerModelยถ
Request
Method |
|
Path |
|
To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.
Get Password Changers Listยถ
Request
Method |
|
Path |
|
Example Request
GET /api/v2/password_changer`
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/password_changer'
Response
{
"result": "success",
"password_changer": [
{
"id": "1",
"type": "change",
"name": "Unix\/SSH changer",
"transport": "SSH",
"timeout": 300,
"builtin": true,
"hidden": false,
"created_at": "2024-06-10 05:59:22.99706-07",
"modified_at": "2024-06-10 05:59:22.99706-07"
},
{
"id": "2",
"type": "verify",
"name": "Unix\/SSH verifier",
"transport": "SSH",
"timeout": 300,
"builtin": true,
"hidden": false,
"created_at": "2024-06-10 05:59:22.997876-07",
"modified_at": "2024-06-10 05:59:22.997876-07"
}
]
}
Get Password Changer by IDยถ
Request
Method |
|
Path |
|
Example Request
GET /api/v2/password_changer/<id>`
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/password_changer/1'
Response
{
"password_changer": {
"id": "1",
"name": "Unix\/SSH changer",
"type": "change",
"transport": "SSH",
"timeout": 300,
"variables": [
{
"name": "transport_bind_ip",
"description": "An IP on Fudo interface that will be used as source address.",
"object_type": "server",
"object_property": "bind_ip",
"encrypted": false,
"optional": true,
"transport": true,
"value": {
"value_type": "self"
}
},
{
"name": "transport_host",
"description": "An address to which password changer\/verifier connects.",
"object_type": "server",
"object_property": "address",
"encrypted": false,
"optional": false,
"transport": true,
"value": {
"value_type": "self"
}
}
],
"commands": [
{
"type": "expected",
"value": "Last login:",
"description": null
},
{
"type": "input",
"value": "passwd %%account_login%%",
"description": null
}
],
"builtin": true,
"hidden": false,
"created_at": "2024-06-10 05:59:22.99706-07",
"modified_at": "2024-06-10 05:59:22.99706-07"
},
"result": "success"
}
Defining Password Changerยถ
Request
Method |
|
Path |
|
Headers |
|
Body |
|
Example Request
POST /api/v2/password_changer`
curl -s -k -X POST \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.0.214.98/api/v2/password_changer' \
-d'{"name":"Password_Changer_WinRM","type":"change","transport":"WinRM","timeout":1000,"commands":[{"type":"input","value":"net user \"%%account_login%%\" \"%%account_new_secret%%\"","description":"Description text."}]}'
Response
{
"password_changer": {
"id": "9124292845052624933"
},
"result": "success"
}
Modify Password Changerยถ
Request
Method |
|
Path |
|
Headers |
|
Body |
|
Example Request: Change Basic Properties
PATCH /api/v2/password_changer/<id>`
curl -s -k -X PATCH \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.0.214.98/api/v2/password_changer/9124292845052624927' \
-d'{"type":"verify","transport":"SSH","timeout":1000}'
Example Request: Modifying Commands
PATCH /api/v2/password_changer/<id>`
curl -s -k -X PATCH \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.0.214.98/api/v2/password_changer/9124292845052624933' \
-d'{"commands":[{"type":"input","value":"net user \"%%account_login%%\" \"%%account_new_secret%%\"","description":"Description."}]}'
Example Request: Adding Variable
PATCH /api/v2/password_changer/<id>`
curl -s -k -X PATCH \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.0.214.98/api/v2/password_changer/9124292845052624933' \
-d'{"variables":[{"name":"transport_bind_ip","object_type":"server","object_property":"name","value":{"value_type":"self"}}]}'
Response
{
"result": "success"
}
Triggering Password Change for the Accountยถ
Request
Method |
|
Path |
|
Example Request
POST /api/v2/account/<id>/trigger_password_changer`
curl -s -k -X POST \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/account/9124292845052624908/trigger_password_changer'
Response
{
"result": "success"
}
Deleting Password Changerยถ
Request
Method |
|
Path |
|
Example Request
DELETE /api/v2/password_changer/<id>`
curl -s -k -X DELETE \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/password_changer/9124292845052624927'
Response
{
"result": "success"
}