我有一个在多个生产实例中运行的 Windows 服务。
此 Windows 服务的配置文件包含一些需要加密的安全数据。
好东西 - 我们只有应用程序设置部分的值需要加密。
坏事 - 有第 3 方黑匣子组件会消耗一些安全的应用程序设置密钥。这意味着我们无法切换到不同的配置管理器。
因此,这是我们问题的限制部分,
- 多个生产服务器,因此没有基于机器的加密(我也不喜欢用户配置文件,因为这对服务造成了限制)
- 应用程序设置应该可以使用 ConfigurationManager.AppSettings["Key1"] 来使用通常。以便现有代码和黑盒程序集仍然能够使用它们。
有什么想法/建议/解决方案吗?
I have a windows service which runs in multiple production instances.
The configuration file for this windows service has some secure data which requires encrypting.
Good thing - We have only values that are part of appsettings section to be encrypted.
Bad thing - there are 3rd party black box assemblies which consume some of the secure appsettings keys. which means we cannot switch to a different configuration manager.
So, here are the limitations part of our problem,
- Multiple productions server, so NO Machine based encryption (i dont prefer user profile neither as that puts limitations on the service)
- App settings should be consumable using ConfigurationManager.AppSettings["Key1"] as usual. so that existing code and black box assemblies are still able to consume them.
Any ideas / suggestions / solutions?
发布评论
评论(1)
您可以使用RsaProtectedConfigurationProvider,如本文链接自 Davide Piras 答案的第一部分。不知道他为什么删除答案,因为第一部分似乎正是你想要的。
本文介绍了如何在多个服务器之间共享密钥,以便您可以在所有服务器上使用相同的加密配置文件。但这会给您带来难以解决的密钥管理问题。
您确定需要在所有生产服务器之间共享相同的加密配置文件,并因此使用共享密钥吗?另一种方法是在每台生产服务器上创建具有相同名称的密钥容器,并在每台服务器上独立加密文件。这需要更多的工作,但对于解决密钥管理问题大有帮助。
You can use RsaProtectedConfigurationProvider as described in this article linked from the first part of Davide Piras's answer. Not sure why he deleted the answer, as the first part seems to do exactly what you want.
The article explains how to share the key between multiple servers so that you can use the same encrypted configuration file on all servers. Though this then leaves you with the difficult-to-solve key management problem.
Are you sure you need to share the same encrypted configuration file between all production servers, and therefore use a shared key? An alternative approach is to create a key container with the same name on each production server, and encrypt the file independently on each server. This is a bit more work but goes a long way to solving the key management problem.