first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

“ASP.NET and the Event Log” by Bruce Johnson

Today's tidbit revolves around enabling the ASP.NET user to generate entries into the event log. In an ideal world (hint, hint Microsoft designers), this would be a relatively straightforward process. Or at least one that didn't require a direct hack into the registry. But that is not the case at the moment. So without further ado, here are the steps involved in enabling the ASP.NET user to create event log entries.

  1. Launch RegEdit
  2. Navigate to HKEY_LOCAL_MACHINE\\SYSTEM\\ CurrentControlSet\\Services\\EventLog\\
  3. From the menu, select Edit->Permissions
  4. Click the Add button and write ASPNET. (if ASP.NET is running under a different user id, use that id instead)
  5. Click OK.
  6. Select the newly added user from the list (ASP.NET Machine User by default).
  7. Click on Full Control in the Allow column.
  8. Click OK.

It is usually a good idea at this point to restart IIS with the IISReset command (Start | Run | IISReset).

For those concerned with the security hole that has been opened up. Once these changes are implemented, the ASP.NET user has full control over the Application event log. Worst case scenario, a bad process could fill up the event log or delete existing log entries. However, as far as security breaches go, these are fairly minor, especially when compared to the benefits of being able to view log entries.

[http://blogs.objectsharp.com/cs/blogs/bruce/archive/2003/11/03/180.aspx]

mod date: 2009-07-20T19:27:38.000Z