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.

Chapter 19: Securing Your ASP.NET <strong>Application</strong> <strong>and</strong> <strong>Web</strong> Services 567 To limit the application’s login in the state database1. Create a duplicate local account on the state database server with the same name<strong>and</strong> strong password of the account that runs your ASP.NET application.For more information about using the ASPNET account to access a remotedatabase, see “Data Access” later in this chapter.2. Create a local Windows group, for example ASPNET<strong>Web</strong>Apps, on the databaseserver <strong>and</strong> add the local ASPNET account to the group.3. Grant the Windows group access to SQL Server by creating a new login.sp_grantlogin 'MACHINE\ASPNET<strong>Web</strong>Apps'Note Replace MACHINE with your database server name.4. Grant the SQL login access to the ASPState database. The following T-SQL createsa database user called <strong>Web</strong>AppUser, with which the login is associated.USE ASPStateGOsp_grantdbaccess 'MACHINE\ASPNET<strong>Web</strong>Apps', '<strong>Web</strong>AppUser'5. Create a user-defined database role.USE ASPStateGOsp_addrole '<strong>Web</strong>AppUserRole'6. Add the database user to the new database role.USE ASPStateGOsp_addrolemember '<strong>Web</strong>AppUserRole', '<strong>Web</strong>AppUser'7. Configure permissions in the database for the database role. Grant executepermissions for the stored procedures that are provided with the ASPStatedatabase.grant execute on CreateTempTables to <strong>Web</strong>AppUserRoleRepeat this comm<strong>and</strong> for all of the stored procedures that are provided with theASPState database. Use SQL Server Enterprise Manager to see the full list.

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

Saved successfully!

Ooh no, something went wrong!