hiding a db connection string

A

anonymike

Hi,

I'm having a problem that I've been working with for the last week, I'm
not having any luck, I'm hoping someone can help me. Anything would be
appreciated.

I have a setup where we currently use a single sign on to our oracle db
for our client/server VB6 apps. We currently have a DLL that the VB6
apps call to get the production connection string. What this afforded
us was the ability to change the production db password for all
applications at once, without having to recompile and distribute all
the apps (the dll was shared on the network). Yes I realize a single
DB signon is bad, and that this setup only affords us security through
obfuscation, but for the short being, it was working.

As we move to .NET, I wanted to construct an environment where
applications (all c/s launched from a network share) could only connect
to the production server if the application was launched from the
production application server (fileserver). Seemingly a simple task,
but all the securities and whatnot in .NET are ensuring this is not
going to be an easy feat.

For example, some of the things I have tried.

I created a DLL in .NET, having the DLL reflect on the calling assembly
to get the calling assembly's base directory, then hand out the
connection string based on that. Of course, this works, but the DLL
either has to be in the base path or below it, or strongly named, and
when strongly named, the calling app has to be re-compiled against any
DLL changes, which kills my requirement of not having to recompile all
apps with a password change.

Then I created a remoted SAO Singleton, hosted on our IIS server.
Figuring I could either (a) somehow "reflect" on the caller to see
where it's being launched from, or (b) find a way for the caller to
specify to the remote object where it's calling from (short of actually
passing the path from the application to the remote object, which would
just be obscure, and I'm not keen on obscurity with .NET having a
decompiler distributed with it). I can't do it based on IP address,
because that doesn't give me the file server the application was
launched from, just the client that the application is running on.

I'm trying to find an object that the application may have with the
launch path in it as read only property, and maybe I can send that up
with the remote method call... but as I'm looking for these
off-the-wall solutions, I'm wondering if there just isn't a better way
to handle this situation.

Again, I would greatly appreciate any input that I can get on this
issue... any corrections to my assumptions or results would be
appreciated as well... This post is in this group because I can't
quite nail it to a design issue, .net issue, or c# issue, but I'm
working with .NET VS2005 and C#.

Thanks,
Mike
 
C

Cor Ligthert [MVP]

Anonymike,

Maybe it is better next time only to describe your problem.

I assume it is this
I wanted to construct an environment where
applications (all c/s launched from a network share) could only connect
to the production server if the application was launched from the
production application server (fileserver).

Why than not add the IP address or even better machinename from that server
in your procedure?

http://msdn2.microsoft.com/en-us/library/system.environment.machinename.aspx

\\\
string IPAdres = System.Net.Dns.Resolve _
(SystemInformation.ComputerName).AddressList(0).ToString();
///

I hope this helps,
Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top