Return-Path: X-Original-To: apmail-couchdb-marketing-archive@minotaur.apache.org Delivered-To: apmail-couchdb-marketing-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A38241885E for ; Wed, 6 May 2015 09:52:28 +0000 (UTC) Received: (qmail 16828 invoked by uid 500); 6 May 2015 09:52:28 -0000 Delivered-To: apmail-couchdb-marketing-archive@couchdb.apache.org Received: (qmail 16789 invoked by uid 500); 6 May 2015 09:52:28 -0000 Mailing-List: contact marketing-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: marketing@couchdb.apache.org Delivered-To: mailing list marketing@couchdb.apache.org Received: (qmail 16778 invoked by uid 99); 6 May 2015 09:52:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2015 09:52:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2015 09:52:24 +0000 Received: from monoceres.uberspace.de (monoceres.uberspace.de [95.143.172.184]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 8AA80207AB for ; Wed, 6 May 2015 09:52:03 +0000 (UTC) Received: (qmail 20328 invoked from network); 6 May 2015 09:51:54 -0000 Received: from localhost (HELO ?10.0.0.15?) (127.0.0.1) by monoceres.uberspace.de with SMTP; 6 May 2015 09:51:54 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: SmileUpps Features (Was: How do CouchApps fit into the CouchDB story? (Was: CouchDB Articles, Pills and Tutorials Ideas)) From: Jan Lehnardt In-Reply-To: <5DF7EB60-B0DD-4CC6-8582-A0991A0AB5B5@b2w.com> Date: Wed, 6 May 2015 11:51:53 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <33BD4D82-787C-48D5-B963-FEEA4C0913CB@apache.org> <4209351E-F51E-4DB5-8A5F-8AB53DA21877@apache.org> <47CA7E1D-AC9D-42C3-9188-778265347F10@apache.org> <5D665CF6-8E41-477F-BBE1-6EC7CDC534AA@apache.org> <5F87782C-54D0-4999-ADFD-2C07C71C24E7@apache.org> <4E6DAC78-5234-4306-9F99-8AE3593E33C9@apache.org> <5DF7EB60-B0DD-4CC6-8582-A0991A0AB5B5@b2w.com> To: marketing@couchdb.apache.org X-Mailer: Apple Mail (2.2098) X-Virus-Checked: Checked by ClamAV on apache.org > On 06 May 2015, at 07:49, Johs Ensby wrote: >=20 > Jan and Giovanni, > I am afraid I am dumbing down the discussion here (Giovanni, sorry for = not studying your docs in detail yet), but isn=E2=80=99t this very = basic? > a vhost point all requests directly to the _rewrite that is used to = manage security > the _rewrite decides what to forward to the databases (with or without = preset parameters in the rewrite rule) When I send a request without a Host: header, then the vhost mechanism = doesn=E2=80=99t kick in and I can access the full CouchDB server. There = is no =E2=80=9Cdefault vhost=E2=80=9D setting in CouchDB. Cloudant uses a different vhost system that I=E2=80=99m not familiar = with. Best Jan -- >=20 > I have used Cloudant for hosting, so my experience is based on the = following setup procedure > define vhost, point this to a _rewrite of a selected ddoc > define access to each db based on where the traffic comes from, = differentiate access levels by using more than one vhost, e.g. = editor.mydomain.com and www.mydomain.com > use one _rewrite as your API, strap it down as much as you want or > use one _rewrite per access level (vhost) > open up for rewrite to ../../../etc if you need to reach multiple dbs = from same _rewrite > create views for commonly requested subsets of data > do the fine grade filtering in lists >=20 > As for access control in the list (row by row) we have a = req.userCtx.roles object with info coming from authenication via = LlinkedIn to filter out data. > There is a huge performance penalty for having to filter views in the = list, of course, but the combination of views and filtering in a list = serves a lot of purposes well as long as you think of your vhosts and = _rewrites as your CouchApp API. >=20 >=20 > Johs >=20 >> On 05 May 2015, at 19:08, Jan Lehnardt wrote: >>=20 >>> I still haven't heard of a single path for exploit, but ok... >>=20 >> I make a GET request to = http://:/database/_all_docs?include_docs=3Dtrue = authenticated as one of your users, with your couchapp in it. In CouchDB = parlance, I get all docs if I have access to the db. There is no way of = making CouchDB only return =E2=80=9Cmy=E2=80=9D documents and not = documents from other users. There is also no way of forcing me another = route. What happens on your system? >=20 --=20 Professional Support for Apache CouchDB: http://www.neighbourhood.ie/couchdb-support/