11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

138 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sURL AuthorizationAdministrators can configure role-based security by using the element in Machine.config or <strong>Web</strong>.config. This element configures the ASP.NETUrlAuthorizationModule, which uses the principal object attached to the current<strong>Web</strong> request in order to make authorization decisions.The authorization element contains child <strong>and</strong> elements, which areused to determine which users or groups are allowed or denied access to specificdirectories or pages. Unless the element is contained within a element, the element in <strong>Web</strong>.config controls access to thedirectory in which the <strong>Web</strong>.config file resides. This is normally the <strong>Web</strong> application’svirtual root directory.The following example from <strong>Web</strong>.config uses Windows authentication <strong>and</strong> allowsBob <strong>and</strong> Mary access but denies everyone else:The following syntax <strong>and</strong> semantics apply to the configuration of the element:●●●●“*” refers to all identities.“?” refers to unauthenticated identities (that is, the anonymous identity).You do not need to impersonate for URL authorization to work.Users <strong>and</strong> roles for URL authorization are determined by your authenticationsettings:● When you have , you are authorizingaccess to Windows user <strong>and</strong> group accounts.User names take the form “DomainName\WindowsUserName”.Role names take the form “DomainName\WindowsGroupName”.Note The local administrators group is referred to as “BUILTIN\Administrators”. The localusers group is referred to as “BUILTIN\Users”.●When you have , you are authorizingagainst the user <strong>and</strong> roles for the IPrincipal object that was stored in thecurrent HTTP context. For example, if you used Forms to authenticate usersagainst a database, you will be authorizing against the roles retrieved fromthe database.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!