IdentityNow Bulk Role-Importer - Encrypt secret

I was using IdentityNow Bulk AccessProfile and Role Importer - Compass (sailpoint.com) to bulk upload Access Profiles and Roles, but I didnt like having PAT/client secret in plain text in the config file.

So, I made the attached ruby script to encrypt secret, and then added a method/function to decrypt it.

valEncrypter.rb.txt (1.8 KB)

def decryptSecret(myKey, myIV, myText)
    # Returns decrypted myText
    
    decoded = Base64.decode64(myText)
    decipher = OpenSSL::Cipher.new('aes-256-cbc')
    decipher.decrypt
    decipher.key = Base64.decode64(myKey)
    decipher.iv = Base64.decode64(myIV)
    plain = decipher.update(decoded) + decipher.final
    #puts "plainText is #{plain}"
    
    return plain
end
2 Likes