开发者

How to secure my connection string? powershell + xml

开发者 https://www.devze.com 2022-12-18 15:26 出处:网络
I store my conn开发者_如何学Pythonection-string in XML file. Then i use it in powershell script. Is there a way to secure it/to encrypt it somehow?There are two methods I\'ve seen for encrypting in Po

I store my conn开发者_如何学Pythonection-string in XML file. Then i use it in powershell script. Is there a way to secure it/to encrypt it somehow?


There are two methods I've seen for encrypting in Powershell

Use *SecureString cmdlets. It should be noted only the Windows ID that encrypted the original string can decrypt it (since it uses the Windows login as key)

Use a pass phrase with the Library-StringCrypto functions

Because of the limitations of the first method, I use the second. I'll then store my encrypted connection string in a SQL table and lock down permissions. To make a connection I'll retrieve the connection string from the SQL table and decrypt using a pass phrase.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号