Health Monitoring and Partial Trust

Besides providing a common API for various logging technologies, one of the compelling features of the Health Monitoring Framework in ASP.NET 2.0 is that the application doesn’t need the low-level CAS permissions, e.g. you don’t need to grant the EventLogPermission in order to use HM to write to the event log.

But there are some things you have to be aware of.

As soon as a web event contains potentially sensitive data, they must be fully trusted. This is the case for all event classes which are derived from WebManagementEvent (e.g. WebAuditEvent). If that applies to your event classes, you have to isolate them in a separate assembly and grant full trust. Alternatively you can derive your events from WebBaseEvent and create your own inheritance hierarchy.
I was very pleased when I discovered this “feature”. This would have been a nice back door to leak data about the physical environment in hosting scenarios. Another proof that the ASP.NET team really thought about partial trust in the 2.0 release. 

Of course, if you built your own providers, you have to take care of the CAS permissions yourself.


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s