The Problem
Good Morning! I work on an application team that supports a few applications which utilize SQL Server
for data storage. Recently, our Database Support team decided that SQL Authentication
was no longer permissible (for security and logging reasons) and so my team was forced to convert all connections to Windows Authentication
including several dedicated Service IDs that our applications had been utilizing for data retrieval.
First, let me say there most certainly are advantages to moving to Windows Authentication
, I am not trying to dispute that. But this change has raised a huge problem for us... by switching our Service IDs to Windows Authentication
we have now opened up our back-end databases to every internal business user with front-end application access.
MS Access
is pushed out to every user desktop and a few superusers even have access to SSMS
. At this point we are relying entirely on user ignorance to prevent internal users from accessing the back-end database directly. And given that certain roles have elevated DML
rights, this presents a possibility for some nasty data consequences.
This new enterprise standard has left my team stuck between a rock and a hard place at this point so we looking for any database, account or architecture solution that would allow us to restrict user access to front-end only.
Questions
- Has anyone else run into this problem? Is there an architectural solution we are missing that would allow us to eliminate
SQL Authentication
without exposing our databases? - Does anyone know of a way to restrict access to a
SQL Server
database to only certain connection methods? I'm wondering if there is a way to designate a specific ID (or role) as only allowing a connection through a front end (and eliminateODBC
connections entirely). - Does anyone have any clever workarounds?
-------------EDIT---------------
A couple people brought up a good point about role access so I wanted to clarify our former and current solution... Previously, all role access was managed on the front-end and data retrieval was handled entirely by private system SQL Authenticated IDs to which end users had no visibility.
When we were forced to eliminate these SQL Auth IDs, we created a similar role-based setup on the back-end database as existed on the front end. Active Directory Groups were created to house different groups of users and these groups were assigned specific role privileges in the database. So currently access is limited by role as much as feasible.
The problem is that even the lowest privileged roles have INSERT, UPDATE and DELETE access to some tables (access which is normally controlled through code). So while we were able to mitigate risk somewhat by utilizing database roles, we still have areas where a user can bypass front end protections by logging directly into the database.
EDIT: Question clarification makes this answer obsolete, but leaving it for reference since some comments discuss it.
Assuming you mean that you have to (based on your architecture) allow access to the DB to each windows user account, one options is to use database roles.
You disable public access to your database, then define a set of database roles, depending on your use cases. Each role is granted permissions such that members of that role are able to manipulate the data they need and or work with the objects they need. Users are then mapped into the roles they require. When connecting to your database, the user will be granted permissions according to the roles they are members of.
For example, we have a role in one of our databases named
MyAppUser
(our name is actually related to the app which uses the db), which is designed for end users to read and insert data only. These can be created simply as follows:The role is granted just the permissions it to the relevant schemas or tables (assume all our "public" tables are in dbo schema for now).
Each user who should have this public read-write access is then mapped into the relevant role.
This separates users and roles / permissions within your database and allows you to have a single point of entry to control who has access to what in your databases.
By having the "View Definition" permission denied by default (to end users), they won't be able to "explore" the database / view table definitions etc using access, or even SSMS.
NB: SSMS provides wizards for managing and viewing permissions and memberships which are very handy for getting things initially setup / tested / fiddled around with.