Credential Management
Various Orion processes (discovery, polling) work with credentials that are stored in Orion. This page describes how to manage credentials using Orion SDK.
Verbs
The Orion.Credential entity provides following verbs to create Orion credentials. Parameters are listed in C# syntax.
Create SNMP v1 and v2c credentials
public long CreateSNMPCredentials(
string name,
string community,
string owner = "Orion")
Parameters:
name- credentials name, requiredcommunity- community string, requiredowner- credential owner, optional
Verb returns ID of the newly created Orion.Credential instance. Credential name must be unique for given credential type, exception is thrown otherwise.
Supported since: Orion Platform 2017.3 (NPM 12.2)
Example:
# create SNMP credentials with name=custom, community=RO_permanent
# credentialId can be used in discovery plugin configuration
$credentialId = Invoke-SwisVerb $swis Orion.Credential CreateSNMPCredentials @( "custom", "RO_permanent" )
Update SNMP v1 and v2c credentials
void UpdateSNMPCredentials(int credentialId,
string name,
string community)
Parameters:
credentialId- ID of the credential to update (must be an SNMP v1/v2c credential)name- name to set for the credential (must not be empty)community- community string to set for the credential
Supported since Orion Platform 2018.4 (NPM 12.4)
Create SNMP v3 credentials
public long CreateSNMPv3Credentials(
string name,
string username,
string context,
string authenticationMethod, string authenticationPassword, bool isAuthenticationPasswordKey,
string privacyMethod, string privacyPassword, bool isPrivacyPasswordKey,
string owner = "Orion")
Parameters:
name- credentials name, requiredusername- username, requiredcontext- context, requiredauthenticationMethod- authentication method (None, MD5, SHA1), requiredauthenticationPassword- authentication password, value can be empty for authentication method None, requiredauthenticationKeyIsPassword- is authentication key password (True, False), requiredprivacyMethod- privacy method (None, DES56, AES128, AES192, AES256), requiredprivacyPassword- privacy password, value can be empty for privacy method None, requiredprivacyKeyIsPassword- is privacy key password (True, False), requiredowner- credential owner, default value = Orion, optional
Verb returns ID of the newly created Orion.Credential instance. Credential name must be unique for given credential type, exception is thrown otherwise.
Supported since: Orion Platform 2017.3 (NPM 12.2)
Update SNMP v3 credentials
void UpdateSNMPv3Credentials(
int credentialId,
string name,
string username,
string context,
string authenticationMethodValue,
string authenticationPassword,
bool authenticationKeyIsPassword,
string privacyMethodValue,
string privacyPassword,
bool privacyKeyIsPassword)
Parameters:
credentialId- ID of the credential to update (must be an SNMP v1/v2c credential)name- name to set for the credential (must not be empty)username- username, requiredcontext- context, requiredauthenticationMethodValue- authentication method (None, MD5, SHA1), requiredauthenticationPassword- authentication password, value can be empty for authentication method None, requiredauthenticationKeyIsPassword- is authentication key password (True, False), requiredprivacyMethodValue- privacy method (None, DES56, AES128, AES192, AES256), requiredprivacyPassword- privacy password, value can be empty for privacy method None, requiredprivacyKeyIsPassword- is privacy key password (True, False), required
Supported since Orion Platform 2018.4 (NPM 12.4)
Create UserPassword (WMI) credentials
These credentials are applicable for WMI discovery configuration.
public long CreateUsernamePasswordCredentials(
string name,
string username,
string password,
string owner = "Orion")
Parameters:
name- credentials name, requiredusername- username, requiredpassword- password, requiredowner- credential owner, default value = Orion, optional
Verb returns ID of the newly created Orion.Credential instance. Credential name must be unique for given credential type, exception is thrown otherwise.
Example:
# create WHMI credentials guest/guest with name=custom
# credentialId can be used in discovery plugin configuration
$credentialId = Invoke-SwisVerb $swis Orion.Credential CreateUsernamePasswordCredentials @( "custom", "guest", "guest" )
Update UserPassword (WMI) credentials
void UpdateUsernamePasswordCredentials(
int credentialId,
string name,
string username,
string password)
Parameters:
credentialId- ID of the credential to update (must be an SNMP v1/v2c credential)name- name to set for the credential (must not be empty)username- username to set for the credentialpassword- password to set for the credential
Supported since Orion Platform 2018.4 (NPM 12.4)
Shared Credentials Verbs
Shared credentials verbs allow managing credentials of different types. The SolarWinds Platform 2022.4 introduced two verbs for managing shared credentials: CreateCredentials and UpdateCredentials; these verbs support most common credential types.
See the table below for the full list of supported credential types.
Verb: CreateCredentials
Orion.Credential CreateCredentials (string type, Dictionary<string, string> properties, string owner)
Use this verb to create a credential set of a given type. Requires the following parameters:
type- corresponds to theCredentialTypeproperty of Orion.Credential entity; see the table below for all available formatsProperties- configuration of the credential set listed in the form of a dictionary; see the table below for all example configurationsOwner- same asCredentialOwnerproperty of Orion.Credential entity; see the table below for all available values.
To prevent potential issues, the verb does not allow you to create duplicates. The following arguments determine that the credential set is unique: Name, which is read from the Properties parameter, & Type & Owner.
Note: The Type and Owner properties of the credential set cannot be changed afterward.
Supported since: SolarWinds Platform 2022.4
Verb: UpdateCredentials
Orion.Credential UpdateCredentials (int id, Dictionary<string, string> properties)
Use this verb to update an already existing credential set of a given type. Requires the following arguments:
ID- corresponds to theIDproperty of Orion.Credential entity; an ID of an existing credential set to be updatedProperties- configuration of the credential set listed in the form of a dictionary; see the table below for all example configurations.
Supported since: SolarWinds Platform 2022.4
Supported credential types and example properties
The following table lists all supported credential types, their default owners, and example properties (in the format applicable for invoking the verbs in SWQL Studio).
Note: The first two keys <Key>Name</Key> and <Key>Description</Key> are properties of the credentials set itself and are not part of the credentials data (e.g. username, password).
Properties
\<ArrayOfKeyValueOfstringstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" \>\<KeyValueOfstringstring\>\<Key\>Name\</Key\>\<Value\>UserPass_credset\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Description\</Key\>\<Value\>UserPass_description\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Username\</Key\>\<Value\>UserPass_username\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Password\</Key\>\<Value\>UserPass_username\</Value\>\</KeyValueOfstringstring\>\</ArrayOfKeyValueOfstringstring\>Properties
\<ArrayOfKeyValueOfstringstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" \>\<KeyValueOfstringstring\>\<Key\>Name\</Key\>\<Value\>SAMUserPass_credset\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Description\</Key\>\<Value\>SAMUserPass_desc\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Username\</Key\>\<Value\>UserPass_username\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Password\</Key\>\<Value\>UserPass_password\</Value\>\</KeyValueOfstringstring\>\</ArrayOfKeyValueOfstringstring\>Properties
\<ArrayOfKeyValueOfstringstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" \>\<KeyValueOfstringstring\>\<Key\>Name\</Key\>\<Value\>APIKey_credset\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Description\</Key\>\<Value\>APIKey_desc\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>ApiKeyName\</Key\>\<Value\>APIKey_tokenname\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>ApiKey\</Key\>\<Value\>APIKey_tokenvalue\</Value\>\</KeyValueOfstringstring\>\</ArrayOfKeyValueOfstringstring\>Properties
\<ArrayOfKeyValueOfstringstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" \>\<KeyValueOfstringstring\>\<Key\>Name\</Key\>\<Value\>SMTP_credset\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Description\</Key\>\<Value\>SMTP_desc\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Username\</Key\>\<Value\>SMTP_username\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Password\</Key\>\<Value\>SMTP_password\</Value\>\</KeyValueOfstringstring\>\</ArrayOfKeyValueOfstringstring\>Properties
\<ArrayOfKeyValueOfstringstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" \>\<KeyValueOfstringstring\>\<Key\>Name\</Key\>\<Value\>SNMPv3_credset\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Description\</Key\>\<Value\>SNMPv3_desc\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>UserName\</Key\>\<Value\>SNMPv3_username\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>Context\</Key\>\<Value\>SNMPv3_context\</Value\>\</KeyValueOfstringstring\>\<KeyValueOfstringstring\>\<Key\>PrivacyType\</Key\>\<Value\>AES128\</Value\>\
</body>
</html>