• This topic has 3 replies, 2 voices, and was last updated February 8, 2024 by CloudWave S.

Secure Credentials for API

  • I am newer to this sort of work. At the moment, we’re manually doing failover tests and gathering info for reports. I’d like to automate this. Following along zerto’s documentation to establish a session from this article, I want to be able to use a securestring generated like:

    $credentials = get-credential

    $credentials.Password | ConvertFrom-SecureString | Out-File $filelocation

    And then using the secure password like:

    $strZVMPwd = Get-Content $filelocation | ConvertTo-SecureString

    Maybe I’d have to write a password into the script, but that’s what I’m trying to avoid, any advice would be appreciated.

    Have you considered using the Windows Credentials manager?  I’m not as good with PowerShell as I am with Python, but I’ve been using the keyring module (python) to pull from credential manager to run scripts without having to plug in a password each time.

    In Keycloak, https://<ZVM-IP>/auth, you set up a client and have it create a password.  Once you’ve set that up on the ZVM, you plug that info into the Windows credentials manager, and then have your script pull the credentials from there.  If you need help, then just reply to this post.  I can help, but like I said, I’m light on PowerShell, but heavy on Python.

    So, I did find a way to do this. I used the zerto powershell module, which allowed me to use a PSCredential for authentication. Thanks for the reply anyway.

    Good news!

You must be logged in to create new topics. Click here to login