TMAegisBeta
More rules for mongodb

MongoDB

TMA-MONGO-CONFIG-PERMISSIONS

Ensure /etc/mongod.conf is not writable by group or readable by others

MediumLevel 1Automatedmongodb

Description

The configuration file can reference key files and TLS settings; it should be mode 640 or stricter. SKIP when the file does not exist.

How it is checked

Audit method: Shell command

shell
p=$(stat -c %a /etc/mongod.conf 2>/dev/null) || exit 1; if [ $((0$p & 037)) -eq 0 ]; then echo compliant; else echo "mode $p"; fi
Expected output
compliant

How it is fixed

Fix method: Shell command

shell
chmod 640 /etc/mongod.conf

Properties

Operating systems
Any
Tags
mongodbdatabasepermissionsfilesystem
Reference
CIS MongoDB Benchmark - File Permissions / Configuration File (verify section number for your release)

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target mongodb