How to secure my connection string? powershell + xml

╄→гoц情女王★ 提交于 2019-12-25 09:39:17

问题


I store my connection-string in XML file. Then i use it in powershell script. Is there a way to secure it/to encrypt it somehow?


回答1:


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.



来源:https://stackoverflow.com/questions/2183433/how-to-secure-my-connection-string-powershell-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!