]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add 'bootstrap-rgw' profile
authorSage Weil <sage@redhat.com>
Fri, 6 Mar 2015 00:47:59 +0000 (16:47 -0800)
committerSage Weil <sage@redhat.com>
Tue, 17 Mar 2015 23:16:01 +0000 (16:16 -0700)
This profile is allowed to create client.rgw.* librados users.  They have
access to any pool, which is pretty coarse.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonCap.cc

index 059eeabf0116873551a2fb3d956ca600c0b5dd15..8c4da534098a6240010da8cb00683609a90876c7 100644 (file)
@@ -163,6 +163,15 @@ void MonCapGrant::expand_profile(EntityName name) const
     profile_grants.back().command_args["caps_osd"] = StringConstraint("allow rwx", "");
     profile_grants.back().command_args["caps_mds"] = StringConstraint("allow", "");
   }
+  if (profile == "bootstrap-rgw") {
+    profile_grants.push_back(MonCapGrant("mon", MON_CAP_R));  // read monmap
+    profile_grants.push_back(MonCapGrant("osd", MON_CAP_R));  // read osdmap
+    profile_grants.push_back(MonCapGrant("mon getmap"));
+    profile_grants.push_back(MonCapGrant("auth get-or-create"));  // FIXME: this can expose other mds keys
+    profile_grants.back().command_args["entity"] = StringConstraint("", "client.rgw.");
+    profile_grants.back().command_args["caps_mon"] = StringConstraint("allow rw", "");
+    profile_grants.back().command_args["caps_osd"] = StringConstraint("allow rwx", "");
+  }
   if (profile == "fs-client") {
     profile_grants.push_back(MonCapGrant("mon", MON_CAP_R));
     profile_grants.push_back(MonCapGrant("mds", MON_CAP_R));