.Net 中的日志 (log file)
Useful Logging Options in .Net:
http://blog.joycode.com/tingwang/articles/80349.aspx
持续更新中……这可能是我写过的所有东西中最有用的一样,就看识不识货了……如果有补充,请留言,谢谢……
posted on 2006-12-01 13:27:00 by TingWang 评论(4) 阅读(7378)
随笔 - 40, 评论 - 250, 引用 - 12 |
||
.Net 中的日志 (log file)Useful Logging Options in .Net: http://blog.joycode.com/tingwang/articles/80349.aspx 持续更新中……这可能是我写过的所有东西中最有用的一样,就看识不识货了……如果有补充,请留言,谢谢…… posted on 2006-12-01 13:27:00 by TingWang 评论(4) 阅读(7378) Troubleshooting Kerberos Delegation..终于遇到了传说中的Kerberos delegation的问题…… 要把用户的身份通过Integrated Windows Authentication从IE传到IIS ASP.Net Web Application再传到SQL Server,典型的double-hop……NTLM是无法做到的,因为在IIS端没有得到用户的真实密码,没法应付SQL Server端的Challenge……如果IE和IIS,或者IIS和SQL Server在同一台机器上,那就没有double-hop问题了…… 这种情况下只有配Kerberos delegation。由于ASP.Net 1.1的Impersonate是由Inetinfo.exe进程做的,而Inetinfo.exe默认跑在SYSTEM下,我们只需要在DC上给IIS Server的Computer Account设“Trusted for Delegation”,而不用考虑用domain account跑aspnet_wp.exe worker process。 很有用的文章,可以说是字字珠玑: How to configure an ASP.NET application for a delegation scenario http://support.microsoft.com/?id=810572 这篇文章的中文版至今为止都没有被revise过,感觉乱七八糟的,还是不看为妙…… Kerberos delegation其实不难配,难的是troubleshoot,因为牵涉的领域多了一点,IE,IIS,ASP.Net,SQL Server,还有DC。一个“Login failed for (null) user”的error上来给人一种无从下手的感觉…… 其实troubleshoot Kerberos delegation的王道是抓包……要从头开始抓,不断重新logon和iisreset,从IE一直抓到SQL Server……虽然可能有些重复,但我觉得还是有必要,因为每台机器都会单独再发request给DC。在IE和IIS之间看WWW-Authentication的HTTP Header。在IIS和SQL Server间看包里有没有“NTLMSSP”字样,有的话就说明没有用到Kerberos……条件允许的话一定要用SMS 2003的Network Monitor看包。不明白为什么,Windows 2003带的NetMon无法解析UDP 88的Kerberos包,如果能直接看懂16进制的raw packet自然最好,否则还是用SMS 2003带的NetMon吧……如果确定了哪一个hop出的问题,可以考虑看security event log或者是Kerberos system event log: HOW TO: Enable Kerberos Event Logging http://support.microsoft.com/?id=262177 下面都是一些经我筛选,个人认为极有用的文章: 如果看到了KRB_ERROR的包不明白: Basic Overview of Kerberos User Authentication Protocol in Windows 2000 http://support.microsoft.com/?id=217098 如果在Event Log里看见了错误信息: Description of Common Kerberos-Related Errors in Windows 2000 http://support.microsoft.com/?id=230476 如果IE和IIS之间就出了问题: HOW TO: Troubleshoot Kerberos-Related Issues in IIS http://support.microsoft.com/?id=326985 如果到了SQL Server才出问题: INF: SQL Server 2000 Kerberos support including SQL Server virtual servers on server clusters http://support.microsoft.com/?id=319723 (注意:Named Pipe不支持Kerberos验证) 两个必备工具: Setspn.exe http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setspn-o.asp Kerbtray.exe: Kerberos Tray http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/kerbtray-o.asp 最后,一部troubleshooting大典: Troubleshooting Kerberos Delegation http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerbdel.mspx posted on 2005-01-06 00:09:00 by TingWang 评论(9) 阅读(4324) SysInternals 五大利器1. RegMon: 简介:捕捉注册表访问活动。对于以下的error message一击必杀: 2. FileMon: 简介:捕捉文件访问活动。治以下问题: 3. ListDlls 简介:列出process所加载DLL的详细信息,比windbg的lmv还少点……Typical scenario:程序在开发机上运行正常,deploy之后老crash。专治dll hell。(实现很简单,有兴趣可以自己写写看……) 4. Process Explorer 简介:能显示关于process的详细信息(handles, modules, threads, environment variables, security flags...),其功能涵盖了ListDlls以及一些其他工具……常用于找出文件或注册表键被哪一个process使用…… 5. TCPView 简介:察看端口使用情况。常见用途:WinSocket和IIS。找出哪个process使用了指定的端口。 (再说下去要失业了……) posted on 2004-09-08 00:50:00 by TingWang 评论(5) 阅读(3915) |
||
|
Powered by: Joycode.MVC引擎 0.5.2.0 Copyright © Case by Case.. |
||