views:

323

answers:

2

CouchDB access as a rest service seems insecure. Anyone can hit the database and delete/add documents once it is exposed. What is the best strategy to secure the CouchDB?

+1  A: 

Have you read CouchDB documentation http://couchdb.apache.org/docs/overview.html? It has a "Security and Validation" section that addresses some of your concerns.

Jay Zeng
Yes, I read the paragraph. Talks about Reader Lists, and says that there is a security model, I'm looking for specifics such as a how-to, examples, api to add to the reader list, etc
steveolyo
Got you, sounds like you have already done some research. Not sure if this would help: http://books.couchdb.org/relax/reference/security , give it a look if you haven't.
Jay Zeng
That has some good information, still needs work. I realize that couchdb is still in its infancy. Maybe the read lists are not implemented yet.
steveolyo
Ok, first it looks like there is a reader list which will provide document security to couchdb, then I find a JIRA entry stating: The "Reader Access" section on the overview page describes a feature that couchdb doesnot currently supply and is unlikely to supply in the stated form in the near future (or possiblyever (https://issues.apache.org/jira/browse/COUCHDB-496)
steveolyo
Like you said, CouchDB is "still in its infancy".
Jay Zeng
And as an infant it embodies a lot of great promise. Thanks for the comments.
steveolyo
A: 

The only thing which really works currently security wise is something like this in your CouchDB configuration.

[couch_httpd_auth]
require_valid_user=true
[admins]
admin = sekrit

This puts basic HTTP auth on all of CouchDB. Even this is not well supportet in client libraries. For python e.g. you need a patched library.

The second approach is to put a proxy in front of CouchDB and let the proxy do the authentication and authorization work. Due to CouchDB's RESTful design this is quite easy.

All other approaches must be considered up to now highly experimental.

mdorseif
Putting a proxy in front of Couch is a great idea, but adds some overhead. I have apache as a proxy currently. I think I'll rephrase the question as a new one here on stackoverflow
steveolyo