Skip to content

Commit

Permalink
Merge pull request ceph#15697 from gregsfortytwo/wip-mgr-eaccss-20296
Browse files Browse the repository at this point in the history
mgr: print a more helpful error message for when users lack mgr ceph caps

Reviewed-by: Alfredo Deza <[email protected]>
Reviewed-by: xie xingguo <[email protected]>
  • Loading branch information
liewegas authored Jun 20, 2017
2 parents 1be29e3 + 6846f48 commit 368ff5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions doc/mgr/administrator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ of ``ceph status``, which should now include a mgr status line::

mgr active: $name

Client authentication
---------------------
The manager is a new daemon which requires new CephX capabilities. If you upgrade
a cluster from an old version of Ceph, or use the default install/deploy tools,
your admin client should get this capability automatically. If you use tooling from
elsewhere, you may get EACCES errors when invoking certain ceph cluster commands.
To fix that, add a "mgr allow *" stanza to your client's cephx capabilities by
`Modifying User Capabilities`_.
High availability
-----------------

Expand Down Expand Up @@ -92,3 +101,4 @@ OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr") // where to load python
:Type: Integer
:Default: ``30``

.. _Modifying User Capabilities: ../rados/operations/user-management#modify-user-capabilities
1 change: 1 addition & 0 deletions doc/rados/operations/user-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ are often restricted to accessing a particular pool. ::
pools in the cluster!


.. _modify-user-capabilities:
Modify User Capabilities
------------------------

Expand Down
6 changes: 4 additions & 2 deletions src/mgr/DaemonServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,8 @@ bool DaemonServer::handle_command(MCommand *m)
if (!_allowed_command(session.get(), py_command.module, prefix, cmdctx->cmdmap,
param_str_map, &py_command)) {
dout(1) << " access denied" << dendl;
ss << "access denied";
ss << "access denied; does your client key have mgr caps?"
" See http://docs.ceph.com/docs/master/mgr/administrator/#client-authentication";
cmdctx->reply(-EACCES, ss);
return true;
}
Expand All @@ -562,7 +563,8 @@ bool DaemonServer::handle_command(MCommand *m)
audit_clog->info() << "from='" << session->inst << "' "
<< "entity='" << session->entity_name << "' "
<< "cmd=" << m->cmd << ": access denied";
ss << "access denied";
ss << "access denied' does your client key have mgr caps?"
" See http://docs.ceph.com/docs/master/mgr/administrator/#client-authentication";
cmdctx->reply(-EACCES, ss);
return true;
}
Expand Down

0 comments on commit 368ff5e

Please sign in to comment.