r/PowerShell • • Aug 11 '26

Question Question on scripting

Hi,

When we develop a script,we use credentials as a plain text in that script.

Example

Script is running on jump server and script runs against vcenter server.

We have a security concerns(example ransomware attack)to put the credentials as a plain text in that script.

Any other good ways to put the credentials in a encrypted or in a different format?

35 Upvotes

36 comments sorted by

View all comments

Show parent comment

2

u/Over_Dingo Aug 11 '26

The password that unlocks it is stored using a secure xml file that can be unlocked at run time by that account only,

I always wonder about the tradeoff of secure string being a singular password, vs being password to the vault

1

u/hihcadore Aug 12 '26

It’s the chicken and the egg. You’ve gotta unlock the vault somehow. I have no idea what’s more secure unless you have a human with a token.

1

u/Over_Dingo Aug 12 '26

I was thinking, and in case of external APIs, if the key is stolen it's worse than if it's the vault that has limited access. So I guess the ability to harden is better