HighTechTalks DotNet Forums  

Encrypt connection string - Access denied

ASP.net Security microsoft.public.dotnet.framework.aspnet.security


Discuss Encrypt connection string - Access denied in the ASP.net Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Greg G
 
Posts: n/a

Default Encrypt connection string - Access denied - 11-26-2007 , 09:17 PM






Using the tutorial:

Protecting Connection Strings and Other Configuration Information

http://www.asp.net/learn/data-access...ial-73-cs.aspx

The sample code works fine, but it does not work in my web application on my
local machine or on a test server.

When I try to encrypt my sql connection string, I get an error message:
Access to the path 'c:\inetpub\wwwroot\....\cjhspoo2.tmp' is denied.

web.config line 0

I assume it is here:
Configuration config =
System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(Request.ApplicationPath);

I have tried changing settings in IIS 6.0 with no luck. The sample program
code works but not with my website.

Is there some other permission that needs to be set?

Will this ever work on a shared server or is there a better approach?
--
Thank you very much,

Greg G

Reply With Quote
  #2  
Old   
Dominick Baier
 
Posts: n/a

Default Re: Encrypt connection string - Access denied - 11-27-2007 , 02:26 AM






the worker process would need write access to the webroot - nothing you want
to do!

better write a console app or use aspnet_regiis.exe (under an admin account)
to encrypt sections at deployment time.


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

Quote:
Using the tutorial:

Protecting Connection Strings and Other Configuration Information

http://www.asp.net/learn/data-access...ial-73-cs.aspx

The sample code works fine, but it does not work in my web application
on my local machine or on a test server.

When I try to encrypt my sql connection string, I get an error
message: Access to the path 'c:\inetpub\wwwroot\....\cjhspoo2.tmp' is
denied.

web.config line 0

I assume it is here: Configuration config =
System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(
Request.ApplicationPath);

I have tried changing settings in IIS 6.0 with no luck. The sample
program code works but not with my website.

Is there some other permission that needs to be set?

Will this ever work on a shared server or is there a better approach?

Greg G




Reply With Quote
  #3  
Old   
Mad_Gerbil
 
Posts: n/a

Default Re: Encrypt connection string - Access denied - 12-11-2007 , 08:43 AM



"Dominick Baier" wrote:
Quote:
the worker process would need write access to the webroot - nothing you want
to do!

better write a console app or use aspnet_regiis.exe (under an admin account)
to encrypt sections at deployment time.


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)


Uh... I'm having the same problem.
I got the idea to do this from page 113-114 of your book.

I'm working in an environment where I don't have access to the web server so
I cannot run any command line utilities or install utilities. All I can do
is publish my application there - given that I thought the solution in your
book would allow me to publish it and place code in the Application_Start
that would automatically encrypt my connection strings the first time the
application ran.

While the code works in local mode I cannot get it working once published to
the web server. I get the same errors the fellow who started this thread is
getting.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.