第四讲 构建安全的Microsoft ASP.NET 应用的最佳实践和技术

*ASP.NET应用安全事项
*输入验证
1、参数化查询
2、存储过程
3、html编码(防止javascript脚本执行)
String.Format("Invalid Logon for {0},please try again!",Server.HtmlEncode(UserName));


认证与授权
配置管理
Review production configuration:
<customErrors> RemoteOnly or On
<compilation> disable debugging
Shared servers
Use configuration lockdown
<location allowOverride=“false”/>
Isolate by process (IIS 6) and/or with <trust> level
敏感数据
会话管理
使用加密
1、加密类CryPtography
2、随机类RNGCryptoServiceProvider
异常管理
最小权限


 

posted @ 2009-03-14 21:42  teacherzj  阅读(142)  评论(0编辑  收藏  举报