Re: Cannot read a Security Log from ASP.net web service

From: Ian Wright (ian-c-wright_at_msn.com)
Date: 05/23/04


Date: Sat, 22 May 2004 18:00:20 -0400

Good suggestion, but I tried that a little earlier just to see if it would
work (and yes, it's a very bad idea to grant that permission to the ASPNET
account). Anyway, the error is still the same. It looks to me as though
it's just a defect in the runtime/IIS. Maybe MS just decided to lock down
the security log so that nothing even remotely related to the ASPNET process
can touch it.

Here's the error I get after adding the ASPNET account to the Admin group:

Cannot open log Security on machine .. Windows has not provided an error
code.

at System.Diagnostics.EventLog.OpenForRead()
at System.Diagnostics.EventLog.get_EntryCount()
at System.Diagnostics.EventLogEntryCollection.get_Count()
at System.Diagnostics.EntriesEnumerator.MoveNext()
at EventLogArchiver.ServerEventLogReader.GetServerEvents(String LogName) in
c:\inetpub\wwwroot\EventLogArchiver\ServerEventLogReader.asmx.vb:line 71

TY Eric for taking the time to respond.

"Ian Wright" <ian-c-wright@msn.com> wrote in message
news:eL5cgGEQEHA.640@TK2MSFTNGP09.phx.gbl...
> I'm attempting to read the security event log for a WinXP Pro machine
using
> a web form that calls a web service. Both files are stored in the same
> directory in IIS. The directory is set to use Windows Integrated security
> and I've set up the web app to use impersonation with the local admin
> account on a WinXP Pro box.
>
> I get the following error though whenever I attempt to iterate over the
> Entries collection of the EventLog object:
>
> Cannot open log Security on machine .. Windows has not provided an error
> code.
>
> The application log and the system log can both be read though using the
> same web service. I've altered the machine.config file to use both the
> LOCAL and Administrator accounts with the same result. If I put the same
> code into a Win form project, it works just fine and I'm able to view the
> entries of the security log. Within the web method, I can see that the
> current user making the request is the local administrator by using the
> IIdentity interface of the User object. Explicitly impersonating the
local
> admin using objects of the System.Security namespace doesn't help either.
>
> Signing the web service with sn.exe and putting it into the GAC has not
> helped. I created a code permission that included full privileges to the
> registry and event logs and set my sn assembly to use it, but the same
error
> occurs. Using Regmon.exe, I can see the requests to the registry keys
that
> are made, but no error messages are reported.
>
> Can anyone provide suggestions for a fix?
>
>



Relevant Pages

  • axis and tomcat security manager
    ... I'm trying to run a web service using tomcat with its security manager enabled. ... except now i wish to add a call to an executable in the web service. ... Normally i would give the axis webapp read and execute permissions in the catalina.policy file to the executable in question. ... permission java.security.AllPermission; ...
    (comp.lang.java.programmer)
  • Re: Access is denied to some my folders. How to regain access?
    ... My account has administrative rights. ... I get "You do not have permission to ... and access to some folders on my portable HDD became denied. ...
    (microsoft.public.security)
  • Re: Access is denied to some my folders. How to regain access?
    ... My account has administrative rights. ... I get "You do not have permission to ... and access to some folders on my portable HDD became denied. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Adding a computer account to files security list
    ... > file or folder Security list, but also computer accounts. ... > from granting Change permission on a folder to a computer account? ... It's going to sound redundant but it would allow the computers account ...
    (microsoft.public.win2000.active_directory)
  • Re: NTFS permission for Inprocess DLLs
    ... AFAIK IIS only relies on the underlying Windows security. ... Group memberships of an account are determined when the account ... > in question never visits the visits the IIS until after the permission ...
    (microsoft.public.inetserver.iis.security)