Which of the following is true about the auth and the bind_ipsettings in MongoDB for a mongod instance in terms of best practice for security? Check all that apply:
题目选项
- A.The setting bind_ip limits access to the defined list of IP addresses.
- B.The setting auth should be used with bind_ip to combine authentication with a list of allowable external IP addresses.
- C.The setting bind_ip only limits access with regard to external IP addresses, local host IP addresses can still connect normally.
答案置信度:高
正确答案:A、B
解析语言:中文
bindIp 把监听地址限制在列表内的 IP 上,从网络层缩小暴露面;最佳实践是同时开启 auth(authorization),让连接既受 IP 白名单限制又必须通过身份认证,所以 A、B 正确。C 错在 bindIp 同样限制本机来源——只有把 127.0.0.1 写进列表本机才能连,未列出的 localhost 连接会被拒绝(localhost exception 只与“库中还没有用户”有关)。