MongoDB
TMA-MONGODB-7.2
Ensure appropriate database file permissions are set
高レベル 1自動mongodb
説明
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.
チェック方法
監査方法: シェルコマンド
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- 期待される出力
compliant
修正方法
修正方法: ガイダンスまたは IaC パッチ
chmod 770 <dbPath> and chown mongodb:mongodb <dbPath> (default /var/lib/mongodb).
プロパティ
- オペレーティングシステム
- すべて
- タグ
- mongodbpermissions
- 参照
- CIS MongoDB 8 Benchmark v2.0.0 - 7.2 Ensure appropriate database file permissions are set
このホストをチェック
監査が許可されているマシンで実行してください。スキャンは読み取り専用です。
shell
tmaegis scan --target mongodb