All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Spray <john.spray@redhat.com>
To: Gregory Farnum <greg@gregs42.com>, Sage Weil <sweil@redhat.com>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	Nishtha Rai <nishtha3rai@gmail.com>,
	jashan kamboj <jashank42@gmail.com>
Subject: Re: MDS auth caps for cephfs
Date: Tue, 26 May 2015 13:56:53 +0100	[thread overview]
Message-ID: <55646D95.6070105@redhat.com> (raw)
In-Reply-To: <CAC6JEv9GRO5S4gT-Zy3R7X_9LHy7UK1KAx7r-riXzX6k3yNGQA@mail.gmail.com>



On 22/05/2015 23:02, Gregory Farnum wrote:
> On Fri, May 22, 2015 at 2:35 PM, Sage Weil <sweil@redhat.com> wrote:
>> On Fri, 22 May 2015, John Spray wrote:
>> Yes, I think we should.  Part of me wants to say that people who want NFS-like
>> behaviour should be using NFS gateways.  However, these are all probably
>> straightforward enough to implement that it's worth maintaining them in cephfs
>> too.
> Unfortunately not really — the NFS semantics are very different from
> the way our CephX security caps work. We grant accesses with each
> permission, rather than restricting them. We can accomplish similar
> things, but they'll need to be in opposite directions:
> allow anon_access
> allow uid 123, allow gid 123[,456,789,...]
> allow root
> where each additional grant gives the session more access. (And I'm
> not sure if these are best set up as specific things on their own or
> just squashed in so that UID -1 is "anon", etc) These let you set up
> access permissions like those of NFS, but it's a quite different model
> than the various mounting and config file options NFS gives you. I
> want to make sure we're clear about not trying to match those
> precisely because otherwise our security capabilities are not going to
> make any kind of sense. :(
> What would it mean for a user who doesn't have no_root_squash to have
> access to uid 0? Why should we allow random users to access any UID
> *except* for root? Does a client who has no_root_squash and anon uid
> 123 get to access stuff as root, or else as 123? Can they access as
> 124?
> I mean, I think it would have to mean they get access to everything as
> anybody, and I'm not sure which requests would be considered
> "anonymous" for the uid 123 bit to kick in. But I don't think that's
> what the administrator would *mean* for them to have.
This feels more like a syntax issue: as you say, these NFS-esque options 
don't make sense as part of a list of additive capabilities, they're 
more like a single structure with some fields.  The naming is 
potentially confusing too; we're really talking about a condition under 
which we squash a UID (never, when requester was root, or always), and 
then how we do the squashing (to which UID/GID).

A syntax that doesn't allow the nonsensical combinations of options 
might be something like:
squash: <none|all|root>
squash_to: <uid> <gid>
capabilities: [existing additive list style] [] []...

(or even a list of those structures, so that admin could define e.g. 
multiple path-limited capabilities, each with different squashing rules).

But maybe it is a good idea to avoid introducing this to users as "it's 
like NFS" to avoid confusion.

>
> As I think about this more I guess the point is that for multi tenancy
> we want each client to be able to do anything inside of their own
> particular directory namespace, since UIDs and GIDs may not be
> synchronized across tenants? I'm not sure how to address that, but
> either way I think it will require a wider/different set of primitives
> than we've described here. :/


The path limiting is the most important thing (protect clients accessing 
one subtree from clients accessing another subtree) but UID mangling is 
important too (protect multiple clients mounting same path from one 
another's local user DBs).  It's two different motivations.

I'm imagining that "access to path /foo/bar, all_squash to user 123" 
would be a very typical use case for multitenancy, for environments 
where each tenant is a single-UID application, but we don't really care 
what the local UIDs are.

>
>>> We probably need to mirror these in our mount options too, so that e.g.
>>> someone with an admin key can still enable root_squash at will, rather than
>>> having to craft an authentication token with the desired behaviour.
> Mmmm, given that clients normally can't see their capabilities at all
> that's a bit tricky. We could maybe accomplish it by tying in with the
> extra session exchange (that Sage referred to below); that will be
> necessary for adding clients to an existing host session dynamically
> and we could also let a user voluntarily drop certain permissions with
> it...although dropping permissions requires a client to know that they
> have them. Hrm.

The mount options could just be overrides that the client sends in the 
session open: it would be up to the MDS to perform the requested 
dropping of capabilities.  But now that I think about this more, the 
idea of defining a second syntax for clients to use to request 
subtractions from their capabilities becomes unappealing.  Maybe we 
should just say that what's in your MDSAuthCaps is what you get, and 
make sure that the associated tooling is simple enough for users to 
readily create these on a per-mount basis if they want different options.

John
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-05-26 13:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21  0:14 MDS auth caps for cephfs Sage Weil
2015-05-22  9:28 ` John Spray
2015-05-22 21:35   ` Sage Weil
2015-05-22 22:02     ` Gregory Farnum
2015-05-22 22:18       ` Sage Weil
2015-05-22 22:38         ` Gregory Farnum
2015-05-22 22:52           ` Sage Weil
2015-05-26 14:26             ` Gregory Farnum
2015-05-26 16:28               ` Sage Weil
2015-05-26 21:26                 ` Sage Weil
2015-05-26 21:53                 ` Gregory Farnum
2015-05-26 22:17                   ` Sage Weil
2015-05-26 22:50                     ` Gregory Farnum
2015-05-26 23:12                       ` Sage Weil
2015-05-26 23:32                         ` Gregory Farnum
2015-05-27 21:44                           ` Sage Weil
2015-05-27 22:03                             ` Gregory Farnum
2015-05-27 22:21                               ` Sage Weil
2015-05-27 22:40                                 ` Gregory Farnum
2015-05-27 23:07                                   ` Sage Weil
2015-05-27 23:18                                     ` Gregory Farnum
2015-05-27 23:59                                       ` Sage Weil
2015-05-28  0:11                                         ` Gregory Farnum
2015-05-28  0:37                                           ` Sage Weil
2015-05-28  0:42                                             ` Gregory Farnum
2015-05-28 16:20                                               ` Robert LeBlanc
2015-05-28 16:42                                                 ` Gregory Farnum
2015-05-28 17:02                                                   ` Sage Weil
2015-05-28 17:21                                                     ` Robert LeBlanc
2015-05-28 17:32                                                       ` Sage Weil
2015-05-28 18:29                                                         ` Robert LeBlanc
2015-06-01 19:39                                                           ` Sage Weil
2015-06-02 23:40                                                             ` Gregory Farnum
2015-05-28 17:06                                                   ` Robert LeBlanc
2015-05-26 12:56       ` John Spray [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55646D95.6070105@redhat.com \
    --to=john.spray@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=greg@gregs42.com \
    --cc=jashank42@gmail.com \
    --cc=nishtha3rai@gmail.com \
    --cc=sweil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.