TMA-MONGODB-3.3
Ensure that MongoDB is run using a non-privileged, dedicated service account
高レベル 1自動mongodb
説明
The MongoDB service should not be run using a privileged account such as 'root' because this unnecessarily exposes the operating system to high risk. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Passes when every running mongod/mongos process runs as a non-root account (FAIL when none are running).
チェック方法
監査方法: シェルコマンド
shell
out=$(ps -eo user=,comm= 2>/dev/null) || exit 1; printf '%s\n' "$out" | awk '$2 == "mongod" || $2 == "mongos" {n++; if ($1 == "root") r++} END {if (n == 0) print "not running"; else if (r > 0) print "root"; else print "compliant"}'- 期待される出力
compliant
修正方法
修正方法: ガイダンスまたは IaC パッチ
Create a dedicated mongodb system account, make the data, keyfile and TLS key files readable only by it, set User=mongodb in the service unit and restart mongod.
プロパティ
- オペレーティングシステム
- すべて
- タグ
- mongodbservice-account
- 参照
- CIS MongoDB 8 Benchmark v2.0.0 - 3.3 Ensure that MongoDB is run using a non-privileged, dedicated service account
このホストをチェック
監査が許可されているマシンで実行してください。スキャンは読み取り専用です。
shell
tmaegis scan --target mongodb