Groups | Blog | Home
all groups > iis security > may 2004 >

iis security : ASP.NET Impersonation Works, ASP Classic doesn't


maryesme NO[at]SPAM shore.net
5/6/2004 11:01:00 AM
Okay, here's the story:

Win2K, IIS5

We have several ASP pages that access Access databases located on a
Novell server. We had the Novell server's administrator add an
account with the same name as the account we have registered in the
AD. We coordinated the passwords. I added this account to the
Administrators group and was able to have an ASP page on the web
server connect to an Access database on the Novell server (I changed
the anonymous user to be the user we created and had it use its
password). I made a test ASP.NET page to connect to the same database
from the same folder on the web server. Added the code into
web.config to have it impersonate. All of this worked fine. Now, the
kicker. I don't want the account in the Administrators group for
obvious reasons... So I move it to another group. Starting with full
access rights (hoping to be able to reel those rights back in as much
as functionally possible). No dice. The ASP classic page fails to
connect to the database. The ASP.NET page, on the other hand, with
the impersonation in place, appears to connect without a hitch, even
when I take the accounts rights away. So, what is happening here?
How can I fix this? What am I missing?

I would appreciate any hints you guys can give me.

Tom Kaminski [MVP]
5/6/2004 2:34:56 PM
[quoted text, click to view]

Start here:
http://www.aspfaq.com/show.asp?id=2168

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/


Mark Lybrand
5/6/2004 3:00:02 PM

Thanks for the quick response.

I must be the thickest person on the face of the earth, but that ASPFAQ
article did not appear to directly address my issue (but would have been
a big help in the first phase of the issue).

Maybe I can further clarify what I have successfully accomplished and
what I haven't.

1. On Win2k, IIS5.
2. This machine is part of our organization's Active Directory. Let's
call the organization "department"
3. I had our network folks create a user in the AD; let's call him
"webuser".
4. Also had the administrator of the Novell server in question create a
user called "webuser" and gave that user full rights to resources in
question.
5. Passwords were synchronized in both the AD and on the Novell server.
6. Added user, picked from AD, to the Administrators group on Win2k box.
7. Set up share through Gateway Services for NetWare (to establish the
necessary connection between this box and the Novell box).
8. In IIS, made the changes to the web app to all anonymous and changed
the anonymous user to the above webuser from the AD, using the now
synchronized password.
9. Changed connection string in ASP page to use the fully qualified UNC.
10. Successfully connected and processed page!!!
11. Didn't want webuser in Administrators group (too many rights). So
placed him in a group with fewer rights on the Win2k box.
12. Failure. Checked to make sure that that group had access to
Inetpub/wwwroot/applcition. Failure (but the ASP.NET test version began
working again at this point)
13. Changed connection string to point to another box (Win2k, to make
sure the whole Novell thing is not the issue). No dice. But the
ASP.NET version still works (Oh, BTW, first thing I do with every
failure is to start and stop IIS, in case that is an issue).

I had expected the ASP.NET version to break too, but it kept working....
So, I am assuming that there is some other folder that is being accessed
by IIS alone when establishing the connection, that ASP.NET bypasses
(hence the breakage when groups are changed). It's unforunate, because
the ASP.NET error message would have been infinitely more useful than
the ASP message. Am I on the right track? What folders should I be
looking at? Am I just refusing to see the solution that I have already
been shown?

Thanks again for your willingness to help.


*** Sent via Developersdex http://www.developersdex.com ***
Roger Abell
5/7/2004 6:04:18 AM
[quoted text, click to view]
and that account was granted logon rights on the IIS box ? such
as by adding it to the machine local Users group ??? in general
there are other User Rights the backend account(s) also need . . .

--
Roger Abell
Microsoft MVP (Windows Server System: Security)
MCSE (W2k3,W2k,Nt4) MCDBA
[quoted text, click to view]

Tom Kaminski [MVP]
5/7/2004 8:13:11 AM
[quoted text, click to view]

What's the exact error message and what does your connection string look
like?

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/


Mark Lybrand
5/7/2004 11:17:26 AM

I am not at work today, but on Monday I will give you the exact details.

Again, thanks for your willingness to help.

Mark :)


*** Sent via Developersdex http://www.developersdex.com ***
Mark Lybrand
5/8/2004 2:27:55 AM
"Roger Abell" <mvpNOSpam@asu.edu> wrote in news:eUC3YODNEHA.3988
@TK2MSFTNGP09.phx.gbl:

[quoted text, click to view]

Hmmmm... That's interesting. So, when the user was in Administrators, he
obviously had logon rights (given his being an administrator). Need to
check the new group to see if that one has logon rights? I put him in
Power Users (also not where I want that account to end up, but my next step
in removing rights). I will definitely follow up on this. Why would this
not affect the dotnet stuff though? The impersonation through dotnet never
broke, only the ASP classic stuff where I set up the impersonation in IIS
(as opposed to an entry in web.config). Thanks for the lead though; this
gives me another avenue to explore.

Mark Lybrand
5/10/2004 8:41:21 AM
Okay. Here is the exact error message and connection string:

Error:

Error Type:
Microsoft JET Database Engine (0x80004005)
'\\server_name\path\CNs.mdb' is not a valid path. Make sure that the
path name is spelled correctly and that you are connected to the server
on which the file resides.
/webpath/Default.asp, line 35

Connection string:

Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=\\server_name\path\CNs.mdb;
(this string is all on one line -- in case you are viewing it broken).

Thanks again.

Mark

*** Sent via Developersdex http://www.developersdex.com ***
Tom Kaminski [MVP]
5/10/2004 3:02:26 PM
[quoted text, click to view]

Start here then:
http://www.aspfaq.com/show.asp?id=2009
http://www.aspfaq.com/show.asp?id=2168

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/


AddThis Social Bookmark Button