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

iis security : IIS 6 ASP: Which Process Identity Is It Using? App Pool or Anon?


C K
2/12/2004 5:16:35 PM
Hi,

I am currently test running an old ASP application on IIS 6.0 and I have a
question on what user identity is actually being used. I created a new
application pool with its own service identity account (let's call it
TestService, and added it to the IIS_WPG group) and assigned the web app to
use the app pool. I have also enabled anon access on the web app, using the
IUSR account. The web app, upon start up, a COM object connects to a
network server and d/ls files to a data directory. The data directory has
to have correct NTFS permissions for this to work.

Now... here are my tests.

1) I first set the NTFS permissions of the data directory to NOT allow
modify/write access to the TestService account and to allow modify/write
access to the IUSR account (I know I'm not supposed to, but this is just a
test). This did not work.

2) I then set the data directory to allow modify/write access to the
TestService account and the IUSR to only have read access. This worked.

etc...

What I basically found was that only the NTFS setting on the TestService
account mattered for this operation to succeed. But based on all I've read,
isn't it the authenticated user (in this case, the IUSR) that's supposed to
be impersonated, and all actions are performed as if it was the IUSR? In
this case, it doesn't even seem like the NTFS settings for IUSR matter at
all. I even removed IUSR from the NTFS permissions completely and it still
worked. Does anyone know why?

This is an excerpt from a Microsoft document:
For ASP applications, the type of authentication that is used by the user
automatically determines impersonation behavior. Because the impersonation
behavior is automatic, no configuration is required.

The impersonation behavior in an ASP application is as follows:

· If an anonymous user makes a request, the thread token is based on
the user account that is configured as the anonymous user identity (by
default, this is the IUSR_machinename user account).

· If an authenticated user makes a request, the thread token is
based on the authenticated account of the user.







Thanks if anyone can explain this to me.


David Wang [Msft]
2/12/2004 9:27:40 PM
ASP itself uses the impersonated identity - we verify that on IIS6. Custom
code that ASP runs, like your COM object, could be doing something else.
Actions done by the custom code, like connect to a network server and d/l
files, is completely subject to its behavior, not ASP's. It could cooperate
with ASP's behavior, but it doesn't have to.

Is the COM object configured to use the impersonated (IUSR) or process
(TestService) identity?

For example, a COM object could be calling RevertToSelf(), which in older
IIS gives it access to LocalSystem (in low isolation) or IWAM (in
medium/high isolation). It will now be using "TestService" identity.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
[quoted text, click to view]
Hi,

I am currently test running an old ASP application on IIS 6.0 and I have a
question on what user identity is actually being used. I created a new
application pool with its own service identity account (let's call it
TestService, and added it to the IIS_WPG group) and assigned the web app to
use the app pool. I have also enabled anon access on the web app, using the
IUSR account. The web app, upon start up, a COM object connects to a
network server and d/ls files to a data directory. The data directory has
to have correct NTFS permissions for this to work.

Now... here are my tests.

1) I first set the NTFS permissions of the data directory to NOT allow
modify/write access to the TestService account and to allow modify/write
access to the IUSR account (I know I'm not supposed to, but this is just a
test). This did not work.

2) I then set the data directory to allow modify/write access to the
TestService account and the IUSR to only have read access. This worked.

etc...

What I basically found was that only the NTFS setting on the TestService
account mattered for this operation to succeed. But based on all I've read,
isn't it the authenticated user (in this case, the IUSR) that's supposed to
be impersonated, and all actions are performed as if it was the IUSR? In
this case, it doesn't even seem like the NTFS settings for IUSR matter at
all. I even removed IUSR from the NTFS permissions completely and it still
worked. Does anyone know why?

This is an excerpt from a Microsoft document:
For ASP applications, the type of authentication that is used by the user
automatically determines impersonation behavior. Because the impersonation
behavior is automatic, no configuration is required.

The impersonation behavior in an ASP application is as follows:

· If an anonymous user makes a request, the thread token is based on
the user account that is configured as the anonymous user identity (by
default, this is the IUSR_machinename user account).

· If an authenticated user makes a request, the thread token is
based on the authenticated account of the user.







Thanks if anyone can explain this to me.



C K
2/13/2004 11:09:23 AM
Hi Bernard,

The only two ACLs I have is 1) Administrators Group (full control) 2) The
TestService account. I have removed all inheritance for this folder so it
is only those two ACLs in effect.

I have also just tried using filemon to see what is causing the problem and
I do see some ACCESS DENIED messages when the TestService account does not
have write access. However, filemon does not show the user identity, it
only shows the process name w3wp.exe. However, it must be the TestService
account because when I give it write access to the folder, everything works
ok.

In my other response, I mentioned that the routines to retrieve the data
from a remote server are in a statically linked dll (which I do not
maintain). I believe it connects to the remote server via named pipe. But
all this shouldn't matter right? Because it is getting the ACCESS DENIED on
the file system due to insufficient NTFS permission.

Any ideas?

Thanks.



[quoted text, click to view]

Bernard
2/13/2004 6:39:03 PM
Wow, now you make me confuse :)
what other ACLs you have for the data folder ?

AFAIK, your 'testservice' is process identity to execute the w3wp.exe
and the 'iusr' user identity for actual access.

have you try filemon (sysinternals.com) and actually trace down the 'user'
that writting the content.

--
Regards,
Bernard Cheah
http://support.microsoft.com/
Please respond to newsgroups only ...


[quoted text, click to view]

Bernard
2/15/2004 9:46:17 PM
I don't see your other response in the thread.
now, as david pointed out do you change the security settings in your com
object ?

--
Regards,
Bernard Cheah
http://support.microsoft.com/
Please respond to newsgroups only ...


[quoted text, click to view]

AddThis Social Bookmark Button