TMAegis
Weitere Regeln für mongodb

TMA-MONGODB-7.2

Ensure appropriate database file permissions are set

HochStufe 1Automatisiertmongodb

Beschreibung

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.

So wird geprüft

Prüfmethode: Shell-Befehl

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
Erwartete Ausgabe
compliant

So wird behoben

Behebungsmethode: Anleitung oder Infrastruktur-Patch

chmod 770 <dbPath> and chown mongodb:mongodb <dbPath> (default /var/lib/mongodb).

Eigenschaften

Betriebssysteme
Beliebig
Tags
mongodbpermissions
Referenz
CIS MongoDB 8 Benchmark v2.0.0 - 7.2 Ensure appropriate database file permissions are set

Diesen Host prüfen

Führen Sie dies auf einem Rechner aus, den Sie prüfen dürfen. Der Scan ist schreibgeschützt.

shell
tmaegis scan --target mongodb