How can I create a Cypher secret with a Variable?

If you haven’t used the password function note you have to refer to it as password/##/name always. I wish it created a alias for secret/name after the gen

Managed to get my PS script down to this :
 
$MySecureString = ConvertTo-SecureString -String "<%=cypher.read('password/' + instance.name)%>" -AsPlainText -Force

Get-LocalUser -Name “Administrator” | Set-LocalUser -Password $MySecureString

 
This seems to do what I want - in my limited testing. Any thoughts on ways to improve it ? 

oh I have a typo but if it works great

probably should be ‘password/##’

meaning how long you want the password

Also, once prod probably want to make some sort of naming scheme so you can filter cypher to specific users/tenants but should suffice small scale testing

So the way I have it creates a password 15 chars long eg:
v\Bq#(N8#P=[01|
yeah I think we have a default value if not passed 🙂

Oh sorry to keep spamming reverse your quoting

‘<%=cypher.read(“password/” + instance.name)%>’

If I use the 15 or other number, it includes that in the mountpoint, is that what you mean about wanting it to create an alias ?

Powershell will bark if you get the wrong symbol in the password otherwise

yes it includes in the mountpoint and most people consume cypher at a “secret/” mount point

(and note) I have a long standing feature request to have a decrypt button on the instances and just use the morpheus random password if none provided on Administration > provisioning so campuses and allow users to spin up singular vms and have a password changed

thanks for your help on this. Nice little share for a PoC

sounds like a nice tab plugin Chris Bunge
1 Like
🥵
1 Like
There's an upcoming tech brief covering custom tabs on the 28th of this month. 🙂
1 Like