PAM360 Plugins for Chef and Puppet9 minutes to read
Chef
Puppet
Sample Codes
Chef1. Introduction to ChefChef 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. 2. Steps to Set Up the PAM360 Plugin for ChefThe following are the steps to set up and manage sensitive credentials in Chef with PAM360.
2.1 Enabling Chef Integration in PAM360
2.2 Invoking the PAM360 Plugin in ChefImport PAM360's ruby gem into your Chef cookbooks by executing the following: 2.2.1 Initialize the PAM360 Class Object with Credentials syntax:gemData = PAM360Gem.new("Hostname","Auth token",Path,port number) Wherein,
2.2.2 Methods To Be Applied to the Chef Cookbook to Invoke the PAM360 Plugin gemData.getAccountPassword("resource name","account name") This method fetches the account password as a string. gemData.getAccountDetails("resource name","account name") This method returns the resource and account details in the array of JSON format. Puppet1. Introduction to PuppetPuppet 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. 2. Steps to Set Up the PAM360 Plugin for PuppetThe following are the steps to set up and manage sensitive credentials in Puppet with PAM360.
2.1 Enabling Puppet Integration in PAM360
2.2 Invoking the PAM360 Plugin in PuppetImport PAM360's ruby gem into Puppet by executing the following: 2.2.1 Initialize the PAM360 Class Object with Credentials syntax:gemData = PAM360Gem.new("Hostname","Auth token",Path,port number) Wherein,
2.2.2 Methods To Be Applied to Puppet to Invoke the PAM360 Plugin getAccountPassword(resourceName,AccountName) This method fetches the account password as a string. getAccountDetails(resourceName,AccountName) This method returns the resource and account details in the array of JSON format. Sample Codes1. Sample Code to Fetch Resource and Account Details using the PAM360 PluginThe 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]) resource details 2. Sample Code to Fetch the Password using the PAM360 PluginThe 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 For more information on Chef and Puppet, refer to the following links: Chef: https://www.chef.io Puppet: https://puppet.com/ | |