Web Connection
Another security question
Gravatar is a globally recognized avatar based on your email address. Another security question
  Richard Kaye
  All
  Dec 16, 2019 @ 02:34pm

Hi Rick,

I have another one for you. I appear to have some other security issue in this staging environment as the following is showing up in wcerrors.txt:

2019-12-16 17:27:26.169 - 4046167766712746_142 - Unhandled Exception (Mainline): Access to the registry key 'Global' is denied.
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
   at Microsoft.Win32.RegistryKey.GetValue(String name)
   at System.Diagnostics.PerformanceMonitor.GetData(String item)
   at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
   at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category)
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category)
   at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName)
   at System.Diagnostics.PerformanceCounterCategory.GetInstanceNames()
   at Westwind.WebConnection.ComServerInstance.InitializePerfCounter()
   at Westwind.WebConnection.WebConnectionHandler.ShowServerList(StringBuilder output, Boolean noPerf)
   at Westwind.WebConnection.WebConnectionHandler.HandleAdminTasks()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /admin/ShowServerList.wc?1576535246155```

This is being logged quite frequently and the errors log file rapidly gets out of hand. What do I have misconfigured now?  

TIA
Gravatar is a globally recognized avatar based on your email address. re: Another security question
  Rick Strahl
  Richard Kaye
  Dec 16, 2019 @ 11:43pm

That comes from the administration page, so in theory that shouldn't be happening unless you have something monitoring that admin page.

The error is that whatever account you're running the app under doesn't have rights to look at performance counters in Windows it looks like. You'll need to raise the account rights most likely. What account are you running under?

OTOH, this shouldn't fail like this - probably need a guard around that code so if it fails those counters are just not displayed. Wasn't aware that extended rights are required.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Another security question
  Richard Kaye
  Rick Strahl
  Dec 17, 2019 @ 05:39am

We did create a specific account for the app pool. I'll do some research on the rights required but I like the guardrails idea. This log file gets really large really fast.

Gravatar is a globally recognized avatar based on your email address. re: Another security question
  Richard Kaye
  Rick Strahl
  Dec 17, 2019 @ 05:56am

A little research indicates that adding the app pool identity to the Performance Monitor Users security group should set the proper permissions but so far that hasn't made the difference. Still poking at it...

Gravatar is a globally recognized avatar based on your email address. re: Another security question
  Richard Kaye
  Rick Strahl
  Dec 17, 2019 @ 06:04am

Had to restart IIS to get the updated permissions recognized. These errors are no longer being thrown.

© 1996-2020