Implement AIM CP for hardcoded creds in xml config files

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Implement AIM CP for hardcoded creds in xml config files

L4 Transporter

Hi,

 

We have java applications that uses Hybernate technology. Hybernate has .xml config files which has DB connection information, can we implement AIM CP to eliminate hard-coded credentials ?

 

if so, how can we coded existing xml file to make a call to AIM CP.

 

thank you

 

4 REPLIES 4

L5 Sessionator

@Anurag .​ There are multiple ways we can do this. I'm thinking of using the below approach

The below link has the working code for replacing values of an xml element <name>.

 

https://www.rgagnon.com/javadetails/java-0625.html

 

What you can do, first make sure you are able to replace an element value of a given sample xml file(data.xml). I've tested in my lab and its working fine. a small modification in the below line. (Note: keep input and file name as data.xml)

 

 NodeList nodes = (NodeList)xpath.evaluate("//employee/name[text()]", doc, XPathConstants.NODESET);

 

Second, please make a java sdk call to your vaulted password : example given in the below link. You can modify and keep it ready in separate java module/function

https://cyberarkdocu.azurewebsites.net/Product-Doc/OnlineHelp/AIM/Latest/en/Content/CP%20and%20ASCP/...

 

Third, call your java module inside the nodes.item(idx).setTextContent(call your java module());

 

Test and validate!!!

L7 Applicator

You might not even need AIM for that. You can add a so-called "Usage" or "Service account platform" to an account in the Vault, and the CPM will update the password in the "Usage" whenever the associated account is changed. Usages can be config files, windows services, IIS app pools... and XML files! More info here: https://cyberarkdocu.azurewebsites.net/Product-Doc/OnlineHelp/PAS/Latest/en/Content/PASIMP/AccountsStoredInConfigurationFiles.htm?Highlight=xml

L5 Sessionator

Hi @Anurag .​ , Yes I agree with @Bernhard Brückler​ and thats very straightforward.. There is an existing solution article you can refer

 

https://community.cyberark.com/s/article/00004750

 

 

@Bernhard Brückler​ Thank you ! but however my goal to remove hard-coded creds from config files is not solved if i use "usage or service account paltform."

  • 479 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!