|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Create an Event Log on a Least Privilege User AccountI'm trying to do the following on an x64 Pro system running in a Least
Privilege User Account. (C#) EventLog eventLog = new EventLog("MyLog", ".", "MyLog"); ---------- I get a security exception with the following text. System.Security.SecurityException: Requested registry access is not allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) It there anything I can declare in my code to get around this or is this just a limitation of a LUA? Hello mr.mike.w***@gmail.com,
by default - a LUA is not allowed to create event logs and sources - run this from a console app which has admin privs - writing to this Log afterwards is not a problem. There are also some registry ACLs to tweak to make this work even under LUA - but i wouldn't recommend that (if you absolutely need them, ping me) --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > I'm trying to do the following on an x64 Pro system running in a Least > Privilege User Account. > > (C#) > EventLog eventLog = new EventLog("MyLog", ".", "MyLog"); > ---------- > I get a security exception with the following text. > > System.Security.SecurityException: Requested registry access is not > allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, > Boolean writable) > > It there anything I can declare in my code to get around this or is > this just a limitation of a LUA? > Hmm... Since admin privileges would also be required to adjust the ACLs, why
not just create the event log while running with the elevated privileges rather than adjusting the ACLs? Obviously, other considerations might enter in for recurrent log creation, but there's no reason to believe (or at least not yet <g>) that this is the requirement in OP's situation. Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:700746632588307916458732@news.microsoft.com... > Hello mr.mike.w***@gmail.com, > > by default - a LUA is not allowed to create event logs and sources - run > this from a console app which has admin privs - writing to this Log > afterwards is not a problem. There are also some registry ACLs to tweak to > make this work even under LUA - but i wouldn't recommend that (if you > absolutely need them, ping me) > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > >> I'm trying to do the following on an x64 Pro system running in a Least >> Privilege User Account. >> >> (C#) >> EventLog eventLog = new EventLog("MyLog", ".", "MyLog"); >> ---------- >> I get a security exception with the following text. >> >> System.Security.SecurityException: Requested registry access is not >> allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, >> Boolean writable) >> >> It there anything I can declare in my code to get around this or is >> this just a limitation of a LUA? >> > > > Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,
yes :) thats exactly what i wanted to say. have a installer that runs at deployment time (with admin privs), create source and log. and party on :) --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Hmm... Since admin privileges would also be required to adjust the > ACLs, why not just create the event log while running with the > elevated privileges rather than adjusting the ACLs? Obviously, other > considerations might enter in for recurrent log creation, but there's > no reason to believe (or at least not yet <g>) that this is the > requirement in OP's situation. > > "Dominick Baier [DevelopMentor]" > <dbaier@pleasepleasenospamdevelop.com> wrote in message > news:700746632588307916458732@news.microsoft.com... > >> Hello mr.mike.w***@gmail.com, >> >> by default - a LUA is not allowed to create event logs and sources - >> run this from a console app which has admin privs - writing to this >> Log afterwards is not a problem. There are also some registry ACLs to >> tweak to make this work even under LUA - but i wouldn't recommend >> that (if you absolutely need them, ping me) >> >> --------------------------------------- >> Dominick Baier - DevelopMentor >> http://www.leastprivilege.com >>> I'm trying to do the following on an x64 Pro system running in a >>> Least Privilege User Account. >>> >>> (C#) >>> EventLog eventLog = new EventLog("MyLog", ".", "MyLog"); >>> ---------- >>> I get a security exception with the following text. >>> System.Security.SecurityException: Requested registry access is not >>> allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, >>> Boolean writable) >>> >>> It there anything I can declare in my code to get around this or is >>> this just a limitation of a LUA? >>> In addition to what Dominick has already said, you may want to consider
creating the event log via your application's installer since that is a context in which you can reasonably require use of an admin account. <mr.mike.w***@gmail.com> wrote in message Show quoteHide quote news:1123206702.786183.65230@g14g2000cwa.googlegroups.com... > I'm trying to do the following on an x64 Pro system running in a Least > Privilege User Account. > > (C#) > EventLog eventLog = new EventLog("MyLog", ".", "MyLog"); > ---------- > > I get a security exception with the following text. > > System.Security.SecurityException: Requested registry access is not > allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean > writable) > > It there anything I can declare in my code to get around this or is > this just a limitation of a LUA? >
Authorization against AD using MC++
Why defaultcredential doesn't use the impersonated user? Java security api - DCE 128bit encryption with .NET SecurityException: Request Failed on CreateInstanceAndUnwrap HttpWebRequest.GetRequestStream - Trust Failure In Windows Service Bad Data error in DES encryption Securing a control assembly against use of foreign assemblies sn.exe exit code documentation ? Runtime error when running caspol w/ -pub -hex Propagate Credentials from Internet Explorer Host Instead of Defau |
|||||||||||||||||||||||