PC Review


Reply
Thread Tools Rate Thread

Connection String Security

 
 
Steve - DND
Guest
Posts: n/a
 
      4th Aug 2003
I'm curious about connection string security within a network. We have a
setup with many webservers going out to a clustered DB server. Is all the
effort I put forth to secure my connection strings(whether it be DPAPI,
encrypted and stored in the registry, etc...) in vain, since at some point I
have to leave the current box, and traverse the network to talk to SQL
Server? Couldn't anyone with packet sniffing, or network monitoring tools
compromise the connection string information at that point? Is there a way
to communicate securely with a remote DB server?

Thanks,
Steve


 
Reply With Quote
 
 
 
 
Carl Prothman [MVP]
Guest
Posts: n/a
 
      4th Aug 2003
"Steve - DND" <(E-Mail Removed)> wrote
> I'm curious about connection string security within a network. We have a
> setup with many webservers going out to a clustered DB server. Is all the
> effort I put forth to secure my connection strings(whether it be DPAPI,
> encrypted and stored in the registry, etc...) in vain, since at some point I
> have to leave the current box, and traverse the network to talk to SQL
> Server? Couldn't anyone with packet sniffing, or network monitoring tools
> compromise the connection string information at that point? Is there a way
> to communicate securely with a remote DB server?
>


Steve,
Back when I was using the SQL Server OLE DB provider, I was able
to create a secure connection from the Web Server to SQL Server machine
by adding a certificate to the SQL Server machine, then adding "Encrypt=yes"
to the connection string.
http://www.able-consulting.com/MDAC/...erForSQLServer
- see the Note section

Plus check out the following KB article:
http://msdn.microsoft.com/library/de...ar_cs_6fu6.asp

Note, I've not tried this using the SQL Server .NET Data Provider yet...

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com




 
Reply With Quote
 
Frans Bouma
Guest
Posts: n/a
 
      5th Aug 2003
"Steve - DND" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> I'm curious about connection string security within a network. We have a
> setup with many webservers going out to a clustered DB server. Is all
> the effort I put forth to secure my connection strings(whether it be
> DPAPI, encrypted and stored in the registry, etc...) in vain, since at
> some point I have to leave the current box, and traverse the network to
> talk to SQL Server? Couldn't anyone with packet sniffing, or network
> monitoring tools compromise the connection string information at that
> point? Is there a way to communicate securely with a remote DB server?


You could add an SSL certificate but it will slow down performance.
The flaw in the security design is there for a long time and will not be
fixed either I'm afraid. What you can do, if you administrate both the
webservers and the sqlserver, is this: (I assume you've followed best
practises and aren't running the machines in a domain)

- Add a new user to all the webservers, f.e. ASPNETRunner. Give it a
strong password.
- Add a new user to the machines where SQLServer runs on, and also call it
ASPNETRunner. Give it the same stong password
- Add the ASPNETRunner user as the user which is requesting/modifying data
in the database from the webservers, thus add it to sqlserver and to the
roles that allow modifying data in the catalogs used for the website.
- Use ASPNETRunner as the user which runs ASPNET and the webapplication
(site in IIS)

now you can use integrated security in your connection string, which means
you don't have to use sqlserver security, and therefore don't have to
specify a username/password in your connection string.

BUt because you have a lot of webservers, and a dbcluster, I think it is a
bit of a maintainance nightmare to add the user to all the machines.

The problem is that Microsoft has nice security guidelines but the people
designing the security models aren't reading them. I mean: you can't set
up a decent 2 box setup (db box + webserver) without a domain and WITH
integrated security unless you use the same windows user twice on each box
with the same password (and you have to remember to keep them in sync when
the password changes/has to be changed). ASPNET user, which is used to run
ASP.NET websites, is local to the webserver and unknown to the sqlserver
machine, which leaves you to use sqlserver security, something that is
'highly discouraged' by MS' security documents. Go figure.

FB

--
Solutions Design : http://www.sd.nl
My open source .NET Software : http://www.sd.nl/software
My .NET Blog : http://weblogs.asp.net/FBouma
-------------------------------------------------------------------------
 
Reply With Quote
 
Steve - DND
Guest
Posts: n/a
 
      5th Aug 2003
> Steve,
> Back when I was using the SQL Server OLE DB provider, I was able
> to create a secure connection from the Web Server to SQL Server machine
> by adding a certificate to the SQL Server machine, then adding

"Encrypt=yes"
> to the connection string.
>

http://www.able-consulting.com/MDAC/...erForSQLServer
> - see the Note section
>
> Plus check out the following KB article:
>

http://msdn.microsoft.com/library/de...ar_cs_6fu6.asp
>
> Note, I've not tried this using the SQL Server .NET Data Provider yet...


Carl,
Thanks for that bit of information. I'm curious if it really protects
the connection string information though. Obviously it's going to secure any
data transferred once the connection is open, but I have a feeling that the
actual connection will be made unencrypted. My reasoning for this is if you
look at the Connect Timeout key of the connection string. You cannot set
this value through code anywhere, it must be specified in the connection
string, it is part of the initial setup of the connection. From this I am
surmising that even if using the Encrypt key, that the connection would be
made normally and all further data encrypted. Any thoughts on this?

Steve


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypted Connection String and Security....Quick Question Ranginald Microsoft ASP .NET 2 6th Feb 2007 12:19 AM
Connection String in .config file - Security Concerns =?Utf-8?B?V2ViTWF0cml4?= Microsoft ASP .NET 14 27th Jan 2006 04:14 PM
Connection String in .config file - Security Concerns =?Utf-8?B?V2ViTWF0cml4?= Microsoft C# .NET 14 27th Jan 2006 04:14 PM
connection string in app.config security problem =?Utf-8?B?Sm9l?= Microsoft Dot NET Framework Forms 1 29th Sep 2005 08:55 AM
Persist Security Info = True in connection string Greg Robinson Microsoft ADO .NET 4 6th Jul 2005 08:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 AM.