第四讲 构建安全的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
异常管理
最小权限


 

原文地址:https://www.cnblogs.com/iceberg2008/p/1412065.html