博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IIS application pool access desktop denied
阅读量:5915 次
发布时间:2019-06-19

本文共 4347 字,大约阅读时间需要 14 分钟。

Here's an issue with IIS 7.5 and ASP.NET that I've been researching and getting nowhere with. Any help would be greatly appreciated.

My question is: using ASP.NET in IIS 7.5, how does IIS and/or the operating system allow the web application to write to a folder like C:\dump when running under full trust? How is it that I don't have to explicitly add write access for the application pool user (in this case ApplicationPoolIdentity)?

This much I know:

  • In IIS 7.5, the default Identity for an Application Pool is ApplicationPoolIdentity.
  • ApplicationPoolIdentity represents a Windows user account called "IIS APPPOOL\AppPoolName", which is created when the Application Pool is created, where AppPoolName is the name of the Application Pool.
  • The "IIS APPPOOL\AppPoolName" user is by default a member of the IIS_IUSRS group.
  • If you are running under Full Trust, your web application can write to many areas of the file system (excluding folders like C:\UsersC:\Windows, etc). For example, your application will have access to write to some folders, like, C:\dump.
  • By default, the IIS_IUSRS group is not given read or write access to C:\dump (at least not access that is visible through the "Security" tab in Windows Explorer).
  • If you deny write access to IIS_IUSRS, you will get a SecurityException when trying to write to the folder (as expected).

So, taking all of that into account, how is write access granted to the "IIS APPPOOL\AppPoolName" user? The w3wp.exe process runs as this user, so what allows this user to write to a folder it doesn't seem to have explicit access to?

Please note that I understand this was probably done for the sake of convenience, since it would be a pain to grant a user access to every folder it needs to write to if you are running under Full Trust. If you want to limit this access, you can always run the application under Medium Trust. I am interested in finding out about the way the operating system and/or IIS allows these writes to take place, even though there appears to be no explicit file system access granted.

 ====

The ApplicationPoolIdentity is assigned membership of the Users group as well as the IIS_IUSRS group. On first glance this may look somewhat worrying, however the Users group has somewhat limited NTFS rights.

For example, if you try and create a folder in the C:\Windows folder then you'll find that you can't. The ApplicationPoolIdentity still needs to be able to read files from the windows system folders (otherwise how else would the worker process be able to dynamically load essential DLL's).

With regard to your observations about being able to write to your c:\dump folder. If you take a look at the permissions in the Advanced Security Settings, you'll see the following:

See that Special permission being inherited from c:\:

That's the reason your site's ApplicationPoolIdentity can read and write to that folder. That right is being inherited from the c:\ drive.

====

In a shared environment where you possibly have several hundred sites, each with their own application pool and Application Pool Identity, you would store the site folders in a folder or volume that has had the Users group removed and the permissions set such that only Administrators and the SYSTEM account have access (with inheritance).

You would then individually assign the requisite permissions each IIS AppPool\[name] requires on it's site root folder.

You should also ensure that any folders you create where you store potentially sensitive files or data have the Users group removed. You should also make sure that any applications that you install don't store sensitive data in their c:\program files\[app name] folders and that they use the user profile folders instead.

So yes, on first glance it looks like the ApplicationPoolIdentity has more rights than it should, but it actually has no more rights than it's group membership dictates.

 IIS AppPool\LiveWebChat   需要注意的是,这里必须写完整的。只写一部分是找不到的,比如IIS AppPool\Liv,这里只能精确匹配查找

====

An ApplicationPoolIdentity's group membership can be examined using the SysInternals . Find the worker process that is running with the Application Pool Identity you're interested in (you will have to add the User Name column to the list of columns to display:

 

 

Open ProcessExplorer\procexp64.exe as Administrator and find the w3wp.exe process.

Check the security tab

 

转载地址:http://ymgpx.baihongyu.com/

你可能感兴趣的文章
智能PDU怎样帮助数据中心节能
查看>>
走向5G时代功在技术之外
查看>>
JAVA之抽象类与接口的区别
查看>>
2021年3GPP物联网标准将占蜂窝物联网无线节点出货量一半以上
查看>>
【云和恩墨大讲堂电子期刊】挑战者:Google成功的背后
查看>>
Oracle 12c的一些新等待事件
查看>>
微博已跨过“历史三峡”?
查看>>
加拿大三分之二的电力供应来自可再生能源
查看>>
AngularJS —— 使用模块组织你的代码 【已翻译100%】(2/3)
查看>>
JS中判断对象是不是数组的方法
查看>>
这个是网上下载的一个input模糊搜索 (L01)
查看>>
android.support.v7.widget.SwitchCompat
查看>>
白话composer的简单使用
查看>>
SPI机制与策略模式
查看>>
使用 Docker 和 Traefik 搭建 GitLab (前篇)
查看>>
如何让mysql索引更快一点
查看>>
免费logo创建器launchaco
查看>>
从拥挤的兔子到伪随机数算法
查看>>
随便写写
查看>>
kotlin 中 Collection 相关操作
查看>>