]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonCap: add bootstrap-mgr profile
authorSage Weil <sage@redhat.com>
Mon, 13 Mar 2017 12:22:42 +0000 (08:22 -0400)
committerSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 15:39:26 +0000 (11:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonCap.cc

index 7f3582976b5c91d03f4189482daf88cba6673c76..7f6fdab4fd2b146c00fa9e63313937a6bfb3ef1a 100644 (file)
@@ -218,6 +218,14 @@ void MonCapGrant::expand_profile_mon(const 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-mgr") {
+    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 mgr keys
+    profile_grants.back().command_args["entity"] = StringConstraint("", "mgr.");
+    profile_grants.back().command_args["caps_mon"] = StringConstraint("allow profile mgr", "");
+  }
   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