Database Manual / Self-Managed Deployments / Security

Security Reference for Self-Managed Deployments自我管理部署的安全参考

The following lists the security related methods available in mongosh as well as additional security reference material.下面列出了mongosh中可用的安全相关方法以及其他安全参考资料。

Security Methods in mongoshmongosh中的安全方法

User Management and Authentication Methods用户管理和身份验证方法

Name名称Description描述
db.auth()Authenticates a user to a database.对数据库中的用户进行身份验证。
db.changeUserPassword()Changes an existing user's password.更改现有用户的密码。
db.createUser()Creates a new user.创建新用户。
db.dropUser()Removes a single user.删除单个用户。
db.dropAllUsers()Deletes all users associated with a database.删除与数据库关联的所有用户。
db.getUser()Returns information about the specified user.返回指定用户的信息。
db.getUsers()Returns information about all users associated with a database.返回与数据库关联的所有用户的信息。
db.grantRolesToUser()Grants a role and its privileges to a user.向用户授予角色及其权限。
db.removeUser()Deprecated. Removes a user from a database.已弃用。从数据库中删除用户。
db.revokeRolesFromUser()Removes a role from a user.从用户中删除角色。
db.updateUser()Updates user data.更新用户数据。
passwordPrompt()Prompts for the password as an alternative to specifying passwords directly in various mongosh user authentication/management methods.提示输入密码,作为在各种mongosh用户身份验证/管理方法中直接指定密码的替代方法。

Role Management Methods角色管理方法

Name名称Description描述
db.createRole()Creates a role and specifies its privileges.创建角色并指定其权限。
db.dropRole()Deletes a user-defined role.删除用户定义的角色。
db.dropAllRoles()Deletes all user-defined roles associated with a database.删除与数据库关联的所有用户定义角色。
db.getRole()Returns information for the specified role.返回指定角色的信息。
db.getRoles()Returns information for all the user-defined roles in a database.返回数据库中所有用户定义角色的信息。
db.grantPrivilegesToRole()Assigns privileges to a user-defined role.为用户定义的角色分配权限。
db.revokePrivilegesFromRole()Removes the specified privileges from a user-defined role.从用户定义的角色中删除指定的权限。
db.grantRolesToRole()Specifies roles from which a user-defined role inherits privileges.指定用户定义角色从中继承权限的角色。
db.revokeRolesFromRole()Removes inherited roles from a role.从角色中删除继承的角色。
db.updateRole()Updates a user-defined role.更新用户定义的角色。

Security Reference Documentation安全参考文件

system.roles Collection in Self-Managed Deployments自我管理部署中的system.roles集合
Describes the content of the collection that stores user-defined roles.描述存储用户定义角色的集合的内容。
system.users Collection in Self-Managed Deployments自我管理部署中的system.users集合
Describes the content of the collection that stores users' credentials and role assignments.描述存储用户凭据和角色分配的集合的内容。
Resource Document on Self-Managed Deployments关于自我管理部署的资源文档
Describes the resource document for roles.描述角色的资源文档。
Privilege Actions权限操作
List of the actions available for privileges.可用于权限的操作列表。