views:

229

answers:

4

There are some rumors floating around that the team at my company will soon be using web services for all future application development. The architecture is supposed to be something like this:

Application --> Web Service --> Database

The stated reasoning behind it is security. This sounds like a huge waste of time for little if any benefit. My question is, in what ways does a web service make your data more secure than a database? I would think that if an attacker wanted to get all your data and had already gotten onto the app server, it would be fairly trivial to figure out how the application is getting it's data.

Please keep in mind that these web services would be purely for data, and would have little if any business/validation logic, and would also be outside the application developers control (at least that's the way it's worked with all previous applications that have used web services).

A: 

If you use a webservice hopefully you will also be using some kind of queue when sending the data to the database. If you are using a webservice and queue combo then the security come into place with less chance of lost data. If you do not have a webservice and queue combo if you send data to the database and it never gets there you have no were for it to go it just disappears.

You are correct though if someone wants to break into your system a webservice isnt going to help if anything it might make it worse if you make the webservice public and they find the name of your webservice because then they can just query your DB using the webservice and any security features on your servers will just think it is you applications getting the information.

Ironsides
google database transactions
in your post you said nothing of a transaction with the database. my post is correct if you are using a webservice with a queue. i do not see a reason for a downvote just because you do not like the answer.
Ironsides
there's a lot of that going around
Steven A. Lowe
I'm not the one that downvoted you.
+1 to counter a cowardly drive-by downvote. I don't think this answer is correct, but it is not "unhelpful" which is clearly the purpose of downvoting
Steven A. Lowe
+2  A: 

One important thing about Web Services is interoperability so that different applications from different platforms later can utilize the services and data. Your company will benefit a lot by doing so. And you are right about the security, it is definitely one of the good reasons to use web service rather than expose a public endpoint of the database, it is dangerous!

Web Services enable the accessibility of your data, For example, your data can be accessed within browser by javascript. There is no way to access the database on the server directly within Javascript.

All in all, go for it, that is the right approach.

codemeit
Care to elaborate on how it a web service is more secure?
if you expose the database with a raw stream and public IP:port, What do you think the hackers would do to it?
codemeit
No one said anything about exposing the database with a raw stream and a public IP:port. In fact the proposed architecture above shows that even the webservice would be completely cut off from the internet.
+2  A: 

If it's true that there will be no business logic or validation on the web services, then there is only a limited security benefit to adding the additional layer of abstraction. I say limited because the interface between your application and the database is still more limited than if they were directly talking to each other.

If you add validation and business logic to the equation, there is a significant security benefit, as anyone who has access to the application account can only do the database what the application is able to do. Additionally, this is a better design because it reduces coupling between your application and implementation details of how the data is stored in the database. If you wanted to change the database schema, you only need to update the web services, and not entire applications.

Tmdean
A: 

the security argument is questionable; authenticating to a web service is no different than authenticating to the database

there are legitimate reasons for moving db operations to web services and SOA in general, but security isn't one of them

Steven A. Lowe
Attention drive-by downvoter: this answer is (a) helpful and (b) correct; i'm sorry you don't like it. If you have a complaint about it, leave a comment and then maybe we will both learn something.
Steven A. Lowe
+1 to counter a cowardly drive-by downvote.
Ironsides