TMA-MONGODB-2.2
Ensure that MongoDB does not bypass authentication via the localhost exception
Mô tả
MongoDB should not be set to bypass authentication via the localhost exception. The localhost exception allows the user to enable authorization before creating the first user in the system. When active, the localhost exception allows all connections from the localhost interface to have full access to that instance. The exception applies only when there are no users created in the MongoDB instance. Checks the YAML config file /etc/mongod.conf (SKIP when it does not exist). The localhost exception is enabled by default, so the setting must be present and false.
Cách kiểm tra
Phương pháp kiểm tra: Mẫu tệp
- Tệp
/etc/mongod.conf- Mẫu khớp
(?m)^[ \t]*enableLocalhostAuthBypass:[ \t]*['\x22]?(?:false|0)\b
Cách khắc phục
Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng
Add 'setParameter: {enableLocalhostAuthBypass: false}' to /etc/mongod.conf (or start mongod with --setParameter enableLocalhostAuthBypass=0) and restart mongod.
Thuộc tính
- Hệ điều hành
- Bất kỳ
- Thẻ
- mongodbauthentication
- Tham chiếu
- CIS MongoDB 8 Benchmark v2.0.0 - 2.2 Ensure that MongoDB does not bypass authentication via the localhost exception
Kiểm tra máy này
Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.
tmaegis scan --target mongodb