August 25, 2009

Q: What is the easiest way to set up access control restrictions on the content of our intranet websites that are hosted on an IIS 7.0 web server?

RSS
Subscribe to Windows IT Pro | See More Active Server Pages (ASP) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

A: IIS 7.0 web servers support an access control feature that called URL Authorization that allows you to easily define access to a web site by linking a set of permissions to the site’s URL. You can control access to all content types, including static files and ASP files, based on the user account, group memberships, ASP.NET role membership, and URL of the web resource.

You can set these access restrictions without changing other IIS or NTFS permissions. If you've worked with earlier IIS versions, you've probably been annoyed by the complexity of setting up access control for web resources on the IIS platform. You not only have to take into account the web server-specific permissions (the Read, Write... permissions configurable from the Home Directory tab in an IIS 5.0 and 6.0’s web site’s properties), but also the NTFS-level permissions.

IIS 6.0 provides a similar URL authorization feature, but it isn't well integrated with the web server and requires a complex manual setup procedure. The IIS 6.0 URL authorization mechanism is documented in a Microsoft Knowledge Base article.

Unlike IIS 7.0, IIS 6.0's URL Authorization uses the Authorization Manager (AzMan) access control engine. Note that this old IIS 6.0 mechanism is still around in IIS 7.0, but I advise you to use the new URL authorization.

The IIS 7.0 URL authorization mechanism can be configured from the Authorization Rules Configuration item in the IIS Manager. This configuration item is available in the Features view of the web server and of every website. In the Authorization Rules interface, you can configure simple allow and deny rules for specific Windows user accounts or groups, or ASP.NET roles to control access to a website’s URL. The allow/deny rules can also be fine-tuned based on the use of particular HTTP verbs.

To illustrate how easy it is to set up access restrictions for a website using URL Authorization, try the following example. Create two Windows user accounts, Alice and Bob. Remove the default Allow rule for All Users on the IIS Default Web Site, create an Allow rule for Alice and a Deny rule for Bob, and then try to access the Default Web Site using each account. Your attempt should result in a configuration screen similar to the one in Figure 1, shown here.

Click to expand.

You should also look at the resulting web.config configuration file entries for the authorization rules that are set up in the Alice/Bob example. The content of the web.config file is illustrated in Figure 2, and you can see it's easy to define and edit authorization rules directly in a web site’s configuration file without going through the IIS Manager interface. Also note that you can easily transfer these rules to another web server, which can be helpful in a web farm setup. Simply copy the application’s web.config file to the other servers of the web farm.

Click to expand.

Related Reading:
  • Understanding IIS 7.0 Authentication
  • 6 New Security Features in IIS 7.0
  • Q. How can I enable Internet Printing under Microsoft IIS?
  • 6 New Security Features in IIS 7.0
  • End of Article



    Windows IT Pro Community
    Blogs





    Top Viewed ArticlesView all articles
    WinInfo Short Takes: Week of November 23, 2009

    An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

    Command Prompt Tricks

    One reader shares his tip for setting up the command prompt to reflect a remote path. ...

    2009 Windows IT Pro Editors' Best and Community Choice Awards

    Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


    IIS and Web Administration Whitepapers Best Practices for SharePoint Backup & Recovery

    Meeting Compliance Objectives in SharePoint

    Improve SharePoint Performance for Remote Workers

    Related Events Check out our list of Free Email Newsletters!

    IIS and Web Administration eBooks Web Filtering: An Assessment

    Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

    Related IIS and Web Administration Resources Introducing Left-Brain.com, the online IT bookstore
    Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

    Discover Windows IT Pro eLearning Series!
    Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


    SQL Server Magazine Office & SharePoint Pro DevProConnections asp.netPRO ITTV
    IT Library Technology Resource Directory Connected Home Windows SuperSite
     
     Windows IT Pro is a Division of Penton Media Inc.
     © 2009 Penton Media, Inc.     Terms of Use | Privacy Statement