473,467 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Am I missing something or has MS missed the plot?

Hi,

you are right - Windows needs the password in plaintext to impersonate a user (having to call LogonUser, which requires a password). Thinking about it - it is the only way Windows can do it.

So if you want to use the Windows infrastructure that's already there you have to combine option 1 or 3 with option 2. If SSL seems too slow to you - buy a SSL processor card (IIS6 supports them) to speed up the encryption.

Another option would be (works only on IIS 6 being a domain member) -

you can leverage the new W2K3 Kerberos S4U services.

1) use wse the send hashed password

2) authenticate the user somehow and provide the cleartext password in UserNameTokenManager

or

1) use a X509 Token

2) authenticate the token somehow

associate the user with a existing windows account (e.g. through a database) and call

WindowsIdentity winid = new WindowsIdentity("user@domain");

WindowsPrincipal principal = new WindowsPrincipal(winid);

you will get a token that you can use for role inspection (calling IsInRole).

To impersonate to access local resources the service has to run as LOCAL SYSTEM

To impersonate to access remote resources, configure constrained delegation in AD for the WebServer (you don't have to be running under SYSTEM in this case)

to enable both scenarios, just call winid.Impersonate();

hope this helps

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

nntp://news.microsoft.com/microsoft.public.dotnet.framework.webservices/<#v**************@TK2MSFTNGP11.phx.gbl>

Hello all,

I'm trying to do something which I believe is very normal, standard sort of
requirement. I want to secure access to a web service across the Internet
using username/password on the server, then impersonate the account on that
server.

Option 1 - set IIS to basic authentication, which all works great, except
that passwords are transmitted in clear, so that's obviously useless.

Option 2 - as option 1, but encrypt everything using IIS. Seems great, but
runs ridiculously slowly because asymmetric encryption is so ludicrously
slow and a complete waste as there's no need to encrypt much apart from the
password.

On to option 3, WSE, but as far as I can tell from the confused
documentation, the only ways to impersonate are to use Kerberos (no use
here) or plain text passwords (just as bad as option 1). There seems to be
some chat about using hashed passwords, which would be absolutely ideal, but
I've yet to find and useful examples of a token manager which can do this
and just drop-in to an application?

It just seems that MS has really missed the plot here. Why has MS made
something so standard so difficult?

Any pointers, code, hints etc most welcome.

Cheers,

Tim
t_********@hotmail.com



[microsoft.public.dotnet.framework.webservices]
Nov 21 '05 #1
1 2543
Thanks, thought so. Why does MS make it so hard to do the obvious simple
things while constructing great edifices to do obscure complicated things?
Come on MS - why not do something to make life easier for us developers?

I guess a solution might be for me to use SSL (or X.509 in WSE) to transmit
username and password to the server where it can be stored, then use plain
HTTP after that. The pain is that I presumably have to do some code at the
top of every method to impersonate that user, as well as sending some hash
to prove client identity - all very painful. Is there some way to use WSE
to hide this sort of stuff away under the hood? Ideally it should just
happen transparently, or perhaps need no more than an [Impersonate]
attribute on a class or method!

SSL processor cards are not much good, as I can't assume that every user
will want to buy one. Judging by the speed of Amazon's secure site at the
weekend (presumably they have these) even such addons aren't enough to make
SSL usable. Why oh why can't someone do the obvious and come up with
"SSL++", a protocol which uses asymmetric encryption to swap a secret key,
then use this key to encrypt/decrypt subsequent traffic symmetrically much
faster, all under the hood? It would really make web services practical at
last! Come on Microsoft - this is a fantastic addon for WSE 3.0, Indigo
and/or IIS. Revolutionise the Internet and save the world...

It's just so frustrating - all this security stuff, but the simplest, most
obvious thigs have slipped through the net!

Cheers,

Tim

"Dominick Baier" <do****@leastprivilege.com> wrote in message
news:ey***************@TK2MSFTNGP10.phx.gbl...
Hi,

you are right - Windows needs the password in plaintext to impersonate a user (having to call LogonUser, which requires a password). Thinking about
it - it is the only way Windows can do it.
So if you want to use the Windows infrastructure that's already there you have to combine option 1 or 3 with option 2. If SSL seems too slow to you -
buy a SSL processor card (IIS6 supports them) to speed up the encryption.
Another option would be (works only on IIS 6 being a domain member) -

you can leverage the new W2K3 Kerberos S4U services.

1) use wse the send hashed password

