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ยถ

PasswordChangerModelยถ

Attribute

Type

Required

Description

id

string

Read-only, unique password change identifier.

type

string {change, verify}

yes

Password changer type.

name

string

yes

Unique, case-insensitive password changer name.

transport

string {LDAP, SSH, Telnet, WinRM}

If type == change || verify

Transport layer for password changer.

timeout

number {0 - 2147483647}

If type == change || verify

Scriptโ€™s execution time limit expressed in seconds. Value-range: 0 to 2147483647.

builtin

boolean

Read-only; expensive to use; if true, the object is not editable.

hidden

boolean

Read-only; expensive to use; if true, the object is hidden in UI.

created_at

datetime

Read-only. Timestamp of creation.

modified_at

datetime

Read-only. Timestamp of modification.

removed

boolean

Read-only.

Retrieve Available Attributes of the PasswordChangerModelยถ

Request

Method

GET

Path

/api/v2/objspec/password_changer

To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.


Get Password Changers Listยถ

Request

Method

GET

Path

/api/v2/password_changer

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

GET

Path

/api/v2/password_changer/<id>

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

POST

Path

/api/v2/password_changer

Headers

Content-Type: Application/json

Body

PasswordChangerModel

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

PATCH

Path

/api/v2/password_changer/<id>

Headers

Content-Type: Application/json

Body

PasswordChangerModel

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

POST

Path

/api/v2/account/<id>/trigger_password_changer

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

DELETE

Path

/api/v2/password_changer/<id>

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"
}