Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2007, 03:08 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web.config Security

Hello,

I have just finished building my tbh based website and have deployed it to the final hosting machine and have struck a problem.

The site works perfectly, but I am quite concerned about the security of the web.config file. I am able to encrypt the Connection Strings section, but have had to use an impersonate command to provide username and password access to the database on a separate machine. The mail settings section also holds information like this that I do not want to be readily available. I cannot encrypt these two sections.

Do you have any ideas as to how I can make absolutely sure my site is secure?

Many thanks.
 
Old August 7th, 2007, 12:28 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why do you want prevent web.config acess?

Normally, the person in your host company that have acess to your web.config file has acess too to your database! He don't need to know your password.

The password is only needed when someone try to acess with an external connection. But web.config file is unacessible to external connections.

But you can put your stringconnection inside a code-behind (dll file)
But there are ways to decrypt dll too!

(i think)

 
Old August 16th, 2007, 02:41 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi sorry about the delay in replying - have been away from the office.

We are hosting the site internally on one server with the database on a separate server - as this is the case we have created a user on the website server that can only access the database for the website - which is why we used the impersonate - please feel free to tell me if there is a better way to do this as I am not convinced we have it right.

This is also why we want to prevent web.config access as it has the website username and password in plain text in an identity section.

On speaking to a few people here they are not convinced that the web.config file is completely unaccessible to external connections.

My latest idea is to try to move all passwords and connection string info into appSettings which will encrypt it all in one go - any ideas as I am having difficulty getting this working.

Thanks in advance for any help with this
:)

 
Old August 20th, 2007, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is a big subject and not covered by this particular book. There is a lot of info on ASP.NET security on MSDN.

You could store any sensite data in an encrypted XML file if you want. But you need to make sure you only decrypt it once and save a reference to it to prevent a performance problem. You could save a reference in Cache or in a static field using a Singleton class.

Or you can save sensitve data in ACL protected registry keys. Only the web site user account would be allowed to read from those keys. You could also encrypt those keys if you are super paranoid.

If you're using Windows security on SQL Server and you are using impersonation then there is no need to store a DB username or password since DB login will be automatic. This can't be used on hosted sites, of course.

Eric






Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config dpkbahuguna ASP.NET 3.5 Basics 2 August 26th, 2008 09:41 AM
web.config vs. app.config darlo Visual Studio 2005 11 August 20th, 2008 07:23 AM
web.config sonny1 ASP.NET 2.0 Basics 1 October 20th, 2007 01:40 PM
Web Config SteveP55419 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 3rd, 2007 04:19 PM
Web.config security aldwinenriquez ASP.NET 1.0 and 1.1 Professional 0 July 3rd, 2005 09:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.