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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

566 Part IV: Securing Your Network, Host, <strong>and</strong> <strong>Application</strong>For more information about setting up the SQL Server session state store database,see Microsoft Knowledge Base article 311209, “How To: Configure ASP.NET forPersistent SQL Server Session State Management.”Use Windows Authentication to the DatabaseIf you use mode=“SQLServer”, use Windows authentication to connect to the statedatabase <strong>and</strong> use a least privileged account, such as a duplicate local ASPNETaccount. This means that you can use a trusted connection, you do not havecredentials in the connection string, <strong>and</strong> credentials are not passed over the wire tothe database.Encrypt the sqlConnectionStringEncrypt the sqlConnectionString attribute value using the Aspnet_setreg.exe tool.This is particularly important if you use SQL authentication to connect to the statedatabase because of the credentials in the connection string, but it is alsorecommended if you use Windows authentication. To encrypt the sqlConnectionString1. Run the following comm<strong>and</strong> from the comm<strong>and</strong> prompt.aspnet_setreg -k:Software\YourApp\sessionState -c:{your connection string}This stores the encrypted connection string in the specified registry key <strong>and</strong>secures the registry key with a restricted ACL that grants Full Control to System,Administrators, <strong>and</strong> Creator Owner.2. Reconfigure the element <strong>and</strong> add the followingsqlConnectionString attribute.3. Use Regedt32.exe to create an ACL on the above registry key that grants readaccess to the ASP.NET process account.Limit the <strong>Application</strong>’s Login in the DatabaseThe application’s login in the database should be restricted so that it can only be usedto access the necessary state tables <strong>and</strong> the stored procedures used by ASP.NET toquery the database.

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

Saved successfully!

Ooh no, something went wrong!