HighTechTalks DotNet Forums  

Windows Forms security - Impersonation / Service / Something else?

Dotnet Security microsoft.public.dotnet.security


Discuss Windows Forms security - Impersonation / Service / Something else? in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Justin
 
Posts: n/a

Default Windows Forms security - Impersonation / Service / Something else? - 06-25-2004 , 12:19 PM






Hi,

I have inherited a windows forms app, which automates software updates. It
is reasonably close, in pattern, to the Updater Application block from
Microsoft.

The app needs to register / un-register COM components on the client
machine, as part of the software update process. The logged on user will not
be an administrator on the local machine. What would be the best way of
implementing some form of 'run as...' or windows identity impersonation for
either the whole app or the COM registration functionality.

I have looked at using a service, but the existing app architecture does not
lend itself to this. Either as moving the higher security requirement
functions out to the service, or using the service to launch the app.

Any guidance gratefully appreciated.

Thanks

Justin



Reply With Quote
  #2  
Old   
Joe Kaplan \(MVP - ADSI\)
 
Posts: n/a

Default Re: Windows Forms security - Impersonation / Service / Something else? - 06-25-2004 , 02:38 PM






You can p/invoke the LogonUser API to create a more privileged token and
impersonate that. You'll need to figure out how to securely store or
transport the privileged credentials, but doing that should work.

However, if your clients aren't all on WinXP (or 2K3 server), then calling
LogonUser will give you trouble since Win2K requires you to be SYSTEM (or
have the "act as part of operating system" privilege, which essentially
makes you SYSTEM) to call LogonUser.

The other problem is that if you are going to use the Process class to call
out to regsrv32, that doesn't inherit impersonation tokens and will use the
process token instead. Therefore, you may need to p/invoke
CreateProcessAsUser instead. Same Win2K restrictions apply as with
LogonUser.

HTH,

Joe K.

"Justin" <justin (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I have inherited a windows forms app, which automates software updates. It
is reasonably close, in pattern, to the Updater Application block from
Microsoft.

The app needs to register / un-register COM components on the client
machine, as part of the software update process. The logged on user will
not
be an administrator on the local machine. What would be the best way of
implementing some form of 'run as...' or windows identity impersonation
for
either the whole app or the COM registration functionality.

I have looked at using a service, but the existing app architecture does
not
lend itself to this. Either as moving the higher security requirement
functions out to the service, or using the service to launch the app.

Any guidance gratefully appreciated.

Thanks

Justin





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.