Searching for SSH devices
Problem
You want to find a device.
Solution
You can use a search pattern to find SSH devices and then get the policy details.
Time Estimate
About 30 mins
To search for SSH devices
-
Reuse or create a bearer token that includes the scope ssh:manage. The bearer token grants your client access to Trust Protection Platform.
To get a bearer token, see Getting a token. For each subsequent API call, be sure to include the token in the request header. -
Call POST SSH/Devices and a search pattern of device_name. The response is one or more Device objects that describe a computer or other hardware. For example:
CopyJSONPOST https://tpp.venafi.example/vedauth/authorize/oauth
{
"client_id": "MyClient",
"username": "local:admin",
"password": "MyPassword!",
"scope": "ssh;configuration"
}
And
POST https://tpp.venafi.example/vedsdk/SSH/Devices
Authorization:Bearer 4MyGeneratedBearerTknz==
{
"PageSize":20,
"Offset":0,
"SshDeviceFilter":{
"DeviceName":[
"device_name"
]
}
} -
(Optional) To show policy and other information, iterate through the response from the previous step. Use the DN response value as the ObjectDN for POST Config/ReadEffectivePolicy. For example:
CopyJSON
POST https://tpp.venafi.example/vedsdk/Config/ReadEffectivePolicy
{
"ObjectDN":"\\VED\\Policy\\Certificates\\device_name",
"AttributeName":"Host",
"Class":"Device"
}
}
Clean up and go home
- The token grants access until it expires. When your client application finishes, you can delete the token.
CopyJSON
POST https://tpp.venafi.example/vedauth/Revoke/Token
Authorization:Bearer 4MyGeneratedBearerTknz==
{
"PageSize":20,
"Offset":0,
"SshDeviceFilter":{
"DeviceName":[
"device_name"
]
}
}