Re: Encryption of application configuration block



Hi Steven,

If your trying to protect an Sql login password then instead create an Sql
login with only those permissions that are required by your application.
This way your users can see the password but can't do anything to the
database that they can't already do from your application.

Another, more secure option is to use Windows authentication and configure
access to Sql Server objects based on the current users' Windows account.
Set the connection string property "Trusted_Connection=Yes" and configure
access to Sql Server objects on a per-user basis.

If your really must encrypt your connection strings here are some links,
however note that configuration encryption is intended for applications that
reside on a server and not applications that are frequently deployed to
client machines:

Securing Connection Strings
http://msdn2.microsoft.com/en-us/library/89211k9b.aspx

Protected Configuration
http://msdn2.microsoft.com/en-us/library/53tyfkaw.aspx

- Dave Sexton

"Steven Cliff" <stevecliff@xxxxxxxxxxxxxxxxx> wrote in message
news:15AF19BB-47FC-43EB-A0A5-4248FBD1D401@xxxxxxxxxxxxxxxx
I have started to use the new Enterprise Library (Jan 06) and have set up a
skeleton project using the DAAB. This all seems to work fine apart from
when
I come to secure the app.config file via encryption.

I have encrypted the connectionsettings block in the config file but
obviously when I come to deploy the solution to other PC's, it cannot read
the block as it doesn't have the keys to decrypt.

I understand that as far as ASP.NET goes this is ok as the data layer is
most likely going to be on the web server, but for my winforms solution I
somehow have to let the user read this encrypted block?

I have even gone as far as to store all the connection information
elsewhere
in the app.config file using other encryption routines, then letting the
application read these on startup and dynamically add a new connection
string
in to the DAAB. Unfortunately this doesn't work either as the app.config
appears to be cached when the application starts and you cannot get
framework
2.0 to "refresh" the app.config without exiting the application and
restarting.
I even had a go at this too! (Starting to pull my hair out now!) but of
course that gives a problem for developers in that unless we have
different
app.config's for development and deployment (never a good move as it's
bound
to get screwed up somewhere!) then the application simply re-copies the
main
app.config everytime it starts up in debug mode so you get stuck in a
viscious circle!

I really think i must be missing something somewhere as at the moment it
appears that if you need to make the app.config secure when deployed, you
cannot use the new Enterprise Libraary DAAB at all!

(I've also tried to use RSA encryption as well - but could not find out
how
to export the RSA keys from a Winforms application as opposed to an
ASP.NET
web site).

And help or advice would be much appreciated to help save my sanity!
--
Thanks!


.



Relevant Pages

  • Re: SQL Connection string passwords
    ... of the Password-parameter itself turns on encryption for the connection. ... since SQL Server 2005 and onwards SQL Server has more power protection ... Use this connection string to enable encryption on the database. ...
    (microsoft.public.sqlserver.security)
  • Re: Concurrent database access in SQL 2005 Mobile
    ... Please stick to having an "dummy" connection in Open State. ... SQL CE/Mobile has a background thread that flushes the changes ... they run for long hours and we have not seen memory leaks so far. ... then opens his work forms and it's in ...
    (microsoft.public.sqlserver.ce)
  • Re: Concurrent database access in SQL 2005 Mobile
    ... Please stick to having an "dummy" connection in Open State. ... So it is a kind of asynchronous commit which happens every 10 ... I am not sure of this claim as we have many applications built on SQL CE ... then opens his work forms and it's in ...
    (microsoft.public.sqlserver.ce)
  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)
  • Access 2003 adp/proxy security - A substitute for SYSTEM_USER()
    ... We need a way for SQL to know the nt username that initiated the proxy ... Many stored procedures and views use a UDF that also depends on ... SyUserLogin and use HostIDand HostName() to find the right row. ... We've played with the Connection dialog settings, ...
    (microsoft.public.sqlserver.connect)