保护web.config设置 [英] Securing web.config settings

查看:145
本文介绍了保护web.config设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个ASP.NET MVC 5应用程序。我们聘请了一些偏远的开发,以帮助我们的项目。

We are developing an ASP.NET MVC 5 application. We hired some remote developers to help us with the project.

在web.config文件中包含连接字符串和应用程序设置,我们不想与这些远程开发人员共享。要在我们的应用程序的远程工作,这些开发商进入开发的桌面,我们控制。

The web.config file contains connection strings and app settings that we don't want to share with these remote developers. To work on our application, these developers remote into a development desktop that we control.

什么是确保在web.config中敏感信息的最佳实践,使开发人员可以仍然运行和调试应用程序,但是不能读取web.config中的敏感信息?

What is the best practice for securing sensitive information in web.config, so that developers can still run and debug application but not read the sensitive info in web.config?

推荐答案

加密网​​络的.config 在开发环境中是没有意义的。要忠实地隐藏从开发者的信息的唯一方法就是不要给他们摆在首位。

Encrypting the web.config in a development environment is pointless. The only way to truely hide the information from the developers is not to give it to them in the first place.


  1. 您必须确保您的远程开发环境是设置只访问一个开发数据库,​​并配置了唯一的其他开发设置。

  2. 在任何敏感数据不检查(产密码等)到源控制。您可以通过分离信息转换成外部<$实现这一目标C $ C>的.config 文件所以他们不会签入到源控制。 提示:忽略的的实际的密码并添加另一个具有相同的名称和扩展这种 .config.example 的检查中给予对开发商说明如何设置本地系统上的文件(不管这是一个有益的提醒的的系统从建立源头控制库的克隆)。

  3. 使用持续集成服务器(的TeamCity 詹金斯,的章鱼部署等)通过的环境变量。许多CI服务器必须隐藏从UI 敏感数据的能力。你可以通过练习CI自动部署按钮,单击让你的开发人员不必访问是在CI服务器的敏感数据,或给部署构件(S),以一个值得信赖的团队在生产中进行安装。

  1. You must ensure that your "remote development environment" is setup only to access a development database and is configured with other development settings only.
  2. Don't check in any sensitive data (production passwords, etc) into your source control. You can achieve this by separating the information into external .config files so they are not checked into source control. TIP: Ignore the file with the actual passwords and add another one with the same name and an extension such as .config.example that is checked in to give the developer instructions on how to setup the file on their local system (which is a helpful reminder regardless of who sets up the system from a clone of the source control repository).
  3. Use a continuous integration server (TeamCity, Jenkins, Octopus Deploy, etc) to build sensitive information into the release workflow through environment variables. Many CI servers have the ability to hide sensitive data from the UI. You can either practice automatic deployment via CI button-click so your developers don't have access to the sensitive data that is in the CI server, or give the deployment artifact(s) to a trusted team to install in production.

实在是没有理由开发人员甚至应该得到一个机会,看看敏感的生产数据,如密码和私钥。

There is really no reason why a developer should even be given a chance to see sensitive production data such as passwords and private keys.

这篇关于保护web.config设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