White Papers
Abstract
Sample CyberArk credential vault user exit integration with Content Manager Java Connector API. This exit was added in version 8.6 fix pack 3.
Content
To use a credential vault user exit you must:
- implement the
com.ibm.mm.sdk.common.dkCredentialVaultUserExitICMContent Manager API interface. Add the
@CyberArkGetPassword keyword above your class definition for CyberArk hash generation. - create a
.jarfile that contains the credential vault user exit. The exit will be built with a Java JDK, the JavaPasswordSDK.jar from the CyberArk Credential Provider, and the Content Manager Java Connector API. - Generate a authentication hash using the CyberArk JavaAIMGetAppInfo utility against the created credential vault user exit .jar file. Add the hash to the CyberArk administration application authentication tab.
- add this
.jarfile along with the CyberArk JavaPasswordSDK.jar to the classpath.
The CyberArk credential vault user exit maps a CM server identifier and a CyberArk object and password to a mapped database userid and password that are used by Content Manager. The server identifier, credential vault user exit class, and credential vault indicator are stored in either the cmbicmsrvs.ini file or passed into the CM API in the connect string.
- When calling a CyberArk credential password vault, the server identifier must be passed, so that it knows what mapped database userid and password should be returned to the Content Manager API.
- If the credential vault user exit cannot be loaded or throws an exception, the Content Manager API throws a DKUsageError exception to indicate that there is an error in the credential vault user exit.
- If the credential vault user exit
getCredentialData(String,String,String,DKNVPair[])method returns an empty userid for DKNVPair value ofDKConstantICM.DK_ICM_PARM_CRED_VAULT_USERIDor an empty password for DKNVPair value ofDKConstantICM.DK_ICM_PARM_CRED_VAULT_AUTH, the Content Manager API throws a DKUsageError exception. With the sample below, this would only happen if CyberArk returns a blank userid or password. - If the credential vault exit
getCredentialData(String,String,String,DKNVPair[])method cannot find the credential information for the specified server identifier, it returns a null or empty array to the Content Manager API. This will cause the API to proceed with database authentication using the userid and password specified by the caller, no mapping is done.
Setting up the CyberArk credential vault exit
- Implement the
com.ibm.mm.sdk.common.dkCredentialVaultUserExitICMinterface for the credential vault user exit class (Example:com.mycomp.MyCyberArkUserExitEX). Add the @CyberArkGetPassword keyword above your class definition for CyberArk hash generation. - Create a
.jarfile that contains the implemented credential vault user exit class - Generate a authentication hash using the CyberArk JavaAIMGetAppInfo utility against the created credential vault user exit .jar file. Add this hash to the CyberArk application authentication. (Example: Lets say the created credential vault user exit .jar file is called MyCyberArkCM.jar which contains com.mycomp.MyCyberArkUserExitEX class and is located in the C:\cyberarkCM directory. If the user opens a command window, runs cmbenv81.bat, make sure that java is setup in that window and run java -jar C:\PROGRA~2\CyberArk\ApplicationPasswordProvider\Utils\JavaAIMGetAppInfo.jar GetHash /AppExecutablesPattern=c:\cyberarkCM /ClassPath="c:\IBM\db2cmv8\lib;c:\cyberarkCM" /OnlyExecutablesWithAIMAnnotation=yes /OutputDelimiter=";" /LogFileDirectory="C:\cyberarkCM\log" which will generate a CyberArk hash for the class MyCyberArkUserExitEX in the MyCyberArkCM.jar. Add the hash to the CyberArk administration application authentication tab).
- Add the
exit .jarfile and the associated.jarfiles that are needed by the exit to the classpath. - Update the
cmbicmsrvs.inifile with the following settings for each server where the user exit needs to be applied:
ICMCREDVAULT=TRUE
ICMCREDVAULTSERVERID=APPID=MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root ICMCREDVAULTUSEREXITCLASSNAME=com.mycomp.MyCyberArkUserExitEX
Note: APPID, SAFE and FOLDER keywords in the ICMCREDVAULTSERVERID option must be in uppercase. - Create a DKDatastoreICM.
- To log in by using a system database id (for example, an id that is mapped to
icmadmin), connect by using the mapped credential vault userid (CyberArk Object) and password. - To login by using a Content Manager id that is not a database id, make sure that the
cmbicmenv.inifile contains the mapped credential vault userid (CyberArk Object) and password.
Example scenarios
- Open a command window and make sure the java JDK has been configured for this window.
- Run cmbjavaenv c:\jdk1.8.0x64 c:\xerces-2_12_0 c:\xalan-j_2_7_2 (CMv8 Connector setup).
- Add CyberArk JavaPasswordSDK.jar to CLASSPATH.
- Create a directory to hold the java user exit. C:\CyberArkUserExit\com\mycomp and add C:\CyberArkUserExit to CLASSPATH.
- Download MyCyberArkUserExitEX.java into the C:\CyberArkUserExit\com\mycomp directory.
- Compile CyberArk user exit (MyCyberArkUserExitEX.java).
- Create a temp directory that contains the classfile for the user exit. C:\CyberArkUserExitTmp\com\mycomp\MyCyberArkUserExitEX.class.
- Create a jar file for everything under C:\CyberArkUserExitTmp which will contain the user exit.
- Open a command window and make sure java JDK has been configured for this window.
- Run cmbjavaenv c:\jdk1.8.0x64 c:\xerces-2_12_0 c:\xalan-j_2_7_2 (CMv8 Connector setup)
- Add CyberArk JavaPasswordSDK.jar to CLASSPATH.
- Add CyberArk user exit jar file created above to CLASSPATH.
- Once cmbicmsrvs.ini and cmbicmenv.ini are setup you can connect to CyberArk as described in the examples below.
- You could use the SConnectDisconnectICM.java sample provided with CM to test this.
The following example scenarios use these userids and passwords:
Note: CyberArk user exit example can use any non empty string for the password passed to the datastore. This user exit example will ignore this value because CyberArk uses a CyberArk object along with the information in the serverid for authentication.
| IBM Content Manager userids and passwords for the IBM Content Manager database (icmnlsdb) | CyberArk userids (CyberArk Object) and passwords for serverid: APPID=MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root |
|---|---|
icmadmin/password1 (system id/database id) |
Application-CyberArk-CM-icmadmin/password5 |
icmconct/ password2 (system id/database id) |
Application-CyberArk-CM-icmconct/ password6 |
user1/password3 |
|
user2/password4 |
|
Credential vault mapping in vault
Serverid CyberArk Object/pw Content Manager userid/pw
|
||
|---|---|---|
| APPID=MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root | Application-CyberArk-CM-icmadmin/password5 |
icmadmin/password1 |
| APPID=MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root | Application-CyberArk-CM-icmconct/password6 |
icmconct/password2 |
The cmbicmenv.ini file contains icmnlsdb (userid Application-CyberArk-CM-icmconct and password password6). The user logs in by using Application-CyberArk-CM-icmadmin and password5 when the user wants to login for icmadmin/password1.
Scenario 1 - admin user with ID stored in the vault - Rep type DB2
This scenario uses a cmbicmsrvs.ini file like this:
ICMSERVER=icmnlsdb
ICMSERVERREPTYPE=DB2
ICMSCHEMA=ICMADMIN
ICMSSO=FALSE
ICMDBAUTH=SERVER
ICMREMOTE=FALSE
ICMHOSTNAME=mufasa
ICMPORT=50000
ICMREMOTEDB=icmnlsdb
…
ICMCREDVAULT=TRUE
ICMCREDVAULTSERVERID=APPID=MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root
ICMCREDVAULTUSEREXITCLASSNAME=com.mycomp.MyCyberArkUserExitEX
- DKDatastoreICM connects to
icmnlsdbby usingApplication-CyberArk-CM-icmadmin/password5. - The datastore tries to get the database userid and password from the credential vault user exit (that is,
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root.The exit returns the database userid and password (that is,
icmadminandpassword1). -
The datastore logs into the database by using the database userid and password, and then passes the database id (
icmadmin/password1) to the library server login stored procedure.
Scenario 2 - non-admin user that uses the CM connect ID - Rep type DB2
This scenario uses the same cmbicmsrvs.ini file as Scenario 1.
- DKDatastoreICM connects to
icmnlsdbby usinguser1/password3. - The datastore tries to gets the database userid and password from the credential vault user exit (
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root.The exit does not return any items because
user1is not in the credential vault because this user connects to the database with the CM connect userid. - The datastore logs into the database by using the input userid and password (that is,
user1andpassword3). This fails. This logon is tried first because ICMSERVERREPTYPE is set to DB2 and not DB2CON. - The datastore reads the credential vault connect userid and password from the
cmbicmenv.inifile (that is,Application-CyberArk-CM-icmconctandpassword6). - The datastore tries to get the database userid and password from the credential vault user exit (that is,
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root.The exit returns the database userid and password (that is,
icmconctandpassword2). - The datastore logs into the database by using the database userid and password, and then passes the CM userid (that is,
user1andpassword3) to the library server login stored procedure.
Scenario 3 - admin user with ID stored in the vault - Rep type DB2CON
This scenario uses a cmbicmsrvs.ini file like this:
ICMSERVERREPTYPE=DB2CON
ICMSCHEMA=ICMADMIN
ICMSSO=FALSE
ICMDBAUTH=SERVER
ICMREMOTE=FALSE
ICMHOSTNAME=mufasa
ICMPORT=50000
ICMREMOTEDB=icmnlsdb
…
ICMCREDVAULT=TRUE
ICMCREDVAULTSERVERID=APPID=MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root
ICMCREDVAULTUSEREXITCLASSNAME=com.mycomp.MyCyberArkUserExitEX
- DKDatastoreICM connects to icmnlsdb by using
Application-CyberArk-CM-icmadmin/password5. - It reads the credential vault connect userid and password from the
cmbicmenv.inifile (that is,Application-CyberArk-CM-icmconctandpassword6). - The datastore tries to get the database userid and password from the credential vault user exit (
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root.The exit returns the database userid and password (that is,
icmconctandpassword2). - The datastore logs into the database by using the database userid and password.
- The datastore gets the database userid and password from the credential vault user exit (
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root forApplication-CyberArk-CM-icmadmin/password5.The exit returns the database userid and password (that is,
icmadminandpassword1). - The datastore passes the database userid and password (that is,
icmadminandpassword1) to the library server login stored procedure. This fails. - The datastore logs off from the database.
- The datastore logs into the database by using the database userid and password (that is,
icmadminandpassword1), and then passes that database userid and password to the library server login stored procedure.
Scenario 4 - non-admin user that uses the CM connect ID - Rep type DB2CON
This scenario uses the same cmbicmsrvs.ini file as Scenario 3.
- DKDatastoreICM connects to
icmnlsdbby usinguser1andpassword3. - The datastore reads the credential vault connect userid and password from the
cmbicmenv.inifile (that is,Application-CyberArk-CM-icmconctandpassword6). - The datastore tries to get the database userid and password from the credential vault user exit (
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root.The exit returns the database userid and password (that is,
icmconctandpassword2). - The datastore logs into the database with the database userid and password.
- The datastore tries to get the database userid and password from the credential vault user exit (
com.mycomp.MyCyberArkUserExitEX) by using serverid MyComp-ApplEX1;SAFE=SafeEX1;FOLDER=Root foruser1andpassword3.The exit does not return any items because
user1is not in the credential vault. - The datastore passes the IBM Content Manager userid and password (that is,
user1andpassword3) to the library server login stored procedure.
Related Information
Was this topic helpful?
Document Information
Modified date:
01 September 2020
UID
ibm16116272