W
Willy Denoyette [MVP]
| > Right, but Tim has split the thread and talked about writing to the
Registry
| > (HKLM) and I replied to him not to You, right?.
|
| No, i said that in order to write to the eventlog, you need to have
| permissions to do so.
Per default, all users have the write privileges to the Application log or
any other private log, only administrator have the write privs. to the
System log, and no-one can directly write to the Security log.
But this is not the point, You said...
If i remember well, i had to give the
| 'network' user access rights to the registry keys..
|
I asked..
and you replied with:
HKLM/System/CurrentControlSet/Services/Eventlog (or one of it's
children).
and I answered with:
Yes, but why do you want your service to write to this key?
Only Administrators (and localsystem) are allowed to write to HKLM and
descendants, Service accounts are not supposed to write to HKLM. If you
really need your service to write to HKLM, you need to run as "localsystem".
Again if you grant a non privileged account write access to HKLM, you
severely compromise your system's security.
And the point is that giving network user (I guess you mean "Network
Service) write access privileges to
HKLM/System/CurrentControlSet/Services/Eventlog is only required if you want
"Network service" to create the 'source' (private log), which is bad
practice.
Let an administrator create the source (remember "Network Service" is a
restricted account, don't give hime more rights than he deserves and
"Network service" will automatically be able to write to this log without
granting any elevated privileges.
Willy.
Registry
| > (HKLM) and I replied to him not to You, right?.
|
| No, i said that in order to write to the eventlog, you need to have
| permissions to do so.
Per default, all users have the write privileges to the Application log or
any other private log, only administrator have the write privs. to the
System log, and no-one can directly write to the Security log.
But this is not the point, You said...
If i remember well, i had to give the
| 'network' user access rights to the registry keys..
|
I asked..
What registry key's?
and you replied with:
HKLM/System/CurrentControlSet/Services/Eventlog (or one of it's
children).
and I answered with:
Yes, but why do you want your service to write to this key?
Only Administrators (and localsystem) are allowed to write to HKLM and
descendants, Service accounts are not supposed to write to HKLM. If you
really need your service to write to HKLM, you need to run as "localsystem".
Again if you grant a non privileged account write access to HKLM, you
severely compromise your system's security.
And the point is that giving network user (I guess you mean "Network
Service) write access privileges to
HKLM/System/CurrentControlSet/Services/Eventlog is only required if you want
"Network service" to create the 'source' (private log), which is bad
practice.
Let an administrator create the source (remember "Network Service" is a
restricted account, don't give hime more rights than he deserves and
"Network service" will automatically be able to write to this log without
granting any elevated privileges.
Willy.