Keys & caps
Hello,
this far I accessed my Ceph (0.48) FS with the client.admin key, but I'd like to change that since I don't want to allow clients to control the cluster.
I thought I should create a new key, give it some caps (don't exactly know which ones), and distribute it to clients. Here are some things I don't know/understand:
* What do the r, w, x, and * caps ("permissions"?) mean on a mon, mds, or osd?
* What's the difference between (for example) 'allow rw' and 'rw' caps? ceph auth seems to understand (and display as specified) both forms.
Not to run into issues with caps, I've created a key with the same caps as the current client.admin, but with a different key, called client.access_fs. I planned to narrow down the caps after I made the mount work with the new key.
$ sudo ceph auth list
installed auth entries:
[...]
client.access_fs
key: AQ...==
caps: [mds] allow
caps: [mon] allow *
caps: [osd] allow *
[...]I've copied the key to the client as /etc/ceph/keyring:
[client.access_fs]
key = AQ...==
I have 'keyring = /etc/ceph/keyring' in my ceph.conf [global] section on the client. Now trying to mount the filesystem fails with
$ sudo mount /mnt/ceph ceph-fuse[1784]: starting ceph client ceph-fuse[1784]: ceph mount failed with (1) Operation not permitted ceph-fuse[1782]: mount failed: (1) Operation not permitted
Adding '-o name=client.access_fs' to the command line yields the same result. If I copy the client.admin key into the keyring file, it works. (However, adding the same mount option again (so the name= parameter and the key name in the file do not match), I get an error (which seems okay to me, not sure about the correctness):
$ sudo mount /cloud/ -o name=client.access_fs ceph-fuse[1835]: starting ceph client ceph-fuse[1835]: starting fuse fuse: unknown option `name=client.access_fs' 2012-07-09 16:03:18.343793 7fb0e7b8b780 -1 fuse_lowlevel_new failed ceph-fuse[1835]: fuse finished with error 33 ceph-fuse[1833]: mount failed: (33) Numerical argument out of domain
Could you clear up the confusion in my head? :)
Thanks,
Signature · 1 line
cc
Hi,
Quoted 10 lines · Székelyi Szabolcs
Hello,
this far I accessed my Ceph (0.48) FS with the client.admin key, but I'd like to change that since I don't want to allow clients to control the cluster.
I thought I should create a new key, give it some caps (don't exactly know which ones), and distribute it to clients. Here are some things I don't know/understand:
* What do the r, w, x, and * caps ("permissions"?) mean on a mon, mds, or osd?
They roughly correspond to read, write, execute. The distinction is subtle and poorly specfied for mon caps; just use the documented values for now. For the mds, it's just 'allow', as we haven't properly defined those yet either. The osd ones are the most useful and well defined. There is a grammar in osd/OSDCap.h if you can grok the boost::spirit syntax. In addition to rwx, you can grant by pool or object prefix. There is some preliminary/incomplete support for fine-grained control over the use of rados classes.
Quoted 2 lines
* What's the difference between (for example) 'allow rw' and 'rw' caps?
ceph authseems to understand (and display as specified) both forms.
'rw' is nonsense... it needs to be (a list of) 'allow <something>' phrase(s). From the monitor's perspective, the osd and mds caps are opaque, so it won't enforce a particular syntax. At some point we can make it verify they parse properly, but that hasn't happened yet.
Quoted 41 lines
Not to run into issues with caps, I've created a key with the same caps as the current client.admin, but with a different key, called client.access_fs. I planned to narrow down the caps after I made the mount work with the new key.
$ sudo ceph auth list installed auth entries: [...] client.access_fs key: AQ...== caps: [mds] allow caps: [mon] allow * caps: [osd] allow * [...]I've copied the key to the client as
/etc/ceph/keyring:[client.access_fs]
key = AQ...==I have 'keyring =
/etc/ceph/keyring' in my ceph.conf [global] section on the client. Now trying to mount the filesystem fails with$ sudo mount /mnt/ceph ceph-fuse[1784]: starting ceph client ceph-fuse[1784]: ceph mount failed with (1) Operation not permitted ceph-fuse[1782]: mount failed: (1) Operation not permittedAdding '-o name=client.access_fs' to the command line yields the same result. If I copy the client.admin key into the keyring file, it works. (However, adding the same mount option again (so the name= parameter and the key name in the file do not match), I get an error (which seems okay to me, not sure about the correctness):
$ sudo mount /cloud/ -o name=client.access_fs ceph-fuse[1835]: starting ceph client ceph-fuse[1835]: starting fuse fuse: unknown option `name=client.access_fs' 2012-07-09 16:03:18.343793 7fb0e7b8b780 -1 fuse_lowlevel_new failed ceph-fuse[1835]: fuse finished with error 33 ceph-fuse[1833]: mount failed: (33) Numerical argument out of domain
Quoted 1 line
Could you clear up the confusion in my head? :)
The problem is that the mount.ceph command doesn't understand keyrings; it only understands secret= and secretfile=. There is a longstanding feature bug open for this
http://tracker.newdream.net/issues/266
but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
-o secretfile=/path/to/secretfile,name=access_fs
sage
Quoted 9 lines · On 2012. July 9. 09:33:22 Sage Weil wrote:
Quoted 8 lines · Székelyi Szabolcs
this far I accessed my Ceph (0.48) FS with the client.admin key, but I'd like to change that since I don't want to allow clients to control the cluster.
I thought I should create a new key, give it some caps (don't exactly know which ones), and distribute it to clients. Here are some things I don't know/understand:
Quoted 6 lines
Quoted 2 lines
* What do the r, w, x, and * caps ("permissions"?) mean on a mon, mds, or osd?
They roughly correspond to read, write, execute. The distinction is subtle and poorly specfied for mon caps; just use the documented values for now.
Does this mean that what I'm trying to achieve is not possible at the moment? I'd like to give access to my clients to the data in the filesystem, but not control over the cluster. My thought was that removing some mon caps from the clients' keys will get me there. But from what you write, it looks to me like if a client can access the data in the filesystem, it can also (for example) bring the cluster down...
Quoted 4 lines
The problem is that the mount.ceph command doesn't understand keyrings; it only understands secret= and secretfile=. There is a longstanding feature bug open for this
Quoted 8 lines
http://tracker.newdream.net/issues/266but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
-o secretfile=/path/to/secretfile,name=access_fs
Is this also true for the FUSE client? I have obscure memories about big differences between the kernel and the FUSE client, for example the latter being able to read ceph.conf, and get the necessary info, including the keyring file, from there. Maybe I didn't emphasize it, but that's what I'm using.
Thanks,
Signature · 7 lines
cc -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Székelyi Szabolcs
Quoted 9 lines · On 2012. July 9. 09:33:22 Sage Weil wrote:
Quoted 8 lines · Székelyi Szabolcs
this far I accessed my Ceph (0.48) FS with the client.admin key, but I'd like to change that since I don't want to allow clients to control the cluster.
I thought I should create a new key, give it some caps (don't exactly know which ones), and distribute it to clients. Here are some things I don't know/understand:
Quoted 6 lines
Quoted 2 lines
* What do the r, w, x, and * caps ("permissions"?) mean on a mon, mds, or osd?
They roughly correspond to read, write, execute. The distinction is subtle and poorly specfied for mon caps; just use the documented values for now.
Quoted 6 lines
Does this mean that what I'm trying to achieve is not possible at the moment? I'd like to give access to my clients to the data in the filesystem, but not control over the cluster. My thought was that removing some mon caps from the clients' keys will get me there. But from what you write, it looks to me like if a client can access the data in the filesystem, it can also (for example) bring the cluster down...
I believe your filesystem clients only need 'allow r' on the monitors, and they should be good with 'allow rw' on the OSDs (though still "allow" on the MDS). This is distinct from the "allow *" cap and does minimize some ability to cause damage. :)
Quoted 11 lines
Quoted 11 lines
The problem is that the mount.ceph command doesn't understand keyrings; it only understands secret= and secretfile=. There is a longstanding feature bug open for this
http://tracker.newdream.net/issues/266but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
Quoted 7 lines
Quoted 1 line
-o secretfile=/path/to/secretfile,name=access_fs
Is this also true for the FUSE client? I have obscure memories about big differences between the kernel and the FUSE client, for example the latter being able to read ceph.conf, and get the necessary info, including the keyring file, from there. Maybe I didn't emphasize it, but that's what I'm using.
When using ceph-fuse, you want to specify the name with --name=access_fs — no -o required.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 28 lines · On 2012. July 10. 13:09:10 Gregory Farnum wrote:
Quoted 20 lines · Székelyi Szabolcs
Quoted 11 lines · On 2012. July 9. 09:33:22 Sage Weil wrote:
Quoted 10 lines · Székelyi Szabolcs
this far I accessed my Ceph (0.48) FS with the client.admin key, but I'd
like to change that since I don't want to allow clients to control the cluster.I thought I should create a new key, give it some caps (don't exactly know
which ones), and distribute it to clients. Here are some things I don't know/understand:Quoted 7 lines
Quoted 3 lines
* What do the r, w, x, and * caps ("permissions"?) mean on a mon, mds, or
osd?They roughly correspond to read, write, execute. The distinction is subtle and poorly specfied for mon caps; just use the documented values for now.
Quoted 6 lines
Does this mean that what I'm trying to achieve is not possible at the moment? I'd like to give access to my clients to the data in the filesystem, but not control over the cluster. My thought was that removing some mon caps from the clients' keys will get me there. But from what you write, it looks to me like if a client can access the data in the filesystem, it can also (for example) bring the cluster down...
Quoted 4 lines
I believe your filesystem clients only need 'allow r' on the monitors, and they should be good with 'allow rw' on the OSDs (though still "allow" on the MDS). This is distinct from the "allow *" cap and does minimize some ability to cause damage. :)
Great, thanks!
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
The problem is that the mount.ceph command doesn't understand keyrings; it
only understands secret= and secretfile=. There is a longstanding feature
bug open for thishttp://tracker.newdream.net/issues/266but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
-o secretfile=/path/to/secretfile,name=access_fs
Quoted 8 lines
Quoted 5 lines
Is this also true for the FUSE client? I have obscure memories about big differences between the kernel and the FUSE client, for example the latter being able to read ceph.conf, and get the necessary info, including the keyring file, from there. Maybe I didn't emphasize it, but that's what I'm using.
When using ceph-fuse, you want to specify the name with --name=access_fs — no -o required.
Okay, so I don't need the "client." prefix for the key name, but how can I specify the --name= option in fstab? Or is it possible to specify it in ceph.conf, so it can be read by ceph-fuse when called by mount?
Thanks,
Signature · 7 lines
cc -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 21 lines · Sz?kelyi Szabolcs
Quoted 21 lines
Quoted 20 lines
Quoted 6 lines
The problem is that the mount.ceph command doesn't understand keyrings; it
only understands secret= and secretfile=. There is a longstanding feature
bug open for thisQuoted 8 lines
http://tracker.newdream.net/issues/266but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
-o secretfile=/path/to/secretfile,name=access_fs
Is this also true for the FUSE client? I have obscure memories about big differences between the kernel and the FUSE client, for example the latter being able to read ceph.conf, and get the necessary info, including the keyring file, from there. Maybe I didn't emphasize it, but that's what I'm using.
Quoted 6 lines
Quoted 2 lines
When using ceph-fuse, you want to specify the name with --name=access_fs ? no -o required.
Okay, so I don't need the "client." prefix for the key name, but how can I specify the --name= option in fstab? Or is it possible to specify it in ceph.conf, so it can be read by ceph-fuse when called by mount?
Er sorry, you actually want either --id foo or --name client.foo (they are equivalent) when dealing with ceph-fuse (or other userland daemons/tools).
I'm not sure what the best way of putting fuse-based file systems in fstab is, though. One way or another, though, ceph-fuse needs to be told on the command line who to authenticate as (and which sections of ceph.conf to pay attention to).
sage
Quoted 25 lines · Sage Weil
Quoted 24 lines · Sz?kelyi Szabolcs
Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
The problem is that the mount.ceph command doesn't understand keyrings; it
only understands secret= and secretfile=. There is a longstanding feature
bug open for thishttp://tracker.newdream.net/issues/266but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
Quoted 7 lines
Quoted 1 line
-o secretfile=/path/to/secretfile,name=access_fs
Is this also true for the FUSE client? I have obscure memories about big differences between the kernel and the FUSE client, for example the latter being able to read ceph.conf, and get the necessary info, including the keyring file, from there. Maybe I didn't emphasize it, but that's what I'm using.
When using ceph-fuse, you want to specify the name with --name=access_fs ? no -o required.
Quoted 6 lines
Quoted 3 lines
Okay, so I don't need the "client." prefix for the key name, but how can I specify the --name= option in fstab? Or is it possible to specify it in ceph.conf, so it can be read by ceph-fuse when called by mount?
Er sorry, you actually want either --id foo or --name client.foo (they are equivalent) when dealing with ceph-fuse (or other userland daemons/tools).
Nope — I checked this locally before sending it out. --name foo worked out fine. Although I certainly can't keep straight when we require the type prefix versus when it's added for us. *sigh*
Quoted 4 lines
I'm not sure what the best way of putting fuse-based file systems in fstab is, though. One way or another, though, ceph-fuse needs to be told on the command line who to authenticate as (and which sections of ceph.conf to pay attention to).
This is my concern, too. I don't think you can specify default IDs for ceph-fuse right now. :/
Quoted 6 lines
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 30 lines · Gregory Farnum
Quoted 29 lines · Sage Weil
Quoted 27 lines · Sz?kelyi Szabolcs
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
The problem is that the mount.ceph command doesn't understand keyrings; it
only understands secret= and secretfile=. There is a longstanding feature
bug open for thishttp://tracker.newdream.net/issues/266but it hasn't been prioritized. Sorry for the confusion! It will happen soon.
In the meantime, you need
-o secretfile=/path/to/secretfile,name=access_fs
Quoted 8 lines
Quoted 5 lines
Is this also true for the FUSE client? I have obscure memories about big differences between the kernel and the FUSE client, for example the latter being able to read ceph.conf, and get the necessary info, including the keyring file, from there. Maybe I didn't emphasize it, but that's what I'm using.
When using ceph-fuse, you want to specify the name with --name=access_fs ? no -o required.
Okay, so I don't need the "client." prefix for the key name, but how can I specify the --name= option in fstab? Or is it possible to specify it in ceph.conf, so it can be read by ceph-fuse when called by mount?
Quoted 6 lines
Quoted 2 lines
Er sorry, you actually want either --id foo or --name client.foo (they are equivalent) when dealing with ceph-fuse (or other userland daemons/tools).
Nope ? I checked this locally before sending it out. --name foo worked out fine. Although I certainly can't keep straight when we require the type prefix versus when it's added for us. *sigh*
Oh, I bet the code tries to be friendly and will behave without the 'client.' if you leave it off... but we shouldn't advertise that. Everyone, forget what you just heard!
:) sage
Quoted 22 lines
Quoted 6 lines
I'm not sure what the best way of putting fuse-based file systems in fstab is, though. One way or another, though, ceph-fuse needs to be told on the command line who to authenticate as (and which sections of ceph.conf to pay attention to).
This is my concern, too. I don't think you can specify default IDs for ceph-fuse right now. :/
Quoted 6 lines
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 35 lines · On 2012. July 10. 16:25:47 Sage Weil wrote:
Quoted 27 lines · Sz?kelyi Szabolcs
Quoted 27 lines
Quoted 26 lines
Quoted 9 lines
The problem is that the mount.ceph command doesn't understand keyrings;
it
only understands secret= and secretfile=. There is a longstanding feature
bug open for thishttp://tracker.newdream.net/issues/266Quoted 7 lines
but it hasn't been prioritized. Sorry for the confusion! It will happen
soon.In the meantime, you need
-o secretfile=/path/to/secretfile,name=access_fs
Is this also true for the FUSE client? I have obscure memories about big
differences between the kernel and the FUSE client, for example the latter
being able to read ceph.conf, and get the necessary info, including the
keyring file, from there. Maybe I didn't emphasize it, but that's what I'm
using.Quoted 6 lines
Quoted 2 lines
When using ceph-fuse, you want to specify the name with --name=access_fs ? no -o required.
Okay, so I don't need the "client." prefix for the key name, but how can I specify the --name= option in fstab? Or is it possible to specify it in ceph.conf, so it can be read by ceph-fuse when called by mount?
Quoted 7 lines
Er sorry, you actually want either --id foo or --name client.foo (they are equivalent) when dealing with ceph-fuse (or other userland daemons/tools).
I'm not sure what the best way of putting fuse-based file systems in fstab is, though. One way or another, though, ceph-fuse needs to be told on the command line who to authenticate as (and which sections of ceph.conf to pay attention to).
This seems to be possible to pass a single argument to the userspace mount program with the following syntax in fstab:
ceph-fuse#--name=client.access_fs /mnt/ceph fuse defaults 0 0
Signature · 1 line
cc