2) authenticate the user somehow and provide the cleartext password in UserNameTokenManager
or

1) use a X509 Token

2) authenticate the token somehow

associate the user with a existing windows account (e.g. through a database) and call
WindowsIdentity winid = new WindowsIdentity("user@domain");

WindowsPrincipal principal = new WindowsPrincipal(winid);

you will get a token that you can use for role inspection (calling IsInRole).
To impersonate to access local resources the service has to run as LOCAL SYSTEM
To impersonate to access remote resources, configure constrained delegation in AD for the WebServer (you don't have to be running under
SYSTEM in this case)
to enable both scenarios, just call winid.Impersonate();

hope this helps

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

nntp://news.microsoft.com/microsoft.public.dotnet.framework.webservices/<#v**************@TK2MSFTNGP11.phx.gbl>
Hello all,

I'm trying to do something which I believe is very normal, standard sort of requirement. I want to secure access to a web service across the Internet
using username/password on the server, then impersonate the account on that server.

Option 1 - set IIS to basic authentication, which all works great, except
that passwords are transmitted in clear, so that's obviously useless.

Option 2 - as option 1, but encrypt everything using IIS. Seems great, but runs ridiculously slowly because asymmetric encryption is so ludicrously
slow and a complete waste as there's no need to encrypt much apart from the password.

On to option 3, WSE, but as far as I can tell from the confused
documentation, the only ways to impersonate are to use Kerberos (no use
here) or plain text passwords (just as bad as option 1). There seems to be some chat about using hashed passwords, which would be absolutely ideal, but I've yet to find and useful examples of a token manager which can do this
and just drop-in to an application?

It just seems that MS has really missed the plot here. Why has MS made
something so standard so difficult?

Any pointers, code, hints etc most welcome.

Cheers,

Tim
t_********@hotmail.com



[microsoft.public.dotnet.framework.webservices]

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dr. Colombes | last post by:
MatPlotLib question: How to get more different size plot symbols in the plot function ? Is there a way to get different size squares (or circles or triangles, etc.) ? For example, in a two...
1
by: Dr. Colombes | last post by:
Using MatPlotLib plot function, is there a way to get variable size plot symbols? For example, using symbol strings like 'o' (circle), 's' (square), 'x' (cross), etc., is there a way to specify...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
1
by: Tim Haynes | last post by:
Hello all, I'm trying to do something which I believe is very normal, standard sort of requirement. I want to secure access to a web service across the Internet using username/password on the...
1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
2
by: Steven D'Aprano | last post by:
When using the timeit module, you pass the code you want to time as strings: import timeit t = timeit.Timer("foo(x, y)", \ """from module import foo x = 27 y = 45 """) elapsed_time =...
0
by: toton | last post by:
Hi, for my project I needs a few plots to visualize the data (mostly x-y plot) . Most of the existing plotting library either copy the data and do plotting, or takes a data pointer to an 2d x-y...
1
by: c8tz | last post by:
Hi, I have a palms table that stores palm census for each and every palm for a block on every trial. Every trial has a set number of blocks and set number of palms. Each of the palms has a palm...
1
by: dazzler | last post by:
Hi! I just moved using wxpython so I'm a quite newbie. I was wondering how to update plotcanvas? In my code I made button with event to update plotcanvas with new results, but how to properly do...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.