Security is a multifaceted goal in a MongoDB cluster. For the rest of this chapter, we will examine different attack vectors and how we can protect against them. In addition to these best practices, developers and administrators must always use common sense so that security interferes only as much as is required for operational goals.
Security
Authentication
Authentication refers to verifying the identity of a client. This prevents the impersonation of someone in order to gain access to their data.
The simplest way to authenticate is by using a username and password pair. This can be done via the shell in two ways, the first of which is as follows:
> db.auth( <username>, <password> )
Passing in a comma-separated...