]> git.proxmox.com Git - ceph.git/blame - ceph/doc/rados/configuration/auth-config-ref.rst
update sources to 12.2.7
[ceph.git] / ceph / doc / rados / configuration / auth-config-ref.rst
CommitLineData
7c673cae
FG
1========================
2 Cephx Config Reference
3========================
4
5The ``cephx`` protocol is enabled by default. Cryptographic authentication has
6some computational costs, though they should generally be quite low. If the
7network environment connecting your client and server hosts is very safe and
8you cannot afford authentication, you can turn it off. **This is not generally
9recommended**.
10
11.. note:: If you disable authentication, you are at risk of a man-in-the-middle
12 attack altering your client/server messages, which could lead to disastrous
13 security effects.
14
15For creating users, see `User Management`_. For details on the architecture
16of Cephx, see `Architecture - High Availability Authentication`_.
17
18
19Deployment Scenarios
20====================
21
22There are two main scenarios for deploying a Ceph cluster, which impact
23how you initially configure Cephx. Most first time Ceph users use
24``ceph-deploy`` to create a cluster (easiest). For clusters using
25other deployment tools (e.g., Chef, Juju, Puppet, etc.), you will need
26to use the manual procedures or configure your deployment tool to
27bootstrap your monitor(s).
28
29ceph-deploy
30-----------
31
32When you deploy a cluster with ``ceph-deploy``, you do not have to bootstrap the
33monitor manually or create the ``client.admin`` user or keyring. The steps you
34execute in the `Storage Cluster Quick Start`_ will invoke ``ceph-deploy`` to do
35that for you.
36
37When you execute ``ceph-deploy new {initial-monitor(s)}``, Ceph will create a
38monitor keyring for you (only used to bootstrap monitors), and it will generate
39an initial Ceph configuration file for you, which contains the following
40authentication settings, indicating that Ceph enables authentication by
41default::
42
43 auth_cluster_required = cephx
44 auth_service_required = cephx
45 auth_client_required = cephx
46
47When you execute ``ceph-deploy mon create-initial``, Ceph will bootstrap the
48initial monitor(s), retrieve a ``ceph.client.admin.keyring`` file containing the
49key for the ``client.admin`` user. Additionally, it will also retrieve keyrings
50that give ``ceph-deploy`` and ``ceph-disk`` utilities the ability to prepare and
51activate OSDs and metadata servers.
52
53When you execute ``ceph-deploy admin {node-name}`` (**note:** Ceph must be
54installed first), you are pushing a Ceph configuration file and the
55``ceph.client.admin.keyring`` to the ``/etc/ceph`` directory of the node. You
56will be able to execute Ceph administrative functions as ``root`` on the command
57line of that node.
58
59
60Manual Deployment
61-----------------
62
63When you deploy a cluster manually, you have to bootstrap the monitor manually
64and create the ``client.admin`` user and keyring. To bootstrap monitors, follow
65the steps in `Monitor Bootstrapping`_. The steps for monitor bootstrapping are
66the logical steps you must perform when using third party deployment tools like
67Chef, Puppet, Juju, etc.
68
69
70Enabling/Disabling Cephx
71========================
72
73Enabling Cephx requires that you have deployed keys for your monitors,
74OSDs and metadata servers. If you are simply toggling Cephx on / off,
75you do not have to repeat the bootstrapping procedures.
76
77
78Enabling Cephx
79--------------
80
81When ``cephx`` is enabled, Ceph will look for the keyring in the default search
82path, which includes ``/etc/ceph/$cluster.$name.keyring``. You can override
83this location by adding a ``keyring`` option in the ``[global]`` section of
84your `Ceph configuration`_ file, but this is not recommended.
85
86Execute the following procedures to enable ``cephx`` on a cluster with
87authentication disabled. If you (or your deployment utility) have already
88generated the keys, you may skip the steps related to generating keys.
89
90#. Create a ``client.admin`` key, and save a copy of the key for your client
91 host::
92
93 ceph auth get-or-create client.admin mon 'allow *' mds 'allow *' osd 'allow *' -o /etc/ceph/ceph.client.admin.keyring
94
95 **Warning:** This will clobber any existing
96 ``/etc/ceph/client.admin.keyring`` file. Do not perform this step if a
97 deployment tool has already done it for you. Be careful!
98
99#. Create a keyring for your monitor cluster and generate a monitor
100 secret key. ::
101
102 ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'
103
104#. Copy the monitor keyring into a ``ceph.mon.keyring`` file in every monitor's
105 ``mon data`` directory. For example, to copy it to ``mon.a`` in cluster ``ceph``,
106 use the following::
107
108 cp /tmp/ceph.mon.keyring /var/lib/ceph/mon/ceph-a/keyring
109
110#. Generate a secret key for every OSD, where ``{$id}`` is the OSD number::
111
112 ceph auth get-or-create osd.{$id} mon 'allow rwx' osd 'allow *' -o /var/lib/ceph/osd/ceph-{$id}/keyring
113
114#. Generate a secret key for every MDS, where ``{$id}`` is the MDS letter::
115
116 ceph auth get-or-create mds.{$id} mon 'allow rwx' osd 'allow *' mds 'allow *' -o /var/lib/ceph/mds/ceph-{$id}/keyring
117
118#. Enable ``cephx`` authentication by setting the following options in the
119 ``[global]`` section of your `Ceph configuration`_ file::
120
121 auth cluster required = cephx
122 auth service required = cephx
123 auth client required = cephx
124
125
126#. Start or restart the Ceph cluster. See `Operating a Cluster`_ for details.
127
128For details on bootstrapping a monitor manually, see `Manual Deployment`_.
129
130
131
132Disabling Cephx
133---------------
134
135The following procedure describes how to disable Cephx. If your cluster
136environment is relatively safe, you can offset the computation expense of
137running authentication. **We do not recommend it.** However, it may be easier
138during setup and/or troubleshooting to temporarily disable authentication.
139
140#. Disable ``cephx`` authentication by setting the following options in the
141 ``[global]`` section of your `Ceph configuration`_ file::
142
143 auth cluster required = none
144 auth service required = none
145 auth client required = none
146
147
148#. Start or restart the Ceph cluster. See `Operating a Cluster`_ for details.
149
150
151Configuration Settings
152======================
153
154Enablement
155----------
156
157
158``auth cluster required``
159
160:Description: If enabled, the Ceph Storage Cluster daemons (i.e., ``ceph-mon``,
161 ``ceph-osd``, and ``ceph-mds``) must authenticate with
162 each other. Valid settings are ``cephx`` or ``none``.
163
164:Type: String
165:Required: No
166:Default: ``cephx``.
167
168
169``auth service required``
170
171:Description: If enabled, the Ceph Storage Cluster daemons require Ceph Clients
172 to authenticate with the Ceph Storage Cluster in order to access
173 Ceph services. Valid settings are ``cephx`` or ``none``.
174
175:Type: String
176:Required: No
177:Default: ``cephx``.
178
179
180``auth client required``
181
182:Description: If enabled, the Ceph Client requires the Ceph Storage Cluster to
183 authenticate with the Ceph Client. Valid settings are ``cephx``
184 or ``none``.
185
186:Type: String
187:Required: No
188:Default: ``cephx``.
189
190
191.. index:: keys; keyring
192
193Keys
194----
195
196When you run Ceph with authentication enabled, ``ceph`` administrative commands
197and Ceph Clients require authentication keys to access the Ceph Storage Cluster.
198
199The most common way to provide these keys to the ``ceph`` administrative
200commands and clients is to include a Ceph keyring under the ``/etc/ceph``
201directory. For Cuttlefish and later releases using ``ceph-deploy``, the filename
202is usually ``ceph.client.admin.keyring`` (or ``$cluster.client.admin.keyring``).
203If you include the keyring under the ``/etc/ceph`` directory, you don't need to
204specify a ``keyring`` entry in your Ceph configuration file.
205
206We recommend copying the Ceph Storage Cluster's keyring file to nodes where you
207will run administrative commands, because it contains the ``client.admin`` key.
208
209You may use ``ceph-deploy admin`` to perform this task. See `Create an Admin
210Host`_ for details. To perform this step manually, execute the following::
211
212 sudo scp {user}@{ceph-cluster-host}:/etc/ceph/ceph.client.admin.keyring /etc/ceph/ceph.client.admin.keyring
213
214.. tip:: Ensure the ``ceph.keyring`` file has appropriate permissions set
215 (e.g., ``chmod 644``) on your client machine.
216
217You may specify the key itself in the Ceph configuration file using the ``key``
218setting (not recommended), or a path to a keyfile using the ``keyfile`` setting.
219
220
221``keyring``
222
223:Description: The path to the keyring file.
224:Type: String
225:Required: No
226:Default: ``/etc/ceph/$cluster.$name.keyring,/etc/ceph/$cluster.keyring,/etc/ceph/keyring,/etc/ceph/keyring.bin``
227
228
229``keyfile``
230
231:Description: The path to a key file (i.e,. a file containing only the key).
232:Type: String
233:Required: No
234:Default: None
235
236
237``key``
238
239:Description: The key (i.e., the text string of the key itself). Not recommended.
240:Type: String
241:Required: No
242:Default: None
243
244
245Daemon Keyrings
246---------------
247
248Administrative users or deployment tools (e.g., ``ceph-deploy``) may generate
249daemon keyrings in the same way as generating user keyrings. By default, Ceph
250stores daemons keyrings inside their data directory. The default keyring
251locations, and the capabilities necessary for the daemon to function, are shown
252below.
253
254``ceph-mon``
255
256:Location: ``$mon_data/keyring``
257:Capabilities: ``mon 'allow *'``
258
259``ceph-osd``
260
261:Location: ``$osd_data/keyring``
262:Capabilities: ``mon 'allow profile osd' osd 'allow *'``
263
264``ceph-mds``
265
266:Location: ``$mds_data/keyring``
267:Capabilities: ``mds 'allow' mon 'allow profile mds' osd 'allow rwx'``
268
269``radosgw``
270
271:Location: ``$rgw_data/keyring``
272:Capabilities: ``mon 'allow rwx' osd 'allow rwx'``
273
274
275.. note:: The monitor keyring (i.e., ``mon.``) contains a key but no
276 capabilities, and is not part of the cluster ``auth`` database.
277
278The daemon data directory locations default to directories of the form::
279
280 /var/lib/ceph/$type/$cluster-$id
281
282For example, ``osd.12`` would be::
283
284 /var/lib/ceph/osd/ceph-12
285
286You can override these locations, but it is not recommended.
287
288
289.. index:: signatures
290
291Signatures
292----------
293
28e407b8
AA
294Ceph performs a signature check that provides some limited protection
295against messages being tampered with in flight (e.g., by a "man in the
296middle" attack).
7c673cae
FG
297
298Like other parts of Ceph authentication, Ceph provides fine-grained control so
299you can enable/disable signatures for service messages between the client and
300Ceph, and you can enable/disable signatures for messages between Ceph daemons.
301
28e407b8
AA
302Note that even with signatures enabled data is not encrypted in
303flight.
7c673cae
FG
304
305``cephx require signatures``
306
307:Description: If set to ``true``, Ceph requires signatures on all message
308 traffic between the Ceph Client and the Ceph Storage Cluster, and
309 between daemons comprising the Ceph Storage Cluster.
310
28e407b8
AA
311 Ceph Argonaut and Linux kernel versions prior to 3.19 do
312 not support signatures; if such clients are in use this
313 option can be turned off to allow them to connect.
314
7c673cae
FG
315:Type: Boolean
316:Required: No
317:Default: ``false``
318
319
320``cephx cluster require signatures``
321
322:Description: If set to ``true``, Ceph requires signatures on all message
323 traffic between Ceph daemons comprising the Ceph Storage Cluster.
324
325:Type: Boolean
326:Required: No
327:Default: ``false``
328
329
330``cephx service require signatures``
331
332:Description: If set to ``true``, Ceph requires signatures on all message
333 traffic between Ceph Clients and the Ceph Storage Cluster.
334
335:Type: Boolean
336:Required: No
337:Default: ``false``
338
339
340``cephx sign messages``
341
342:Description: If the Ceph version supports message signing, Ceph will sign
28e407b8 343 all messages so they are more difficult to spoof.
7c673cae
FG
344
345:Type: Boolean
346:Default: ``true``
347
348
349Time to Live
350------------
351
352``auth service ticket ttl``
353
354:Description: When the Ceph Storage Cluster sends a Ceph Client a ticket for
355 authentication, the Ceph Storage Cluster assigns the ticket a
356 time to live.
357
358:Type: Double
359:Default: ``60*60``
360
361
362Backward Compatibility
363======================
364
365For Cuttlefish and earlier releases, see `Cephx`_.
366
367In Ceph Argonaut v0.48 and earlier versions, if you enable ``cephx``
368authentication, Ceph only authenticates the initial communication between the
369client and daemon; Ceph does not authenticate the subsequent messages they send
370to each other, which has security implications. In Ceph Bobtail and subsequent
371versions, Ceph authenticates all ongoing messages between the entities using the
372session key set up for that initial authentication.
373
374We identified a backward compatibility issue between Argonaut v0.48 (and prior
375versions) and Bobtail (and subsequent versions). During testing, if you
376attempted to use Argonaut (and earlier) daemons with Bobtail (and later)
377daemons, the Argonaut daemons did not know how to perform ongoing message
378authentication, while the Bobtail versions of the daemons insist on
379authenticating message traffic subsequent to the initial
380request/response--making it impossible for Argonaut (and prior) daemons to
381interoperate with Bobtail (and subsequent) daemons.
382
383We have addressed this potential problem by providing a means for Argonaut (and
384prior) systems to interact with Bobtail (and subsequent) systems. Here's how it
385works: by default, the newer systems will not insist on seeing signatures from
386older systems that do not know how to perform them, but will simply accept such
387messages without authenticating them. This new default behavior provides the
388advantage of allowing two different releases to interact. **We do not recommend
389this as a long term solution**. Allowing newer daemons to forgo ongoing
390authentication has the unfortunate security effect that an attacker with control
391of some of your machines or some access to your network can disable session
392security simply by claiming to be unable to sign messages.
393
394.. note:: Even if you don't actually run any old versions of Ceph,
395 the attacker may be able to force some messages to be accepted unsigned in the
396 default scenario. While running Cephx with the default scenario, Ceph still
397 authenticates the initial communication, but you lose desirable session security.
398
399If you know that you are not running older versions of Ceph, or you are willing
400to accept that old servers and new servers will not be able to interoperate, you
401can eliminate this security risk. If you do so, any Ceph system that is new
402enough to support session authentication and that has Cephx enabled will reject
403unsigned messages. To preclude new servers from interacting with old servers,
404include the following in the ``[global]`` section of your `Ceph
405configuration`_ file directly below the line that specifies the use of Cephx
406for authentication::
407
408 cephx require signatures = true ; everywhere possible
409
410You can also selectively require signatures for cluster internal
411communications only, separate from client-facing service::
412
413 cephx cluster require signatures = true ; for cluster-internal communication
414 cephx service require signatures = true ; for client-facing service
415
416An option to make a client require signatures from the cluster is not
417yet implemented.
418
419**We recommend migrating all daemons to the newer versions and enabling the
420foregoing flag** at the nearest practical time so that you may avail yourself
421of the enhanced authentication.
422
423.. note:: Ceph kernel modules do not support signatures yet.
424
425
426.. _Storage Cluster Quick Start: ../../../start/quick-ceph-deploy/
427.. _Monitor Bootstrapping: ../../../install/manual-deployment#monitor-bootstrapping
428.. _Operating a Cluster: ../../operations/operating
429.. _Manual Deployment: ../../../install/manual-deployment
430.. _Cephx: http://docs.ceph.com/docs/cuttlefish/rados/configuration/auth-config-ref/
431.. _Ceph configuration: ../ceph-conf
432.. _Create an Admin Host: ../../deployment/ceph-deploy-admin
433.. _Architecture - High Availability Authentication: ../../../architecture#high-availability-authentication
434.. _User Management: ../../operations/user-management