.NET安全审核检查表
| 书籍名称:Web安全设计之道 -.NET代码安全,界面漏洞防范与程序优化 | |
| .NET安全审核检查表 | |
| 检查项 | 任务描述 |
| 设计环节 | |
| Security descisions should not rely on client-side validations; they are made on the server side. | |
| The Web site is partitioned into public access areas and restricted areas that require authentication access. Navigation between these areas should not flow sensitive credentials information. cookie1=personal info; path="/public" cookies2=crfedential ifno; path="/secure" |
|
| The indentities used to access remote resource from ASP.net web applications are clearly identified. | |
| Mechanisms have been identified to secure credentials,authentication tickets, and other sensitive information over network and in persistent stores. 问题一: .NET 有针对ConnectionString 加密组件,VSS SQA Assets\Project Assets\...CryptoUtility.rar. 问题二: 专门对Cookie 进行保护的?https://msdn.microsoft.com/zh-cn/library/zdh19h94(v=vs.80).aspx |
|
| A secure approach to exception management is identified. The application fails securely in the event of exceptions. | |
| The site has granular authorization checks for pages and directories. | |
| Web controls, user controls, and resource access code are all partitioned in their own assemblies for granular security. | |
| 应用条件分类 | |
| User input is validated for type, length, format, and range.Input is checked for known valid and safe data and then for malicious dangerous data. 有效安全的输入, 需要注意的地方有: public 方法的参数(GL:?) 所有来自非信任源的输入字段应该用函数或者正则表达式来约束。 |
|
| String form field input is validated using regular expressions. | |
| Regular HTML controls, query string, cookies, and other forms of input are validated. | |
| The RequiredFieldVaildator control is used where data must be controls. | |
| Free form input is sanitized to clean malicious data. For example, HttpUtility.HtmlEncode and HttpUtility.UrlEncode. |
|
| Input file names are well formed and are verifiably valid within the application context. | |
| Output that includes input is encodeed with HtmleEncode and UrlEncode. <%Response.Write(Server.HTMLEncode("..."))%> |
|
| MapPath restricts cross-application mapping where appropriate. 如果我们使用MapPath将虚拟路径映射到一个物理路径,那么应当重载Request.MapPath.它接受一个布尔参数, 就可以避免交叉应用映射(corss-application mapping)。 | |
| Character encoding is set by the server(ISO-8859-1 is recommended/UFT 8?) | |
| The ASP.Net Version1.1 validatedRequest option is enabled. | |
| URL Scan 需要安装到Web服务器。 | |
| HttpOnly cookie的选项防止客户端跨站攻击(IE6.1 以上的版本才支持) | |
| SQL parameters are used in data access code to validate length and type of data and to help prevent SQL injection. | |
| 认证安全审查(适用于安全工程师) | |
| Site is partitioned to restricted areas and public areas. Web.config setting the access public pages and restricted pages. |
|
| Absolute URLs are used for navigation where the site is partitioned with secure and non-secure folders. | |
| Secure Sockets Layer(SSL) is used to proted credentials and authentication cookies. | |
| The slidingExpiration attribute is set to "false" and limited authentication cookie time-outs are used where the the cookie is not protected by using SSL. | |
| The forms authentication cookie is restricted to HTTPS connections by using the requireSSL attribute or the secure cookie property. | |
| 在HTTPS 连接时使用reireSSL 属性或者安全cookie 属性来限制认证信息的cookie. | |
| The authentication cookie is encrypted and integrity checked(protection="All"). | |
| Authentication cookies are not persisted. | |
| Application cookies have unique path/name combinations. | |
| Personalization cookies are separate from authentication cookies. | |
| Passwords are not stored directly in the user store; password digests with salt are stored instead. | |
| The impersonation credentials(if using a fixed identity) are encrypted in the configuration file by using Aspnet_setreg.exe | |
| Strong password policies are implemented for authentication. 例如:用户密码必须达到7个字符长度,同时应该至少包含数字和字符。 | |
| The<credentials> element is not used inside<forms> element for Forms authetication(use it for testing only) | |
| 授权验证审查 | |
| URL authrization is used for page and directory access control. | |
| File authorization is used with Windows authentication.(使用Windows 认证方式时应该注意检查NTFS权限) | |
| Principal permission demand are used to secure access to classes and members. Explicit role checks are used if fine-grained authorization is required. | |
| 配置信息审查 | |
| Configuration file retrieval is blocked by using HttpForbiddenHandler | |
| A least-privileged account is used to run ASP.NET. | |
| Custom account credentials(if used) are encrypted on the <processModle> element by using Aspnet_setreg.exe | |
| To enforce machine-wide policy, Webconfig setting are locked by using allowOverride="false" in Machine.config. | |
| SSL is used to protect sensitive data on the wire. | |
| Sensitive data is not passed across pages; it is maintained using server-side state management. | |
| Sensitive data is not stored in cookies, hidden form fields, or query strings. | |
| Do not cache sensitive data. Output caching is offby default. | |
| Plain text passwords are avoided in Web.config and Machine.config files.(Aspnet_setreg.exe is used to encrypt credentials.) | |
| 会话状态的审查 | |
| The session cookie is protected using SSL on all pages that require authenticated access. | |
| Windows authertication is used to connect to Microsoft SQL ServerAtm state database. | |
| 在SQL server限制对状态数据的访问 | |
| Connection strings are encrypted by using Aspnet_setreg.exe | |
| The conmmunication channel to state store is encrypted(IPSec or SSL) | |
| 参数形式审核 | |
| View state is protected using message authentication codes(MACs) | |
| Query strings with server secrets are hashed. | |
| All input parameters are validated. | |
| Page.ViewStateUserKey is used to counter one-click attacks. | |
| 错误信息审核 | |
| Structured exception handling is used. | |
| Exception details are logged on the server. | |
| Generic error pages with harmless message are returned to the client. | |
| Page-level or application-level error handlers are implemented | |
| The application distinguishes between errors and exception conditions. | |
| 日志处理功能审核 | |
| 配置ASP.NET进程, 以便允许在运行时新建事件源, 或在安装时创建应用程序事件源。 | |
| 配置文件审核(适用于开发人员) | |
| 在生产服务器上禁用跟踪 <trace enabled ="false"> | |
| 通过设置debug="false",在生产服务器上禁用调试编译 | |
| 如果应用程序不使用查看状态, 应将enableViewState 设置为"false" 如果应用程序使用查看状态,应将enableViewState 设置为"true",并将 enableViewStateMac设置为"true"以便检测查看状态的篡改 | |
| 将自定义的错误页返回客户端,并通过设置mode="on",防止返回例外详细信息, 由defaultRedirect属性来指定一般错误页面。 | |
| 正确配置身份验证模式,以满足应用程序的要求。要强制使用特定的身份验证类型,可以使用带有allowOverride="false"的<location>元素 | |
| 对网站进行划分,以便进行公共的和受限制的访问 对身份验证cookie进行加密, 并检查其完整性 身份验证cookie 需要将SSL 状态设置为true 如果不使用SSL,则应将滑动期限设置为false 会话生存时间需要进行限制 cookie的名称和路径是惟一的。 | |
| 如果使用模拟标识, 可以通过使用Aspnet_setreg.exe在注册表中对其进行加密。 | |
| 验证角色名称的格式是否正确 | |
| 在同一台Web服务器上部署多个ASP.NET web 应用程序时,应使用"Isolate.Apps"设置, 以确保为每个Web应用程序生成单独的密钥。 | |
| 如果mode="StateServer",凭据是以加密的形式存储在注册表中,如果mode="SQLServer",则使用Windows身份验证连接到状态存储数据库,并且凭据是以加密的形式存储在注册表中。 | |
| 将不用的文件类型映射到HttpForbiddenHandler, 防止通过HTTP方式检索文件, | |
| 用最低权限的账户 | |
| 禁用不使用的协议 | |
| Web Farm审核 | |
| 维护会话状态 会话状态的作用是为了避免服务器的相似性,应该在进程外维护ASPNET的会话状态。 比如, ASPNET SQL Server的状态数据库和远程计算机上的进程外状态服务中应该考虑维护会话状态。 | |
| 加密和验证密钥 | |
| 一机多用审核 | |
| 使应用程序有独特的计算机密钥,使用<machineKey>上的IsolateApp或者每个应用程序的<machineKey>元素 | |
| 启用每个应用程序的表单身份验证Cookie的唯一路径/名称组合 | |
| Web Farm中的所有服务器上的启用公共计算机密钥 | |
| 使用代码访问安全信任级别进行进程隔离,并限制对系统资源的访问。 | |
| ACL和Permiss ions权限审核 | |
| ASPNET临时目录,临时目录,.NET框架目录 .NET框架配置目录 网站根目录 系统根目录 全局程序集缓存 内容目录 | |
| 应用程序BIN目录安全审核 | |
| 配置IIS Web 权限 将执行权限设置为None 需要注意的是Bin目录没有读取,写入,或者目录浏览权限。 | |
| 为禁止用户访问,可以将关于身份验证的设置全部删除。 | |
.NET安全审核检查表的更多相关文章
- 关于cnas培训
关于cnas(2014-12-9----2014-12-12) 目的:完成内审相关知识培训,可以做一个合格的内审人员 过程: 1.为什么会存在实验室 2.iso9000是怎么产生的,以及存在的意义 3 ...
- PSP个人项目耗时对比记录表:四则运算
Personal Software Process Stages Time(%) 计划 5 •估计这个任务需要多长时间 5 开发 60 •需求分析 5 •生成设计文档 5 ...
- SQL业务审核与优化
审核 什么是业务审核 类似与code review 评审业务Schema和SQL设计 偏重关注性能 是业务优化的主要入口之一 审核提前发现问题,进行优化 上 ...
- 告别被拒,如何提升iOS审核通过率(上篇)
iOS审核一直是每款移动产品上架苹果商店时面对的一座大山,每次提审都像是一次漫长而又悲壮的旅行,经常被苹果拒之门外,无比煎熬.那么问题来了,我们有没有什么办法准确把握苹果审核准则,从而提升审核的通过率 ...
- 用php做注册审核
做注册审核就像前面讲的注册登录一样,也是要连接数据库 首先在数据库内要做这样一张表: 表名为users表 里面的列名分别为用户名,密码,姓名,性别,生日,账户的状态,照片 然后就可以写代码了,要注册的 ...
- iOS审核这些坑,腾讯游戏也踩过
作者:Jamie,专项技术测试工程师,在iOS预审和ASO优化领域从事专项测试相关工作,为腾讯游戏近100个产品提供专项服务. WeTest 导读 在App上架苹果应用商店的过程中,相信大多数iOS开 ...
- php注册审核
通过注册审核,判断刚创建的账户是否可以使用. 后台管理员审核通过后,账号可以使用. 通过session 设置只能通过登录入口进入网页. 原理:通过数据库设置账号的一个字段状态,例: isok:1, i ...
- 【基于WPF+OneNote+Oracle的中文图片识别系统阶段总结】之篇四:关于OneNote入库处理以及审核
篇一:WPF常用知识以及本项目设计总结:http://www.cnblogs.com/baiboy/p/wpf.html 篇二:基于OneNote难点突破和批量识别:http://www.cnblog ...
- iOS提交AppStore后申请加急审核
提交审核后进去下面链接申请加急审核链接:https://developer.apple.com/appstore/contact/appreviewteam/index.html 在I would l ...
随机推荐
- linux定时器(crontab)实例
linux实验示例----实现每2分钟将“/etc”下面的文件打包存储到“/usr/lobal”目录下 ·Step1:编辑当前用户的crontab并保存终端输入:>crontab -u root ...
- tableView使用的易忘技术点(相对于自己)
1.在tableView设置右向导航指示箭头 cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator; 2.tableView的系 ...
- 【BZOJ-4213】贪吃蛇 有上下界的费用流
4213: 贪吃蛇 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 58 Solved: 24[Submit][Status][Discuss] Desc ...
- jquery使用历经
1.动态绑定 当要绑定事件时忽然没有效果了,这种情况出现在通过给通过js拼出来的button绑定的事件,后来查了资料,可以用live事件委托,或者用on,因为是给button绑定事件所以还可以直接写在 ...
- 【codevs3945】 完美拓印
http://codevs.cn/problem/3945/ (题目链接) 题意 给出一个诡异的图形,再给出一个歪七扭八的线,问图形上下两条边与线的匹配→_→ Solution 前后求差然后KMP,这 ...
- Linux 开机 logo 修改
从内核被解压到文件系统被挂载,我们看到的经典画面是一个小企鹅.如果嫌小企鹅枯燥,我们可以把它换掉. 1. 准备图片 这里需要的是 ppm 图片,所以,我们需要把常见格式给转换为 .ppm 才能使用.c ...
- bitmap的图像像素遍历方法
public class FastBitmap { BitmapData bitmapData; public FastBitmap(Bitmap bitmap) { ,,bitmap.Width,b ...
- FZU みねちゃんの修罗场(从一堆出现三次的数中找出出现两次的数)
みねちゃんの修罗场 Time Limit: 5000 mSec Memory Limit: 1024 KB Description みねちゃん是个成绩优秀大学二年级学生,本来是和像自己妹妹一般 ...
- Python编码格式的指定方式
参考自: http://python.jobbole.com/85852/, 原文探究的更深,有兴趣的可以去看看. 简介来讲就是使用一种特殊的注释来声明编码格式,如何判断这种格式也用了很简单粗暴有效的 ...
- 屠蛟之路_集木成舟_ForthDay
下数据库大山,行数里至水岸,无边无际的东海便豁然展现在屠蛟少年的眼前. 要想到达东海之中的蛟灵岛绞杀beta怪蛟,夺回心爱的小公举,少年们首先需要一艘经得起风浪的船.毕竟海上之路暗涌潜伏.同样凶险万分 ...