查询mongodb是否开启安全审计、查看审计日志、查看密码复杂度策略、查看口令长度、查看口令更换周期和登陆失败策略的数据库指令是什么?
时间: 2023-09-30 17:12:18 浏览: 55
查询 MongoDB 是否开启安全审计:
```
db.getMongo().getDB("admin").runCommand({getParameter: 1, auditAuthorizationSuccess: 1, auditAuthorizationFailure: 1, auditAuthenticationSuccess: 1, auditAuthenticationFailure: 1})
```
查看审计日志:
```
db.getSiblingDB("admin").getCollection("system.auditLog").find()
```
查看密码复杂度策略:
```
db.getSiblingDB("admin").runCommand({getParameters: 1, showPasswordRules: true})
```
查看口令长度:
```
db.getSiblingDB("admin").runCommand({getParameters: 1}).security.passwordValidator
```
查看口令更换周期:
```
db.getSiblingDB("admin").runCommand({getParameters: 1}).security.authenticationRestrictions
```
查看登录失败策略:
```
db.getSiblingDB("admin").runCommand({getParameters: 1}).security.authorizationFailuresLog
```
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)