$ echo -n admin | openssl dgst -binary -sha256 | openssl base64
If you forgot your Twistlock Console password for a local account in Twistlock, you can reset it. Follow this procedure with caution because unintended changes to the database can break Console.
To reset the admin password:
You have root access to the host where Twistlock Console is installed.
Create a hash for the desired password that you wish to reset your Twistlock account to.
$ echo -n admin | openssl dgst -binary -sha256 | openssl base64
where admin is the desired clear text password.
Exec into Console container
$ docker exec -ti twistlock_console /bin/ash
Run mongo.
$ mongo \ --ssl --sslAllowInvalidHostnames \ --sslCAFile /var/lib/twistlock/certificates/ca.pem \ --sslPEMKeyFile /var/lib/twistlock/certificates/client.pem \ --sslPEMKeyPassword `cat /var/lib/twistlock/certificates/service-parameter`
Set password for user 'admin' to admin
> use twistlock > db.users.update({username:"admin"},{$set: {password:"jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg="}}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
Exit out of database and container
> exit $ exit
Verify the changes by logging into Console with your new password.