How is authentication handled in CouchDB? Say I create Admin users and Readers, and assign them roles. Say also that I assign them to an individual database. On the file system level, is there a way for someone who is not authenticating, to look at the data that is stored in the database? Is the data stored as plain text in a file? How is this handled in CouchDB?

1 Answer
1

Through the database interface, roles are just as strong as they are in any other database. As long as they can't get hold of the files, it's absolutely as secure as your permissions and passwords. However, if they do, there's absolutely no compression or encryption built into CouchDB. Encrypt the data in your code (or your abstraction layer if you use one) if file system access control is a concern - of course anyone who gets hold of your DB filesystem could probably find your code's decryption keys, as well.

It's not a plain text file, it's a binary file that combines the data and indices, but you could copy it to a local CouchDB install and view it that way, or just open it in a good text editor. The data chunks are stored in plain text (JSON, actually) and isn't hard to read, though binary attachments remain binary.

I was debating using it for Android, but it doesn't seem like there is a way to lock it down enough. If I encrypt the data before I put it into the database, how would the map/reduce work? I would need the decryption function inside of the map function.
–
electricheadDec 15 '10 at 12:31

1

Sorry, missed your comment. Map/Reduce is still possible, but with two caveats: You must always use the same key/salt/IV for every value, so that identical values encrypt identically, and you obviously completely lose partial/similar matching. SQLite can be built with total transparent encryption on Android, which allows all functions to work normally, but doing the same with CouchDB would be a huge task. Good luck, however you go.
–
SilverbackNetDec 18 '10 at 5:36