如何防止密码和其他敏感信息出现在ASP.NET转储中? [英] Hows does one prevent passwords and other sensitive information from appearing in an ASP.NET dump?

查看:67
本文介绍了如何防止密码和其他敏感信息出现在ASP.NET转储中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止在IIS/ASP.NET转储文件中向ASP.NET网页提交和接收的密码和其他敏感数据?

How does one prevent passwords and other sensitive data submitted to and received from ASP.NET web pages in IIS/ASP.NET dump files?

复制步骤

  1. 使用Visual Studio 2010创建一个ASP.NET MVC 3 Intranet应用程序.
  2. 配置它以使用IIS 7.5.
  3. 启动它并注册一个帐户(例如bob123作为用户,Pa $$ w0Rd作为密码.我假设已创建SQL Express数据库,并且该站点可以正常运行.
  4. 使用任务管理器,右键单击w3wp进程并创建转储.
  5. 在能够以十六进制形式显示其内容的编辑器(例如SlickEdit)中打开转储.
  6. 在十六进制转储中搜索"Pa $$ 0Rd"和"Pa%24%24w0Rd".您应该能够找到以ASCII,Unicode或编码形式存储的多个副本.

请注意,是否使用HTTPS并不重要,因为它仅加密通信.ASP.NET将该数据以明文形式存储在内存或磁盘中.

Note that it doesn't matter whether you use HTTPS because it only encrypts the communication. ASP.NET stores that data in the clear in memory or disk.

问题

常识使它能够加密敏感数据,而不是将其存储在明文中.但是,员工可能会收到IIS/ASP.NET应用程序的转储,并发现用户的密码和其他机密数据,因为此信息既未加密,也未在使用后清除ASP.NET占用的内存.

Common wisdom has it to encrypt sensitive data and not to store it in the clear. However an employee may receive a dump of an IIS/ASP.NET application and discover passwords and other confidential data of users because this information is neither encrypted, nor is memory used by ASP.NET cleared after usage.

这使他们面临风险的原因仅仅是因为他们可以使用它.有时与合作伙伴(例如Microsoft)共享转储,以帮助他们诊断代码中的问题.这是诊断应用程序中某些非常复杂的问题的必要部分.

This puts them at risk simply because they have access to it. Dump are sometimes shared with partners (such as Microsoft) to help them diagnose issues in their code. It is a necessary part of diagnosing some really complex problems in one's application.

我看过的东西

  1. 将SecureString用于密码和其他敏感数据.但是,ASP.NET Membership提供程序以及其他框架(如WCF)通常将密码作为System.String接受,这意味着这些副本仍将保留在转储中.
  2. 查看框架中是否有任何东西可以在不再使用System.String时清除它.我什么都找不到.
  3. 研究了在完成IIS后是否可以将用于请求和响应的内存清零,但是我什么也找不到.
  4. 我研究了是否可以加密IIS接收的文件(作为HttpPostFile),以使它们不会以明文形式存储.我们可能会收到非常机密的文档,并且已采取所有步骤对服务器上的文档进行加密和保护.但是,有人可以从IIS转储中清除它们.

我希望的是告诉IIS/ASP.NET特定的请求/响应包含敏感数据,并且IIS/ASP.NET在使用完内存后将清除内存.

What I was hoping for is to tell IIS/ASP.NET that a specific request/response contains sensitive data and that IIS/ASP.NET will clear out the memory when it is done using it.

推荐答案

转储文件按定义转储 all 应用程序转储时使用的内存,如果要创建过滤器的话这样就排除了某些事物,那么您将永远无法确定自己有足够的数据将问题归零.

A dump file by definition dumps all the memory the application uses at the moment it is dumped, If you were to create a filter so that certain things were excluded then you could never be sure that you had enough data to zero in on a problem.

您是否愿意将数据库/配置设置移交给第三方?如果不是,那么您可能也不应该移交转储文件.(恕我直言)

Would you be comfortable handing over your databases / configuration settings to a third party? if not then you probably shouldn't be handing over dumpfiles either. (imho)

这篇关于如何防止密码和其他敏感信息出现在ASP.NET转储中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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