Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should application users be database users?

My previous job involved maintenance and programming for a very large database with massive amounts of data. Users viewed this data primarily through an intranet web interface. Instead of having a table of user accounts, each user account was a real first-class account in the RDBMS, which permitted them to connect with their own query tools, etc., as well as permitting us to control access through the RDBMS itself instead of using our own application logic.

Is this a good setup, assuming you're not on the public intranet and dealing with potentially millions of (potentially malicious) users or something? Or is it always better to define your own means of handling user accounts, your own permissions, your own application security logic, and only hand out RDBMS accounts to power users with special needs?

like image 571
skiphoppy Avatar asked Dec 04 '08 16:12

skiphoppy


People also ask

Does application need database?

Do you always need a database for your app? Of course not. As with everything in technology, nothing is ideal in every situation. Computers offer many various ways to store data.

Should each user have their own database?

Most individual users will never connect to the database directly, so defining an explicit login for them is not necessary. The only time you should consider letting the database manage your security is if you have users that will connect directly to your database.

What is application users in DBMS?

They are end users of the database who works through a menu driven application programs, where the type and range of response is always indicated to the user. Online users − Online users may communicate with databases directly through an online terminal or indirectly through user interface and application programs.

What are application users?

The application user is a built-in user account that is used to perform integration and system back-end service to support a particular feature. Since these are built-in user accounts, they can't be updated. The security role that is assigned to these accounts cannot be updated either.


1 Answers

I don't agree that using the database for user access control is as dangerous others are making it out to be. I come from the Oracle Forms Development realm, where this type of user access control is the norm. Just like any design decision, it has it's advantages and disadvantages.

One of the advantages is that I could control select/insert/update/delete privileges for EACH table from a single setting in the database. On one system we had 4 different applications (managed by different teams and in different languages) hitting the same database tables. We were able to declare that only users with the Manager role were able to insert/update/delete data in a specific table. If we didn't manage it through the database, then each application team would have to correctly implement (duplicate) that logic throughout their application. If one application got it wrong, then the other apps would suffer. Plus you would have duplicate code to manage if you ever wanted to change the permissions on a single resource.

Another advantage is that we did not need to worry about storing user passwords in a database table (and all the restrictions that come with it).

I don't agree that "Database user accounts are inherently more dangerous than anything in an account defined by your application". The privileges required to change database-specific privileges are normally MUCH tougher than the privileges required to update/delete a single row in a "PERSONS" table.

And "scaling" was not a problem because we assigned privileges to Oracle roles and then assigned roles to users. With a single Oracle statement we could change the privilege for millions of users (not that we had that many users).

Application authorization is not a trivial problem. Many custom solutions have holes that hackers can easily exploit. The big names like Oracle have put a lot of thought and code into providing a robust application authorization system. I agree that using Oracle security doesn't work for every application. But I wouldn't be so quick to dismiss it in favor of a custom solution.

like image 80
Shane Avatar answered Sep 21 '22 21:09

Shane