Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Secure CouchDB

CouchDB access as a rest service seems insecure. Anyone can hit the database and delete/add documents once it is exposed.

What strategies are there to secure the CouchDB?

like image 908
steveolyo Avatar asked Dec 17 '09 17:12

steveolyo


People also ask

Is CouchDB scalable?

Scalability. The architectural design of CouchDB makes it extremely adaptable when partitioning databases and scaling data onto multiple nodes. CouchDB supports both horizontal partitioning and replication to create an easily managed solution for balancing both read and write loads during a database deployment.

Where is CouchDB data stored?

Configuration Backups. CouchDB's configuration system stores data in . ini files under the configuration directory (by default, etc/ ). If changes are made to the configuration at runtime, the very last file in the configuration chain will be updated with the changes.


1 Answers

A lot has changed since 2009, so I'm going to throw an answer in here. This answer is drawn from this page on the wiki.

CouchDB has a _users database that serves the purpose of defining users. Here's the gist straight from the wiki:

  • An anonymous user can only create a new document.
  • An authenticated user can only update their own document.
  • A server or database admin can access and update all documents.
  • Only server or database admins can create design documents and access views and _all_docs and _changes.

Then, for any given database you can define permissions by name or by role. The way authentication is implemented is through a _session Database. Sending a valid username and password to the _session DB returns an authentication cookie. This is one of several option for CouchDB Authentication. There're a few more options:

  • This option is a little old 1.0 was a few months back, we're on 1.2 as of today. But it's still very well outlined.
  • And this one from "The Definitive Guide"

Also, depending on which hosting service you might be using, you'll have the option to restrict access to couch over SSL.

Between Node, Couch, and a variety of other technologies that effectively scale horizontally (adding more servers) there's an interesting kind of pressure or incentive being put on developers to make applications that scale well in that manner. But that's a separate issue all together.

like image 54
Costa Michailidis Avatar answered Sep 20 '22 18:09

Costa Michailidis