CPM - How to correctly configure Config File usages
103
Created On 11/10/26 11:00 AM - Last Modified 11/10/26 16:04 PM
Objective
Currently, there are four 'config file' usage CPM plugins available in the Idira Marketplace; INI Configuration File, Text Configuration File, Web Configuration File, and XML Configuration File (you may notice that newer versions of these plugins no longer include the word "configuration"). When setting up these usages, certain parameters, such as the file path and target address, are simple. However, configuring the correct values for other parameters such as XML Element, XML Attribute, Password Regex, or INI Parameter Name, is not always an easy task.
Depending on the misconfiguration, as well as whether you are reviewing the error in PVWA or in the debug log, you may see errors such as the following:
- Failure : Change process failed - Falied to set the value on target XML file. Review the log for more information.
- Received exception: System.InvalidOperationException: The XPath expression evaluated to unexpected type System.Xml.Linq.XAttribute.
Environment
Privileged Access Manager (PAM, self-hosted);Privilege Cloud Central Policy Manager (CPM)
Procedure
First, ensure you are using the latest config file platform from the Marketplace. It can be found HERE.
NOTE: As previously stated, Idira currently provides four different config file CPM usage plugins. While each one functions the same and utilizes the same dependencies (each use CyberArk.Extensions.PasswordFile.dll and CANetPluginInvoker.exe), they're still technically different usages. Each has their own individual policy file and each uses slightly different sets of UI Properties. Updating one usage will not update the others.
Next, see below for various sample files, as well as their valid parameters:
Sample Text File usage:
<ExampleConfiguration> <ExampleSettings> <add key="Example1" value="ExampleValue1=SQL; Initial catalog=ExampleCatalog;Data Source=1.1.1.1;User ID=ExampleUser;Password=ExamplePassword;"/> <add key="Example2" value="ExampleValue2" /> <add key="Example3" value="ExampleValue3" /> </ExampleSettings> </ExampleConfiguration>XML Element = /ExampleConfiguration/ExampleSettings/add[@key="Example1"]
XML Attribute = value
Password Regex = Password=(.*);
Sample XML File usage:
<?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrings> <add name="ExampleContext" connectionString="Data Source=hostname.database.windows.net;Initial Catalog=server;User Id=account@test.com;Password=NewPassword; Persist Security Info=False;Network Library=ABCDE;Packet Size=8192;Authentication=Active Directory Password" providerName="System.Data.SqlClient" /> </connectionStrings> </configuration>
XML Attribute = connectionString
Password Regex = (Password=.*?);
Sample Config File usage:
Include "C:\folder1\data\conf/ctf_httpd.conf" <VirtualHost *:443> SSLEngine On RewriteEngine on RewriteOptions inherit <Location /> AuthType Basic AuthBasicProvider file ldap AuthLDAPUrl "ldaps://somesite.com:636/DC=dc1,DC=com?sAMAccountName?sub?(objectClass=user)" "TLS" AuthLDAPBindDN "CN=ldpp_Cabc,OU=Bind Accounts,OU=Production,OU=Users,OU=Enterprise,DC=dc1,DC=com" AuthLDAPBindPassword "T3$tP@5sw0rd" LDAPReferrals Off AuthUserFile "C:\folder1\data\conf/svn_auth_file" Require valid-user </Location> <Directory "C:\folder1\www\viewvc/docroot"> AllowOverride None Options None </Directory> <Location /viewvc-static> Require all granted </Location> Alias /viewvc-static "D:\folder1\www\viewvc/docroot" </VirtualHost>Password Regex = AuthLDAPBindPassword "(.*)"
Sample INI File usage:
; Device level parameters ; [DEVICE1] UseTheseDomainSizes=1 UseCounts=0 OneCoilWrite=0 OneRegWrite=0 ConservesConn=1 ConnSecondary=0 COILS=65535 DISC INPUTS=65535 INPUT REG.=65535 HOLDING REG.=65535 GEN REF FILE1=0 GEN REF FILE2=0 GEN REF FILE3=0 DP_INPUT REG.=0 DP_HOLDING REG.=0 UID=testuser Password=testpassword [DEVICE2] UseTheseDomainSizes=1 UseCounts=0 OneCoilWrite=0 OneRegWrite=0 ConservesConn=1 ConnSecondary=0 COILS=65535 DISC INPUTS=65535 INPUT REG.=65535 HOLDING REG.=65535 GEN REF FILE1=0 GEN REF FILE2=0 GEN REF FILE3=0 DP_INPUT REG.=0 DP_HOLDING REG.=0INI Section: DEVICE1
INI Parameter Name: Password