Skip to content

Commit 70f43dd

Browse files
author
Sam Kleinman
committed
DOCS-221 adding a security section to the sharding section
1 parent 9526cd9 commit 70f43dd

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

source/core/sharding.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,3 +469,60 @@ prevent the balancing process from interfering with production traffic.
469469
is entirely transparent to the user and application layer. This
470470
documentation is only included for your edification and possible
471471
troubleshooting purposes.
472+
473+
.. index:: sharding; security
474+
.. _sharding-security:
475+
476+
Security
477+
--------
478+
479+
.. note::
480+
481+
You may always run shard clusters in trusted networking
482+
environments that control access to the cluster using network rules
483+
and restrictions to ensure that only known traffic reaches your
484+
:program:`mongod` and :program:`mongos` instances.
485+
486+
.. warning:: Limitations
487+
488+
.. versionchanged:: 2.2
489+
In version 2.0, shard clusters will not enforce read-only
490+
limitations.
491+
492+
.. versionchanged:: 2.0
493+
In version 1.8, shard clusters will not support authentication
494+
and access control. You must run your clusters in a trusted
495+
environment.
496+
497+
To control access a shard cluster, you must set the :setting:`keyFile`
498+
option on all components of the shard cluster. Use the
499+
:option:`--keyFile <mongos --keyFile>` run-time option or
500+
:setting:`keyFile` configuration file option all :program:`mongos`,
501+
config database :program:`mongod` instances, and shard
502+
:program:`mongod` instances.
503+
504+
There are two classes of security credentials in a shard cluster:
505+
credentials for "admin" users (i.e. for the "admin" database) and
506+
credentials for all other databases. These credentials reside in
507+
different locations within the shard cluster and have different roles:
508+
509+
#. Admin database credentials reside on the config databases, to
510+
receive admin access to the cluster you *must* authenticate a
511+
sessions while connected to a {{mongos}} instance using the "admin"
512+
database.
513+
514+
#. Other database credentials reside on the *primary* shard for the
515+
database.
516+
517+
This means that you *can* authenticate to these users and databases
518+
while connected directly to the primary shard for a database. However,
519+
for clarity and consistency all interactions between the client and
520+
the database should use a :program:`mongos` instance.
521+
522+
.. note::
523+
524+
Individual shards can store administrative credentials to their
525+
instance, which only permit access to a single shard. MongoDB
526+
stores these credentials in the shards "admin" databases and these
527+
credentials are *completely* distinct from the cluster-wide
528+
administrative credentials.

0 commit comments

Comments
 (0)