In CyberArk Privileged Access Management (PAM), the Central Policy Manager (CPM) is responsible for:
Password Rotation
Password Verification
Reconciliation
But what if your target system is not supported out-of-the-box?
π That’s where CPM Plugins come into play.
A CPM Plugin is a custom-developed integration that allows CyberArk to:
Connect to unsupported systems
Verify passwords
Change passwords
Reset credentials (Reconcile)
π Built using:
C# (.NET SDK) (Recommended)
PowerShell / Python (limited cases)
This is the #1 interview + real-world question π₯
Managing Local Website Accounts
Managing Custom Applications
Managing Unsupported OS / Systems
No plugin available in Marketplace
π You are accessing AWS / Web App using Domain Account
β Use:
Windows Domain Platform
PSM Web Connector
π No CPM plugin needed β
| Scenario | CPM Plugin Required? |
|---|---|
| Domain account → website | β No |
| Local website account | β Yes |
| Custom application | β Yes |
| No API / No automation | β Impossible |
Before coding, ask:
π Can password be changed programmatically?
β OTP required → FAIL
β No API / UI automation → FAIL
If system cannot be automated, CPM plugin will NOT work.
CyberArk Vault → CPM → Plugin DLL → Target System
↓
Verify / Change / Reconcile
↓
Return Status
Download:
π https://visualstudio.microsoft.com/downloads/
β Select:
.NET Desktop Development
C:\Program Files (x86)\CyberArk\Password Manager\bin
Add references:
CyberArk.Extensions.Utilties.dll
CyberArk.Extensions.Plugins.Models.dll
Open Visual Studio
Create New Project
Select:
π Class Library (.NET Framework)
Name:
SecAppsCPMPlugin
using System.Collections.Generic;
using CyberArk.Extensions.Plugins.Models;
using CyberArk.Extensions.Utilties;
namespace SecAppsCPMPlugin
{
public abstract class BaseAction : AbsAction
{
public BaseAction(List accountList, ILogger logger)
: base(accountList, logger)
{
}
protected string GetPassword(System.Security.SecureString secStr)
{
return new System.Net.NetworkCredential("", secStr).Password;
}
}
}
using System;
using System.Collections.Generic;
using CyberArk.Extensions.Plugins.Models;
namespace SecAppsCPMPlugin
{
public class VerifyAction : BaseAction
{
public VerifyAction(List accountList, ILogger logger)
: base(accountList, logger)
{
}
public override CPMAction ActionName
{
get { return CPMAction.verifypass; }
}
public override int run(ref PlatformOutput platformOutput)
{
try
{
string username = TargetAccount.AccountProp["username"];
string address = TargetAccount.AccountProp["address"];
string password = GetPassword(TargetAccount.CurrentPassword);
Logger.Info($"Verifying {username} at {address}");
if (!string.IsNullOrEmpty(password))
{
platformOutput.Message = "Verify successful";
return 0;
}
platformOutput.Message = "Invalid password";
return 8801;
}
catch (Exception ex)
{
platformOutput.Message = "Verify failed: " + ex.Message;
return 8800;
}
}
}
}
using System;
using System.Collections.Generic;
using CyberArk.Extensions.Plugins.Models;
namespace SecAppsCPMPlugin
{
public class ChangeAction : BaseAction
{
public ChangeAction(List accountList, ILogger logger)
: base(accountList, logger)
{
}
public override CPMAction ActionName
{
get { return CPMAction.changepass; }
}
public override int run(ref PlatformOutput platformOutput)
{
try
{
string username = TargetAccount.AccountProp["username"];
string address = TargetAccount.AccountProp["address"];
string oldPassword = GetPassword(TargetAccount.CurrentPassword);
string newPassword = GetPassword(TargetAccount.NewPassword);
Logger.Info($"Changing password for {username}");
bool success = true;
if (success)
{
platformOutput.Message = "Password changed successfully";
return 0;
}
platformOutput.Message = "Password change failed";
return 8802;
}
catch (Exception ex)
{
platformOutput.Message = "Change failed: " + ex.Message;
return 8800;
}
}
}
}
public class LogonAction : BaseAction
{
public LogonAction(List accountList, ILogger logger)
: base(accountList, logger)
{
}
public override CPMAction ActionName
{
get { return CPMAction.logon; }
}
public override int run(ref PlatformOutput platformOutput)
{
platformOutput.Message = "Logon successful";
return 0;
}
}
π Build Solution
Output:
bin\Debug\SecAppsCPMPlugin.dll
Plugin DLL
CANetPluginInvoker.exe
Required DLLs
[targetaccount]
username=admin1
password=OldPass123
newpassword=NewPass123
address=secappslearning.com
safename=TestSafe
objectname=admin1
PolicyID=TestPlatform
CANetPluginInvoker.exe user.ini verifypass SecAppsCPMPlugin.dll true
CANetPluginInvoker.exe user.ini changepass SecAppsCPMPlugin.dll true
C:\Program Files (x86)\CyberArk\Password Manager\bin
Add plugin DLL name
CyberArk Password Manager
β Verify Password
β Change Password
Check:
CPM Logs
PVWA Audit
β Never hardcode passwords
β Always use ILogger
β Use proper return codes
β Test manually first
β Wrong platform
β No API support
β Ignoring workflow
β OTP-based systems
When do you create CPM plugin?
Difference between Change & Reconcile?
What if OTP required?
How to test plugin manually?
What is BaseAction?
π Coding is easy
π Understanding the system is everything
“If target system cannot be automated, CPM plugin will fail.”
Your email address will not be published. Required fields are marked*
Copyright 2022 SecApps Learning. All Right Reserved
Comments ()