Re: Windows Service - Event Log
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Fri, 30 Jun 2006 22:51:30 +0200
"Kevin Spencer" <uce@xxxxxxx> wrote in message
news:O8fkyjFnGHA.4784@xxxxxxxxxxxxxxxxxxxxxxx
| Just one comment:
|
| > None of the services run as Administrator, a great deal run as SYSTEM
(on
|
| I didn't say the Administrator account. I said "a member of the
| Administrators group on the local machine."
|
Nor did I, an Administrator IS a member of the administrators group, I
didn't spell THE Administrator, right? But if you insist, none of my
services run as 'a member of the Administrators group".
| That said, I didn't advocate using a member of the Administrator's group;
it
| was just information.
|
| As to whether or not a Service should run as the Local System account,
| that's a matter of what the Service does (requirements). Whether it should
| be run as Local System just to create an Event Log, that isn't necessary,
as
| the installation could set up the Event Log. Of course, the person running
| the installation would have to be a member of the Administrator's group to
| do this.
Sure, but that's the role of an admin, execute tasks that require
administrative privileges. The problem with the framework however is, that
none of the API's are documenting these security requirements.
Consider the sample in the docs:
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource")){
EventLog.CreateEventSource("MySource", "MyNewLog");
Console.WriteLine("CreatingEventSource");
....
This should be run by an "administrator", for two reasons:
1. The CreateEventSource call, creates the key MySource in
HKLM/System/CurrentControlSet/Services/Eventlog
2. and CreateEventSource creates the logfile in %windir%\system32\config
which only allows admins to create files into.
Someone running this code as non-admin, will encounter two security issues
and will start tweaking the registry and the filesystem, bummer. More, he
will probably post this as THE solution for the issue at hand.
Willy.
.
- References:
- Windows Service - Event Log
- From: pisquem
- Re: Windows Service - Event Log
- From: Tim Van Wassenhove
- Re: Windows Service - Event Log
- From: Willy Denoyette [MVP]
- Re: Windows Service - Event Log
- From: Tim Van Wassenhove
- Re: Windows Service - Event Log
- From: Willy Denoyette [MVP]
- Re: Windows Service - Event Log
- From: Kevin Spencer
- Re: Windows Service - Event Log
- From: Willy Denoyette [MVP]
- Re: Windows Service - Event Log
- From: Tim Van Wassenhove
- Re: Windows Service - Event Log
- From: Kevin Spencer
- Re: Windows Service - Event Log
- From: Willy Denoyette [MVP]
- Re: Windows Service - Event Log
- From: Kevin Spencer
- Windows Service - Event Log
- Prev by Date: Re: How to prevent Events from being queued?
- Next by Date: Re: Please confirm this is a MSFT bug
- Previous by thread: Re: Windows Service - Event Log
- Next by thread: Re: Windows Service - Event Log
- Index(es):
Relevant Pages
|