I am testing an ASP.NET application on Windows Server 2019 with .Net Framework 4.7.2. The IIS Application is setup to impersonate a user that does NOT have administrative privileges.
The application calls EventLog.SourceExists
to check if a event log source exists before trying to create a new source. I understand this method requires administrative privileges in order to search existing event logs for the source [1]. Another way to accomplish this, I explicitly give my user read permissions to the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog
and all children.
This works on versions prior to Windows Server 2019 (2016, 2012 R2, 2018).
When testing, this same application fails on Windows Server 2019 with the exception.
The source was not found, but some or all event logs could not be searched. Inaccessible logs: State.
When running procmon, I see Access Denied when trying to open the registry key for the "State" eventlog HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\State
The "State" registry key appears new to Windows Server 2019. It's also protected - It's owned by SYSTEM, and Administrators is limited to read only. I get Access Denied when trying to give my user read permissions. As a result, my application running as my non-admin user fails with Inaccessible logs: State
when calling EventLog.SourceExists.
I realize I could take ownership of the State
registry key and add my user. However, before I do this, I would like to see if anyone has knowledge of this new registry key (eventlog) in Windows Server 2019.
Thanks.