TMA-MONGODB-7.2
Ensure appropriate database file permissions are set
YüksekDüzey 1Otomatikmongodb
Açıklama
MongoDB database files need to be protected using file permissions. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Checks the YAML config file /etc/mongod.conf (SKIP when it does not exist). storage.dbPath (default /var/lib/mongodb) must be 770 or stricter, with no access for other users.
Nasıl denetlenir
Denetim yöntemi: Kabuk komutu
shell
[ -r /etc/mongod.conf ] || exit 1; d=$(awk '/^[[:space:]]*dbPath:/ {v=$2; gsub(/["\047]/, "", v); print v}' /etc/mongod.conf); d=${d:-/var/lib/mongodb}; p=$(stat -c %a "$d" 2>/dev/null) || exit 1; if [ $((0$p & 007)) -eq 0 ]; then echo compliant; else echo "mode $p"; fi- Beklenen çıktı
compliant
Nasıl düzeltilir
Düzeltme yöntemi: Kılavuz veya altyapı yaması
chmod 770 <dbPath> and chown mongodb:mongodb <dbPath> (default /var/lib/mongodb).
Özellikler
- İşletim sistemleri
- Herhangi biri
- Etiketler
- mongodbpermissions
- Referans
- CIS MongoDB 8 Benchmark v2.0.0 - 7.2 Ensure appropriate database file permissions are set
Bu ana makineyi denetle
Bunu denetleme izniniz olan bir makinede çalıştırın. Tarama salt okunurdur.
shell
tmaegis scan --target mongodb