Chef is a ruby-based configuration management tool that provides a way to define infrastructure as code (IAC) wherein managing infrastructure is made simple through writing code rather than using manual processes. Chef operates using a Client-Server architecture. The PAM360 lookup plugin developed for Chef helps improve security and ease of Password Management in an organization's DevOps pipeline. Once imported into Chef, the PAM360 plugin can fetch credentials and account information directly from the PAM360 vault during Chef cookbook runtime, thus eliminating the need to use hard-coded credentials. Upon secure retrieval, the credentials can then be used for actions such as connecting to a remote host. The credentials stored in PAM360 are regularly rotated in the vault and also updated in the respective remote device; this ensures that only the latest passwords or keys are retrieved from the vault when the Chef plugin is invoked.
Puppet is a ruby-based configuration management tool similar to Chef. Puppet also operates using a Client-Server architecture in which the Master and Slave communicate through a secure encrypted channel with the help of SSL. Puppet is mainly used for deploying, configuring and managing servers. Similar to Chef, the PAM360 lookup plugin can retrieve passwords from PAM360's vault when invoked.
Click on the respective links to learn more about Chef and Puppet.
At the end of this document, you will have learned about the following topics:
The following are the steps to set up and manage sensitive credentials in Chef with PAM360.

Caution
Ensure that the PAM360 user account you provide has the minimum required permissions for this workflow i.e. privilege to view/retrieve the passwords of resources which Chef has to connect to. The passwords of resources owned by and shared to this user are the only credentials that Chef will have access to in PAM360.
Import PAM360's ruby gem into your Chef cookbooks by executing the following steps:
syntax:gemData = PAM360Gem.new("Hostname","Auth token",Path,port number)gemData.getAccountPassword("resource name","account name")gemData.getAccountDetails("resource name","account name")The following are the steps to set up and manage sensitive credentials in Puppet with PAM360.

Caution
Ensure that the PAM360 user account you provide has the minimum required permissions for this workflow i.e. privilege to view/retrieve the passwords of resources which Puppet has to connect to. The passwords of resources owned by and shared to this user are the only credentials that Puppet will have access to in PAM360.
Import the PAM360's ruby gem into Puppet by executing the following steps:
syntax:gemData = PAM360Gem.new("Hostname","Auth token",Path,port number)getAccountPassword(resourceName,AccountName)
getAccountDetails(resourceName,AccountName)
The following are the sample input and output codes and the corresponding sample responses to fetch the account details using the PAM360 plugin. The sample codes remain the same for both Chef and Puppet.
Sample Input
gem 'PAM360_Gem'
require 'PAM360_Gem' gemData = PAM360Gem.new("localhost","060CCDB8-71A0-4B8B-AC57-XXXXX","/home/local/user/servercertificate")
# resourcename = Windows accountname = useraccount1
puts("resourcedetails\n")
result = gemData.getAccountDetails("Windows ","useraccount1"))
puts(result[0])
puts("accountdetails\n")
puts(result[1])Sample Output
resource details
{"RESOURCE_ID":1,"RESOURCE_NAME":"Windows","RESOURCE_DESCRIPTION":"","OPERATINGSYSTEM":"Windows","DNSNAME":"","DEPARTMENT":"","LOCATION":"","RESOURCE_URL":""}
account details
{"ACCOUNTNAME":"useraccount1","PASSWORD":"Test@123"}The following are the sample input and output codes and the corresponding sample responses to fetch the password using the PAM360 plugin. The sample codes remain the same for both Chef and Puppet.
Sample Input
gem 'PAM360_Gem'
require 'PAM360_Gem'
gemData = PAM360Gem.new("localhost","060CCDB8-71A0-4B8B-AC57-XXXXX","/home/local/user/servercertificate")
# resourcename = Windows accountname = useraccount1
puts("accountpassword\n")
puts(gemData.getAccountPassword("Windows ","useraccount1"Sample Output
accountpassword Test@123