Turn on WCF Server Security Event Logging & Auditing

本文介绍如何通过简单配置启用WCF服务的安全事件审核,包括设置日志位置、记录级别及失败处理方式等,有助于调试安全异常。

http://intrepiddeveloper.wordpress.com/2008/08/07/security-event-logging-auditing/

Posted by intrepiddeveloper on August 7, 2008

Few days ago I was trying to debug a WCF service hosted on a remote server which was giving a very generic boilerplate security exceptions/faults. After scratching my head for sometime I decided to figure out how to enable logging these security exceptions on the server. I think for debugging purposes this is a great tool and should be the first step when hunting down an elusive bug.

Its actually pretty straight forward to enable Security event auditing in WCF. You simply need to enable this in the configuration of the service.

1 <configuration>
2     <system .serviceModel>
3       <behaviors>
4         <behavior>
5           <servicesecurityaudit auditLogLocation="Application" serviceAuthorizationAuditLevel="Failure"messageAuthenticationAuditLevel="Failure" suppressAuditFailure="true" />
6         </behavior>
7       </behaviors>
8     </system>
9   </configuration>

auditLogLocation‘ specifies which log to write to with possible values Default, Application and Security.

messageAuthenticationAuditLevel‘  & ‘serviceAuthorizationAuditLevel‘ indicated when to log the event i.e. on None ,Failure ,Success and SuccessOrFailure for message and service authorization respectively.

suppressAuditFailure‘ basically defines who (i.e. the service or the system) handles a AuditFailure event (like unable to write to log or log is full, etc). In case of true Audit Failures are ignored and request is processed normally.

In the Event Viewer note the source is listed as ServiceModel and message related information is logged in an un-encrypted form.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值