Re: Running a section of code with admin privileges

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 06/29/05


Date: Tue, 28 Jun 2005 20:21:54 -0700

Hello JCreasy,

i would factor out that privileged code out of your main process. Package
that priv code in a NT Service or a COM+ component. Then let this code run
with admin privs and call into it from your least privileged demon.

Thats IMO the cleanest approach.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> This is rather similar to a post before titled "custom event log".
> What I want to do is use EventLog.CreateEventSource() in a remote
> application that will not be running admin privileges. I was hoping to
> find a way to temporarily allow admin privileges just to do the log
> event and then resume normal privileges.
>
> So far I have not been very succesful in finding a way to do this and
> it might be that it's just impossible for security reasons. If it is
> possible however, I would greatly appreciate any information on how to
> do this.
>



Relevant Pages

  • Re: Running a section of code with admin privileges
    ... so I'll take the event logging code out of the main program and package ... I'm still not sure how to have the COM+ component run with admin privileges ...
    (microsoft.public.dotnet.security)
  • Re: Granting Domain Users Local Admin Rights
    ... environment how is giving Domain Users local admin rights insufficient? ... All users getting Local Admin privileges? ...
    (microsoft.public.windowsxp.security_admin)
  • [Full-disclosure] [USN-162-1] ekg and Gadu library vulnerabilities
    ... ekg vulnerabilities ... The problem can be corrected by upgrading the affected package to ... upgrade since it uses the libgadu3 library package. ... with the privileges of the user running ekgbot. ...
    (Full-Disclosure)
  • [USN-162-1] ekg and Gadu library vulnerabilities
    ... ekg vulnerabilities ... The problem can be corrected by upgrading the affected package to ... upgrade since it uses the libgadu3 library package. ... with the privileges of the user running ekgbot. ...
    (Bugtraq)
  • Re: NDIS intermediate driver under Windows 7
    ... But the driver could not be opened. ... as far as privileges go I don't remember which account it was ... how would i check if the app is running with admin privileges? ... everything I need to run and I think microsoft has wasted several ...
    (microsoft.public.development.device.drivers)