Top 10 Security Issue Solution

OWASP Top 10 Security Issue

Injection

         sql语句全部使用参数形式调用,不拼sql语句

         对输入都要验证:客户端验证+服务器段验证    

         数据库操作的授权

         针对每个输入Field,来验证字符串是否允许输入

Cross-Site Scripting (XSS)

         输入参数,使用微软的Anti-XSS组件过滤

         输出到界面html元素’s string, 使用微软的Anti-XSS组件过滤

         SRE(Security Runtime Engine) HttpModule全自动方式

Broken Authentication and Session Management

         Unknow

Insecure Direct Object References

         业务对象表:技术主键IDInt+对外引用ID(Guid)

         application layer: 增加一些HashTable==> Guid-->Int 对应关系全局缓存

Cross-Site Request Forgery (CSRF)

         使用微软的Anti-CSRF组件过滤每个post请求

Security Misconfiguration(NEW)

         Web.config命令行加密

Insecure Cryptographic Storage

         对称加密配合随机的PasswordSalt参数

Failure to Restrict URL Access

使用.net提供的membershipprovider组件来实现url保护

配合web.config中的Allow/Deny关键字

Or

使用给每个aspx页面写basepage以达到对每个页面进行权限判断

Insufficient Transport Layer Protection

         验证页面:ssl httponly, cookie

UnvalidatedRedirects and Forwards (NEW)

         针对每个需要重定向的url进行验证是否合法

原文地址:https://www.cnblogs.com/aarond/p/Security.html