Encrypt credentials in JAMF - Elwyn1979/Knowledge GitHub Wiki

This guide shows you how to encrypt credentials when using them in JAMF. Its very important that no Username, passwords or tokens are in the script.

Download this project from Git https://github.com/jamf/Encrypted-Script-Parameters Open the file EncryptedStrings_Bash.sh in a Script complier like CodeRunner https://coderunnerapp.com/ or Visual Studio (Self Service link) Once you have the file open you need to use the function GenerateEncryptedString "Credentials" to encrypted you credentials.

This will return the strings you will need to use in JAMF and your script to decrypt the credentials when the script has been run.

Now you need to add the decryption function to your script.

Now add the Salt: bbe9c461125b04c7 and Passphrase: 8aca06e74ecf6bae29baa687 for decrypting the Credentials.

As you can see from the above example the variable Credentials is using "$4" corresponding to the Parameter values in the JAMF policy shown below. The variable you are using in this case Credentials is being used to decrypt the Salt: bbe9c461125b04c7 | Passphrase: 8aca06e74ecf6bae29baa687 with the Encrypted String: U2FsdGVkX1+76cRhElsExyi2SENGIdpuHM9cwQArIMM=

The finished result should look like.

You will needs to add this for each part you wish to encrypt for example username $4 Password $5 etc.