SQL Security Problems (Recommendations Requested)

Status
Not open for further replies.
I’ve got a SQL Server problem and I’m hoping someone can help me figure out how best to secure it.

I’ve got a SQL Server (2005 Enterprise) that is the backend for a Manufacturing system. The manufacturing system connects to the database via ODBC (runs on Windows 2003 Enterprise R2 w/SP2). Client machines connect to that manufacturing system via a manufacturing client, but have their own ODBC connection to the database for reports.

We have written a lot of reports in Microsoft Access 2003 which connect to the database via an ODBC connection (set up as a System DSN). In Access, we’re using linked tables to do the reports.

Here is the problem. Right now, anyone can use Microsoft Access, Visual Studio, or some other database aware program to use the ODBC link to attach to the database and read/write to it. We’d like to prevent using that ODBC (System DSN) connection unless it’s that specific Access application for reporting.

I’m searching for ideas on how to secure the database to prevent unauthorized applications (or users) from using that DSN to connect to the database.

My best guess was to enable SQL security and create a login for Access. Then I thought I could use VBA to temporarily create a DSN on startup and destroy it upon shutting Access down. The problem is, I’m not exactly sure that’d work all that well if Access were not shutdown properly (would the DSN remain?). Is there a better way?

I’d sure appreciate any insight someone could provide.

Thanks!
 

sadrat

Smack-Fu Master, in training
57
Try this:
Set up each user with access to the SQL Server. Set permissions for any apps they have access to. You can specify read/write/etc permissions to table/stored procw/views.etc.

In your ODBC connection, you can specify that a user must supply an SQL username and password. That should help you lock down the sql db.

IF a user without SQL access creates their own ODBC connection (Which they shouldn't be able to do in the first place. Users should NOT be Admins in a domain) not having SL access should prevent them from accessing your db.

Can you also delete the ODBC icon from the control panel and rename odbcad32.exe to something else.

In Access, you can create security groups that limit what a user can/can not get to.
 

scorp508

Ars Legatus Legionis
10,214
Originally posted by 88merlin88:
Yes, I could do that, but how would that prevent users from creating their own ODBC DSN? I need a specific Access application to connect, but prevent users from creating their own.

I'm not a SQL DBA, but I did stay at a Holiday Inn last night. I dunno, does it matter if they can if you've locked them out of the DB?
 
Originally posted by scorp508:
Are the users using the ODBC connection members of active directory? Could you add them to a security group with a relative name "ODBC Users for xx app", then add that group to have access to the DB in question within SQL using Windows Auth?

This is how it's done where I work.
Note: I'm not a SQL administrator, I'm in Network Systems.

Our staff swap computers / borrow laptops / etc from eachother, so we faced a similar (sounding) problem.

The nutshell version goes that every PC could potentially have the ODBC on it, so the SQL guys created security groups in AD (one per ODBC application), applied the users to the groups, and then allowed those groups access to SQL.

We setup ODBC to use your Windows credentials, so it doesn't matter if employees have the ODBC connection on their PC - what matters is whether they're in the right security groups.

If SQL doesn't let them in, they don't get anywhere.
 

jjj

Ars Scholae Palatinae
680
If there's a way to do so I've never run across it (I'm certainly no expert so I'm hoping someone posts otherwise!).

If you have the option, make the reports accessible from a web server (or publish the application with something like Presentation Server). That way the users don't have the ODBC on their machine, it resides on a server that connects to the database and they access only the application or reports.
 

gruntledgoat

Ars Scholae Palatinae
1,401
The security must be handled on the SQL server. If these users should not have write/delete permissions on this data, then don't give it to them. Access will work fine to generate reports from a table with read-only (SELECT only in SQL Server terms) permission. Even only using the "approved" Access application, they can simply open up the table and write or delete whatever they want, what you are proposing simply won't work.
 
It’s somewhat of a sticky situation guys. Management has declared that they don’t want users to have access to a SQL database without the “approved” applications (which have their own internal security). So I’ve been tasked with figuring out a way to only allow read access through those applications.

Since our manufacturing system software has its own security model and doesn’t require ODBC for the users, I’m fine there. MS Access is the sticking point. I’ve cooked up a scheme that I think will work.

I’ve read MS Article 892490 that states, “How to create a DSN-less connection to SQL Server for linked tables in Access.” Essentially, this would allow me to create a linked table using credentials embedded in code. Obviously those credentials will be independent of the user and unknown to them.

On startup of the application, I could create a function that deletes all the linked tables to ensure that if the application was not closed properly last time that tables that were previously linked were closed. Then, as users open and close forms that utilize those tables, Access would create and destroy those linked tables. I recognize that this will increase the amount of time required to open/close forms, but it seems to be the only means I have to obscure the tables.

We already publish the Access file as an MDE, so the code is not apparent to the users thereby preventing accidental discovery of the credentials by entering design view and looking at the code. Since users themselves (their login) would not have access to the SQL database directly, ODBC connections could not be created.

I recognize that sniffers and more advanced methods of discovery could be potentially employed to discover the credentials and violate the security; I think this is more like locking your car doors. It prevents accidents and opportunity violations from occurring.

What do you guys think of this strategy?
 

gruntledgoat

Ars Scholae Palatinae
1,401
Originally posted by socoj2:
Security nazi: You should not be letting people connection to a sql server to begin with. If they need to pull data it should be done via a Server and exported to the user. Only other servers should have access to a DB server.

I would love to come and visit your planet sometime! -- ;) --

I have to agree with scorp508 here, management's request is pretty far removed from reality, and I would love to know what kind of justification they have for their position. It's like putting your house key in a safe on the porch, and then leaving the door unlocked because opening the safe is too inconvenient.
 

socoj2

Ars Praefectus
4,967
Subscriptor
Originally posted by gruntledgoat:
Originally posted by socoj2:
Security nazi: You should not be letting people connection to a sql server to begin with. If they need to pull data it should be done via a Server and exported to the user. Only other servers should have access to a DB server.

I would love to come and visit your planet sometime! -- ;) --

I have to agree with scorp508 here, management's request is pretty far removed from reality, and I would love to know what kind of justification they have for their position. It's like putting your house key in a safe on the porch, and then leaving the door unlocked because opening the safe is too inconvenient.


Management Tends to knee jerk... You guys need to start learning how to use that to your advantage...

I mean it only takes one user to go

Delete * from

instead of

Select * from

In reality today, you see people "going postal" and shooting up other employees, what you havent seen much of YET. Is people "Going IT" and formatting a Million dollars worth of data.
 

scorp508

Ars Legatus Legionis
10,214
Originally posted by socoj2:
I mean it only takes one user to go

Delete * from

instead of

Select * from

This literally happened here last week thanks to someone with access to SQL who didn't fully understand how to write a SQL script. 70GB of DB gone in an instant and had to then be restored from tape.

Even though the business owner demanded this user have full access previously, they're reconsidering their decision now.
 
Status
Not open for further replies.