TMAegis
Aturan lainnya untuk mongodb

TMA-MONGODB-2.2

Ensure that MongoDB does not bypass authentication via the localhost exception

TinggiLevel 1Otomatismongodb

Deskripsi

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.

Cara pemeriksaan

Metode audit: Pola file

File
/etc/mongod.conf
Pola
(?m)^[ \t]*enableLocalhostAuthBypass:[ \t]*['\x22]?(?:false|0)\b

Cara perbaikan

Metode perbaikan: Panduan atau patch infrastruktur

Add 'setParameter: {enableLocalhostAuthBypass: false}' to /etc/mongod.conf (or start mongod with --setParameter enableLocalhostAuthBypass=0) and restart mongod.

Properti

Sistem operasi
Apa saja
Tag
mongodbauthentication
Referensi
CIS MongoDB 8 Benchmark v2.0.0 - 2.2 Ensure that MongoDB does not bypass authentication via the localhost exception

Periksa host ini

Jalankan ini pada mesin yang diizinkan untuk Anda audit. Pemindaian bersifat hanya baca.

shell
tmaegis scan --target mongodb